/**
 * SIRE Dashboard Styles
 * Vault performance tracking dashboard
 */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.page-header p {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: #94a3b8;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(34, 197, 94, 0.15) 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.verified-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(148, 163, 184, 0.3);
}

.metric-card:nth-child(1):hover {
    box-shadow: 0 12px 40px rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
}

.metric-card:nth-child(2):hover {
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.metric-card:nth-child(3):hover {
    box-shadow: 0 12px 40px rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.3);
}

.metric-card:nth-child(4):hover {
    box-shadow: 0 12px 40px rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.3);
}

.metric-card:nth-child(5):hover {
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.metric-label {
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.metric-value.positive {
    color: #10b981;
}

.metric-value.neutral {
    color: #e2e8f0;
}

.metric-value.purple {
    color: #a78bfa;
}

.metric-value.blue {
    color: #60a5fa;
}

.metric-value.orange {
    color: #f97316;
}

.metric-value.slate {
    color: #94a3b8;
}

.metric-change {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 40px 0 20px;
}

.info-box {
    display: block;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-left: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 40px;
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.info-box-icon {
    font-size: 1.5rem;
}

.info-box-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #60a5fa;
}

.info-box-content {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
}

.info-box-content p {
    margin-bottom: 16px;
}

.info-box-content p:last-child {
    margin-bottom: 0;
}

.info-box-content strong {
    color: #e2e8f0;
    font-weight: 600;
}

.info-box-content ul {
    margin: 12px 0;
    padding-left: 20px;
    list-style: disc;
}

.info-box-content li {
    margin-bottom: 8px;
    display: list-item;
}

.formula-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    font-family: 'Courier New', monospace;
    color: #a78bfa;
}

.chart-container {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-icon {
    font-size: 1.2rem;
}

.chart-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(96, 165, 250, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 50%;
    font-size: 0.75rem;
    color: #60a5fa;
    cursor: help;
    transition: all 0.2s ease;
}

.info-tooltip:hover {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.5);
}

.info-tooltip .tooltip-text {
    visibility: hidden;
    width: 320px;
    background: rgba(15, 23, 42, 0.98);
    color: #cbd5e1;
    text-align: left;
    border-radius: 8px;
    padding: 12px 16px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -160px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.info-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.98) transparent transparent transparent;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.staking-stats {
    display: flex;
    gap: 20px;
}

.staking-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.staking-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #60a5fa;
}

.staking-stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sport-table-container {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.sport-table {
    width: 100%;
    border-collapse: collapse;
}

.sport-table th {
    background: rgba(15, 23, 42, 0.6);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.sport-table th:hover {
    background: rgba(15, 23, 42, 0.8);
}

.sport-table th.sorted {
    color: #60a5fa;
}

.sport-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 0.95rem;
}

.sport-table tr:hover {
    background: rgba(96, 165, 250, 0.05);
}

.sport-table .profit {
    color: #10b981;
    font-weight: 600;
}

.sport-table .loss {
    color: #f97316;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.win {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge.loss {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.badge.mixed {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Sport table row clickable styling */
.sport-table tbody tr[onclick] {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sport-table tbody tr[onclick]:hover {
    background: rgba(96, 165, 250, 0.1);
}

.sport-expand {
    display: inline-block;
    font-size: 0.7rem;
    color: #64748b;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.sport-table tbody tr:hover .sport-expand {
    color: #60a5fa;
}

.stats-table-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-table {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 24px;
}

.stats-table h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row .period {
    color: #94a3b8;
    font-size: 0.9rem;
}

.stats-row .amount {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Sport Modal Styles */
.sport-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.sport-modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.sport-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sport-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.sport-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.sport-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.sport-modal-close:hover {
    color: #f97316;
}

.sport-modal-subtitle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.sport-modal-subtitle span:first-child {
    color: #94a3b8;
    font-size: 0.9rem;
    flex: 1;
}

.community-badge {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(167, 139, 250, 0.2) 100%);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.community-badge.verified {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(34, 197, 94, 0.15) 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.other-notice {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 24px;
    color: #10b981;
    font-size: 0.85rem;
    display: none;
}

.other-notice.visible {
    display: block;
}

.other-notice strong {
    color: #34d399;
}

.sport-modal-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.games-table {
    width: 100%;
    border-collapse: collapse;
}

.games-table th {
    background: rgba(15, 23, 42, 0.95);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.games-table th:hover {
    color: #60a5fa;
    background: rgba(15, 23, 42, 1);
}

.games-table th.sorted-asc::after,
.games-table th.sorted-desc::after {
    content: '';
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
}

.games-table th.sorted-asc::after {
    border-bottom-color: #60a5fa;
    margin-bottom: -2px;
}

.games-table th.sorted-desc::after {
    border-top-color: #60a5fa;
    margin-top: -2px;
}

.games-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 0.9rem;
    color: #e2e8f0;
}

.games-table tr:hover {
    background: rgba(96, 165, 250, 0.05);
}

.games-table .profit {
    color: #10b981;
    font-weight: 600;
}

.games-table .loss {
    color: #f97316;
    font-weight: 600;
}

.games-table .event-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sport-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    text-align: center;
}

.sport-modal-footer p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.sport-modal-footer a {
    color: #60a5fa;
    text-decoration: none;
}

.sport-modal-footer a:hover {
    text-decoration: underline;
}

/* Clickable sport rows */
#sportTableBody tr {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

#sportTableBody tr td:first-child {
    position: relative;
    padding-left: 24px;
}

/* Subtle always-visible arrow indicator */
#sportTableBody tr td:first-child::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid rgba(96, 165, 250, 0.35);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: all 0.2s ease;
}

#sportTableBody tr:hover {
    background: rgba(96, 165, 250, 0.1);
}

#sportTableBody tr:hover td:first-child::before {
    border-left-color: #60a5fa;
    left: 10px;
}

