:root {
    --sov-teal: #00f2e2;
    --sov-orange: #ff6b00;
    --sov-blue: #2196F3;
    --bg-dark: #0B0F23;
    --bg-card: #1a1e3a;
    --bg-card-hover: #242850;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(0, 242, 226, 0.2);
}

* {
    box-sizing: border-box;
}

.sovryn-staking-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Header */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.dashboard-header h2 {
    color: var(--sov-teal);
    font-size: 2.8rem;
    margin-bottom: 12px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 242, 226, 0.3);
    letter-spacing: -0.5px;
}

.dashboard-header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Period Selector */
.period-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 12px 28px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

.period-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 242, 226, 0.1), transparent);
    transition: left 0.5s;
}

.period-btn:hover::before {
    left: 100%;
}

.period-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--sov-teal);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 242, 226, 0.2);
}

.period-btn.active {
    background: var(--sov-teal);
    border-color: var(--sov-teal);
    color: var(--bg-dark);
    box-shadow: 0 8px 20px rgba(0, 242, 226, 0.4);
}

/* Loading */
.loading-indicator {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 242, 226, 0.1);
    border-top: 4px solid var(--sov-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-indicator p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    transition: opacity 0.3s ease;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sov-teal), var(--sov-orange));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 242, 226, 0.25);
    border-color: var(--sov-teal);
    background: var(--bg-card-hover);
}

.stat-icon {
    font-size: 3rem;
    min-width: 70px;
    text-align: center;
    filter: drop-shadow(0 0 10px rgba(0, 242, 226, 0.3));
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--sov-teal);
    text-shadow: 0 0 10px rgba(0, 242, 226, 0.3);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Charts */
.charts-section {
    margin-bottom: 40px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 35px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.chart-card h3 {
    color: var(--sov-teal);
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
}

#revenue-chart {
    max-width: 100%;
    height: auto !important;
}

/* ROI Calculator */
.roi-calculator {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.roi-calculator h2 {
    color: var(--sov-teal);
    font-size: 2.2rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.calculator-desc {
    color: var(--text-secondary);
    margin-bottom: 35px;
    font-size: 1.05rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 35px;
}

.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.input-group input {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    min-height: 44px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--sov-teal);
    box-shadow: 0 0 0 4px rgba(0, 242, 226, 0.1);
    background: rgba(0, 242, 226, 0.05);
}

.input-group small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.input-with-button {
    display: flex;
    gap: 12px;
}

.input-with-button input {
    flex: 1;
}

.primary-btn, .secondary-btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-btn {
    background: linear-gradient(135deg, var(--sov-teal), var(--sov-blue));
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(0, 242, 226, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 226, 0.5);
}

.secondary-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 14px 24px;
}

.secondary-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--sov-teal);
}

.calculator-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.result-card {
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: var(--sov-teal);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 242, 226, 0.2);
}

.result-card.highlight {
    border-color: var(--sov-teal);
    background: linear-gradient(145deg, rgba(0, 242, 226, 0.1), var(--bg-dark));
}

.result-card h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sov-teal);
    margin: 0 0 8px 0;
    text-shadow: 0 0 10px rgba(0, 242, 226, 0.3);
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.calculator-notes {
    background: rgba(0, 242, 226, 0.05);
    border-left: 4px solid var(--sov-teal);
    padding: 24px;
    border-radius: 12px;
}

.calculator-notes h4 {
    color: var(--sov-teal);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.calculator-notes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calculator-notes li {
    padding: 10px 0;
    color: var(--text-primary);
    line-height: 1.7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calculator-notes li:last-child {
    border-bottom: none;
}

.calculator-notes strong {
    color: var(--sov-teal);
}

/* Leaderboard */
.top-stakers-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 20px;
}

.leaderboard-header h2 {
    color: var(--sov-teal);
    font-size: 2.2rem;
    margin: 0;
    font-weight: 700;
}

.leaderboard-period-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.leaderboard-period-btn {
    padding: 10px 22px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
}

.leaderboard-period-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--sov-teal);
}