/* Click hint text under sport table */
.sport-table-hint {
    text-align: center;
    color: #64748b;
    font-size: 0.75rem;
    padding: 8px 0 0 0;
    margin-top: -4px;
}

.sport-table-hint span {
    background: rgba(96, 165, 250, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-label {
        font-size: 0.8rem;
    }

    .metric-change {
        font-size: 0.7rem;
    }

    .chart-container {
        height: 300px;
        padding: 16px;
    }

    .chart-canvas {
        height: calc(100% - 35px);
    }

    .chart-title {
        font-size: 1rem;
    }

    .info-tooltip .tooltip-text {
        width: 260px;
        margin-left: -130px;
        font-size: 0.8rem;
    }

    .info-box {
        padding: 20px;
    }

    .info-box-title {
        font-size: 1.1rem;
    }

    .info-box-content {
        font-size: 0.9rem;
    }

    .formula-box {
        font-size: 0.85rem;
        padding: 12px;
        overflow-x: auto;
    }

    .sport-table-container {
        padding: 16px;
    }

    .sport-table {
        font-size: 0.85rem;
    }

    .sport-table th,
    .sport-table td {
        padding: 10px 8px;
    }

    .stats-table-container {
        grid-template-columns: 1fr;
    }

    .stats-table {
        padding: 20px;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .sport-modal {
        padding: 10px;
    }

    .sport-modal-content {
        margin: 10px auto;
        border-radius: 12px;
    }

    .sport-modal-header {
        padding: 16px;
    }

    .sport-modal-header h3 {
        font-size: 1.1rem;
    }

    .sport-modal-subtitle {
        padding: 10px 16px;
        flex-direction: row;
        align-items: center;
    }

    .sport-modal-subtitle span:first-child {
        font-size: 0.8rem;
        flex: 1;
    }

    .community-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .other-notice {
        margin: 12px 16px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .games-table th,
    .games-table td {
        padding: 8px 6px;
        font-size: 0.7rem;
    }

    .games-table .event-cell {
        max-width: 80px;
    }

    .sport-modal-body {
        max-height: 55vh;
    }

    .sport-modal-footer {
        padding: 12px 16px;
    }

    .sport-modal-footer p {
        font-size: 0.75rem;
    }

    /* Hide Score column on mobile */
    .games-table th:nth-child(5),
    .games-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        gap: 8px;
    }

    .metric-card {
        padding: 12px;
    }

    .metric-value {
        font-size: 1.25rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .metric-change {
        font-size: 0.65rem;
    }

    .chart-container {
        height: 250px;
    }

    .sport-table th,
    .sport-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .stats-row .period,
    .stats-row .amount {
        font-size: 0.85rem;
    }

    .info-box {
        padding: 15px;
    }

    .info-box-content {
        font-size: 0.85rem;
    }

    .formula-box {
        font-size: 0.75rem;
        padding: 10px;
    }

    .sport-modal-header h3 {
        font-size: 1rem;
    }

    .games-table th,
    .games-table td {
        padding: 6px 4px;
        font-size: 0.65rem;
    }

    .games-table .event-cell {
        max-width: 60px;
    }

    /* Also hide Selection column on very small screens */
    .games-table th:nth-child(3),
    .games-table td:nth-child(3) {
        display: none;
    }

    .badge {
        padding: 2px 6px;
        font-size: 0.6rem;
    }
}