.leaderboard-period-btn.active {
    background: var(--sov-teal);
    border-color: var(--sov-teal);
    color: var(--bg-dark);
}

.leaderboard-loading {
    text-align: center;
    padding: 30px;
}

.leaderboard-table {
    overflow-x: auto;
    transition: opacity 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    min-width: 600px;
}

.leaderboard-table thead tr {
    background: transparent;
}

.leaderboard-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.leaderboard-table td {
    padding: 18px 16px;
    color: var(--text-primary);
    background: var(--bg-dark);
}

.leaderboard-table tbody tr {
    transition: all 0.2s ease;
    border-radius: 8px;
}

.leaderboard-table tbody tr:hover {
    transform: scale(1.01);
}

.leaderboard-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.leaderboard-table tbody tr.top-three td {
    background: linear-gradient(90deg, rgba(0, 242, 226, 0.1), var(--bg-dark));
    border-left: 3px solid var(--sov-teal);
}

.leaderboard-table tbody tr td:first-child {
    border-radius: 8px 0 0 8px;
}

.leaderboard-table tbody tr td:last-child {
    border-radius: 0 8px 8px 0;
}

.rank-cell {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    width: 80px;
}

.wallet-cell code {
    background: rgba(0, 242, 226, 0.1);
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--sov-teal);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.voting-power-cell {
    font-weight: 600;
}

.share-cell {
    color: var(--text-secondary);
    font-weight: 600;
}

.earnings-cell {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sov-teal);
    text-align: right;
}

.leaderboard-footer {
    margin-top: 25px;
    padding: 24px;
    background: rgba(0, 242, 226, 0.05);
    border-left: 4px solid var(--sov-teal);
    border-radius: 12px;
}

.leaderboard-footer p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Current Stats */
.current-stats {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 35px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.current-stats h3 {
    color: var(--sov-teal);
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-item .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--sov-teal);
    text-shadow: 0 0 10px rgba(0, 242, 226, 0.3);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large tablets and small desktops */
@media (max-width: 968px) {
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .leaderboard-period-selector {
        width: 100%;
    }
    
    .leaderboard-period-btn {
        flex: 1;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .sovryn-staking-dashboard {
        padding: 15px;
    }
    
    .dashboard-header {
        margin-bottom: 30px;
    }
    
    .dashboard-header h2 {
        font-size: 2rem;
        letter-spacing: -0.3px;
    }
    
    .dashboard-header .subtitle {
        font-size: 0.95rem;
    }
    
    /* Period selector - full width buttons */
    .period-selector {
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .period-btn {
        flex: 1;
        min-width: calc(50% - 5px);
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Stats grid - single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .stat-card {
        padding: 20px;
        gap: 15px;
    }
    
    .stat-icon {
        font-size: 2.5rem;
        min-width: 60px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .stat-content h3 {
        font-size: 0.75rem;
    }
    
    /* Charts */
    .chart-card {
        padding: 25px 20px;
    }
    
    .chart-card h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    /* ROI Calculator */
    .roi-calculator {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .roi-calculator h2 {
        font-size: 1.8rem;
    }
    
    .calculator-desc {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .calculator-results {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .result-value {
        font-size: 1.6rem;
    }
    
    .calculator-notes {
        padding: 20px;
    }
    
    .calculator-notes h4 {
        font-size: 1rem;
    }
    
    .calculator-notes li {
        font-size: 0.9rem;
    }
    
    /* Leaderboard */
    .top-stakers-section {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .leaderboard-header h2 {
        font-size: 1.8rem;
    }
    
    .leaderboard-table th {
        padding: 12px 10px;
        font-size: 0.7rem;
    }
    
    .leaderboard-table td {
        padding: 14px 10px;
        font-size: 0.9rem;
    }
    
    .rank-cell {
        font-size: 1.2rem;
    }
    
    .wallet-cell code {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .earnings-cell {
        font-size: 1rem;
    }
    
    .leaderboard-footer {
        padding: 20px;
        font-size: 0.9rem;
    }
    
    /* Current Stats */
    .current-stats {
        padding: 25px 20px;
    }
    
    .current-stats h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .stats-row {
        gap: 20px;
    }
    
    .stat-item .stat-value {
        font-size: 1.3rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .sovryn-staking-dashboard {
        padding: 12px;
    }
    
    .dashboard-header {
        margin-bottom: 25px;
    }
    
    .dashboard-header h2 {
        font-size: 1.6rem;
    }
    
    .dashboard-header .subtitle {
        font-size: 0.85rem;
    }
    
    /* Period selector - 2 columns */
    .period-selector {
        gap: 8px;
        margin-bottom: 25px;
    }
    
    .period-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-height: 44px;
    }
    
    /* Stats cards */
    .stat-card {
        padding: 18px;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        font-size: 2.2rem;
        min-width: auto;
    }
    
    .stat-content {
        width: 100%;
    }
    
    .stat-content h3 {
        font-size: 0.7rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Charts */
    .chart-card {
        padding: 20px 15px;
    }
    
    .chart-card h3 {
        font-size: 1.1rem;
    }
    
    /* ROI Calculator */
    .roi-calculator {
        padding: 20px 15px;
    }
    
    .roi-calculator h2 {
        font-size: 1.5rem;
    }
    
    .calculator-desc {
        font-size: 0.9rem;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
    
    .input-group input {
        padding: 14px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .input-with-button {
        flex-direction: column;
        gap: 10px;
    }
    
    .secondary-btn {
        width: 100%;
        padding: 14px;
    }
    
    .primary-btn {
        width: 100%;
        padding: 14px;
    }
    
    .result-card {
        padding: 18px;
    }
    
    .result-card h4 {
        font-size: 0.7rem;
    }
    
    .result-value {
        font-size: 1.4rem;
    }
    
    .result-label {
        font-size: 0.7rem;
    }
    
    .calculator-notes {
        padding: 16px;
    }
    
    .calculator-notes h4 {
        font-size: 0.95rem;
    }
    
    .calculator-notes li {
        font-size: 0.85rem;
        padding: 8px 0;
    }
    
    /* Leaderboard */
    .top-stakers-section {
        padding: 20px 15px;
    }
    
    .leaderboard-header {
        margin-bottom: 25px;
    }
    
    .leaderboard-header h2 {
        font-size: 1.5rem;
        width: 100%;
    }
    
    .leaderboard-period-selector {
        gap: 8px;
    }
    
    .leaderboard-period-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        flex: 1;
        min-width: calc(50% - 4px);
    }
    
    /* Table scroll hint */
    .leaderboard-table {
        position: relative;
    }
    
    .leaderboard-table::after {
        content: '← Scroll →';
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(0, 242, 226, 0.9);
        color: var(--bg-dark);
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.7rem;
        font-weight: 700;
        pointer-events: none;
        animation: fadeInOut 2s ease-in-out infinite;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0.7; }
        50% { opacity: 1; }
    }
    
    .leaderboard-table table {
        min-width: 550px;
    }
    
    .leaderboard-table th {
        padding: 10px 8px;
        font-size: 0.65rem;
    }
    
    .leaderboard-table td {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .rank-cell {
        font-size: 1.1rem;
        width: 60px;
    }
    
    .wallet-cell code {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .voting-power-cell {
        font-size: 0.8rem;
    }
    
    .share-cell {
        font-size: 0.8rem;
    }
    
    .earnings-cell {
        font-size: 0.95rem;
    }
    
    .leaderboard-footer {
        padding: 16px;
        font-size: 0.85rem;
    }
    
    /* Current Stats */
    .current-stats {
        padding: 20px 15px;
    }
    
    .current-stats h3 {
        font-size: 1.1rem;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-item .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-item .stat-value {
        font-size: 1.2rem;
    }
    
    /* Loading spinner */
    .loading-indicator {
        padding: 40px 20px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .dashboard-header h2 {
        font-size: 1.4rem;
    }
    
    .period-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .roi-calculator h2 {
        font-size: 1.3rem;
    }
    
    .leaderboard-header h2 {
        font-size: 1.3rem;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
}