/* ========================================
   Wallet Stats Dashboard Styles
   Beautiful, responsive statistics dashboard
   ======================================== */

/* ========== Sticky Wallet Navbar ========== */
.wallet-sticky-navbar {
    position: fixed;
    top: 60px;
    /* Below main navbar */
    left: 0;
    right: 0;
    z-index: 900;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.98) 0%, rgba(20, 20, 35, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.wallet-sticky-navbar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    top: 80px;
}

.sticky-navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.sticky-balance-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sticky-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sticky-balance {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.sticky-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.sticky-stat {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sticky-stat.positive {
    color: #4ade80;
}

.sticky-stat.negative {
    color: #f87171;
}

/* Hero compression animation */
.balance-hero {
    --compress-progress: 0;
    transition: transform 0.1s ease-out,
        opacity 0.1s ease-out,
        padding 0.1s ease-out;
}

.balance-hero.hero-compressing {
    transform: scale(calc(1 - var(--compress-progress) * 0.05));
    opacity: calc(1 - var(--compress-progress) * 0.3);
}

.balance-hero.hero-compressed {
    transform: scale(0.95);
    opacity: 0.7;
}

/* Responsive sticky navbar */
@media (max-width: 768px) {
    .wallet-sticky-navbar {
        top: 56px;
        /* Adjust for mobile navbar */
    }

    .sticky-navbar-content {
        padding: 10px 16px;
        flex-wrap: nowrap;
        gap: 8px;
        display: flex;
        flex-direction: row;
    }

    .sticky-balance-info {
        flex: 1;
        min-width: 150px;
    }

    .sticky-balance {
        font-size: 1.2rem;
    }

    .sticky-stats {
        gap: 8px;
    }

    .sticky-stat {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .sticky-navbar-content {
        justify-content: center;
    }

    .sticky-balance-info {
        flex: none;
        text-align: center;
    }

    .sticky-label {
        display: none;
    }

    .sticky-stats {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Elegant Page Header ========== */
.wallet-page-header {
    margin-bottom: 40px;
    padding: 0;
}

.wallet-page-header .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.wallet-page-header .header-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet-page-header .header-text {
    text-align: center;
}

.wallet-page-header .header-text h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.wallet-page-header .header-subtitle {
    margin: 4px 0 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========== Scroll To Top Button ========== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(30, 30, 45, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.scroll-to-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    background: radial-gradient(ellipse at 30% 0%, rgba(102, 126, 234, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.scroll-to-top svg {
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: rgba(40, 40, 60, 0.9);
    border-color: rgba(102, 126, 234, 0.3);
    color: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.scroll-to-top:hover svg {
    transform: translateY(-2px);
}

.scroll-to-top:active {
    transform: scale(0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .wallet-page-header .header-icon {
        width: 52px;
        height: 52px;
        font-size: 2rem;
    }

    .wallet-page-header .header-text h1 {
        font-size: 1.6rem;
    }
}

/* ========== Dashboard Container ========== */
.wallet-stats-dashboard {
    margin-bottom: 40px;
}

/* ========== Balance Hero Section ========== */
.balance-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.95) 0%, rgba(20, 20, 35, 0.98) 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 0%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.balance-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.hero-left {
    flex: 1;
}

.hero-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.hero-balance {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
}

.balance-amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -1px;
}

.balance-currency {
    font-size: 2.5rem;
}

.hero-retention {
    max-width: 280px;
}

.hero-retention .retention-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.hero-retention .retention-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 6px;
    transition: width 1.5s ease-out;
}

.retention-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.hero-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}

.hero-stat-wt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 180px;
    position: relative;
}

.hero-stat-icon {
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.hero-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.hero-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.hero-stat-value.positive {
    color: #4ade80;
}

.hero-stat-value.negative {
    color: #f87171;
}

.hero-stat-value.accent {
    color: #fbbf24;
}

.hero-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hero-stat-extra {
    position: absolute;
    bottom: 8px;
    right: 12px;
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
}

.hero-stat-extra .tx-in {
    color: #4ade80;
}

.hero-stat-extra .tx-out {
    color: #f87171;
}

/* Hero Responsive */
@media (max-width: 768px) {
    .balance-hero {
        padding: 30px 24px;
    }

    .balance-hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }

    .balance-amount {
        font-size: 2.5rem;
    }

    .balance-currency {
        font-size: 1.8rem;
    }

    .hero-right {
        width: 100%;
    }

    .hero-stats-grid {
        gap: 10px;
        width: 100%;
    }

    .hero-stat-wy {
        min-width: auto;
        padding: 12px;
    }

    .hero-stat-extra {
        position: static;
        margin-top: 4px;
    }

    .wallet-container {
        /*non deve sovrapporsi con l'header*/
        padding-top: 100px;
    }
}

/* ========== Quick Stats Grid ========== */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.quick-stat-card {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quick-stat-card .earn-icon-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.quick-stat-card .earn-icon {
    font-size: 36px;
}

.quick-stat-card h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary, #ffffff);
}

.quick-stat-card p {
    font-size: 0.9rem;
    color: var(--text-secondary, #b4bcd0);
    line-height: 1.5;
    margin: 0;
}

.quick-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.quick-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.quick-stat-card.earned::before {
    background: linear-gradient(90deg, #28a745, #69f0ae);
}

.quick-stat-card.spent::before {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.quick-stat-card.transactions::before {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.quick-stat-card.average::before {
    background: linear-gradient(90deg, #ffc107, #ffed4e);
}

.stat-icon-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.stat-icon-container .stat-icon {
    font-size: 32px;
    position: relative;
    z-index: 1;
}

.stat-icon-container .stat-icon-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: var(--surface-elevated, rgba(255, 255, 255, 0.06));
    border-radius: 50%;
}

.stat-content .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary, #b4bcd0);
    margin-bottom: 5px;
}

.stat-content .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}

.stat-trend {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-trend.positive {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.stat-trend.negative {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.stat-mini-chart {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 80px;
    height: 30px;
}

.sparkline-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100%;
}

.sparkline-bar {
    flex: 1;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 2px;
    min-height: 5%;
    transition: height 0.5s ease;
}

/* Transaction Breakdown */
.tx-breakdown {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tx-in {
    color: #28a745;
}

.tx-out {
    color: #dc3545;
}


/* ========== Analytics Section ========== */
.stats-analytics-section {
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary, #ffffff);
}

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

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.analytics-card {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.analytics-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.analytics-card h4 {
    font-size: 1rem;
    color: var(--text-secondary, #b4bcd0);
    margin-bottom: 20px;
}

/* Comparison Chart */
.comparison-bar-container {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.comparison-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1.5s ease-out;
}

.comparison-bar.earned {
    background: linear-gradient(90deg, #28a745, #69f0ae);
}

.comparison-bar.spent {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.comparison-bar .bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.comparison-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #b4bcd0);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.earned {
    background: #28a745;
}

.legend-dot.spent {
    background: #dc3545;
}

/* Distribution Chart */
.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dist-icon {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}

.dist-label {
    width: 100px;
    font-size: 0.85rem;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dist-bar-container {
    flex: 1;
    height: 8px;
    background: var(--surface-elevated, rgba(255, 255, 255, 0.06));
    border-radius: 4px;
    overflow: hidden;
}

.dist-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 1s ease-out;
}

.dist-count {
    width: 30px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

/* Trend Indicator */
.trend-indicator {
    text-align: center;
}

.trend-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.trend-icon-large {
    font-size: 48px;
}

.trend-info .trend-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.trend-indicator.positive .trend-value {
    color: #28a745;
}

.trend-indicator.negative .trend-value {
    color: #dc3545;
}

.trend-indicator.neutral .trend-value {
    color: var(--text-secondary, #b4bcd0);
}

.trend-info .trend-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary, #b4bcd0);
}

.trend-period {
    font-size: 0.8rem;
    color: var(--text-muted, #7a8499);
}

/* Activity Heatmap */
.heatmap-container {
    overflow-x: auto;
}

.heatmap-header {
    display: flex;
    padding-left: 80px;
    margin-bottom: 8px;
}

.heatmap-header .day-label {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted, #7a8499);
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heatmap-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.heatmap-row .heatmap-label {
    width: 75px;
    font-size: 0.75rem;
    color: var(--text-muted, #7a8499);
    text-align: right;
    padding-right: 10px;
}

.heatmap-cell {
    flex: 1;
    height: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.heatmap-cell:hover {
    transform: scale(1.1);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 0.75rem;
    color: var(--text-muted, #7a8499);
}

.legend-gradient {
    width: 100px;
    height: 8px;
    background: linear-gradient(90deg,
            rgba(102, 126, 234, 0.2),
            rgba(102, 126, 234, 1));
    border-radius: 4px;
}

/* ========== Type Breakdown Section ========== */
.type-breakdown-section {
    margin-bottom: 30px;
}

.type-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.type-card {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.type-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.type-header .type-icon {
    font-size: 24px;
}

.type-header .type-name {
    font-size: 0.9rem;
    color: var(--text-primary, #ffffff);
    font-weight: 500;
}

.type-stats .type-total {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.type-stats .type-total.gain {
    color: #28a745;
}

.type-stats .type-total.loss {
    color: #dc3545;
}

.type-stats .type-count {
    font-size: 0.8rem;
    color: var(--text-muted, #7a8499);
}

/* ========== Milestones Section ========== */
.milestones-section {
    margin-bottom: 30px;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.milestone-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.milestone-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.milestone-card.achieved {
    border-color: rgba(40, 167, 69, 0.3);
    background: rgba(40, 167, 69, 0.1);
}

.milestone-card.locked {
    opacity: 0.7;
}

.milestone-card.locked.visible {
    opacity: 0.7;
}

.milestone-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.milestone-info {
    flex: 1;
}

.milestone-info .milestone-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 3px;
}

.milestone-info .milestone-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary, #b4bcd0);
}

.milestone-check {
    width: 30px;
    height: 30px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.milestone-progress {
    width: 60px;
    height: 6px;
    background: var(--surface-elevated, rgba(255, 255, 255, 0.06));
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.milestone-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* ========== Infinite Scroll Styles ========== */
.transaction-scroll-container {
    max-height: none;
    /* Allow natural flow */
}

.infinite-scroll-loader {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.loader-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary, #b4bcd0);
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-elevated, rgba(255, 255, 255, 0.06));
    border-top-color: var(--primary-color, #00d9ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.infinite-scroll-end {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.end-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted, #7a8499);
    font-size: 0.9rem;
}

.end-message .end-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border-radius: 50%;
    font-size: 0.75rem;
}

.infinite-scroll-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 12px;
    margin-top: 15px;
    color: #dc3545;
}

.infinite-scroll-error .retry-btn {
    background: rgba(220, 53, 69, 0.2);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: #dc3545;
    cursor: pointer;
    transition: background 0.2s;
}

.infinite-scroll-error .retry-btn:hover {
    background: rgba(220, 53, 69, 0.3);
}

/* Fade in animation for items */
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.earn-methods-wt {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
}

.earn-method-wt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State */
.no-transactions {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #b4bcd0);
}

.no-transactions .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-transactions h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary, #ffffff);
}

.no-transactions p {
    font-size: 0.95rem;
}

.no-data {
    text-align: center;
    color: var(--text-muted, #7a8499);
    padding: 20px;
    font-style: italic;
}

/* ========== Responsive Design ========== */
@media (max-width: 1200px) {
    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .balance-hero {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .balance-icon-pulse .icon-main {
        font-size: 48px;
    }

    .balance-value-container .balance-value {
        font-size: 2.5rem;
    }

    .balance-value-container .balance-unit {
        font-size: 1rem;
    }

    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-stat-card {
        padding: 16px 12px;
        text-align: center;
    }

    .quick-stat-card .earn-icon-title {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .quick-stat-card .earn-icon {
        font-size: 28px;
        margin: 0;
    }

    .quick-stat-card h3 {
        font-size: 0.9rem;
        margin: 0;
    }

    .quick-stat-card p {
        font-size: 0.75rem;
        line-height: 1.3;
        margin: 0;
    }

    .stat-content .stat-value {
        font-size: 1.5rem;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .type-cards-grid {
        grid-template-columns: 1fr;
    }

    .milestones-grid {
        grid-template-columns: 1fr;
    }

    .heatmap-header .day-label {
        font-size: 0.6rem;
    }

    .heatmap-row .heatmap-label {
        width: 50px;
        font-size: 0.65rem;
    }

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




}

@media (max-width: 480px) {
    .balance-hero {
        padding: 25px 15px;
    }

    .balance-value-container .balance-value {
        font-size: 2rem;
    }



    .heatmap-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-bar .bar-label {
        font-size: 0.75rem;
    }
}

/* ========== Dark Mode Enhancements ========== */
@media (prefers-color-scheme: dark) {

    .quick-stat-card,
    .analytics-card,
    .type-card,
    .milestone-card {
        background: rgba(255, 255, 255, 0.03);
    }
}

/* ========== Detailed Highlights Section ========== */
.detailed-highlights-section {
    margin-bottom: 30px;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.highlight-card {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.highlight-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.highlight-card.best-day {
    border-left: 4px solid #ffc107;
}

.highlight-card.current-streak {
    border-left: 4px solid #28a745;
}

.highlight-card.current-streak.on-fire {
    border-left: 4px solid #ff6b35;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), transparent);
}

.highlight-card.longest-streak {
    border-left: 4px solid #667eea;
}

.highlight-icon {
    font-size: 40px;
    min-width: 50px;
    text-align: center;
}

.highlight-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.highlight-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #b4bcd0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.highlight-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}

.highlight-detail {
    font-size: 0.8rem;
    color: var(--text-secondary, #b4bcd0);
}

/* ========== Coin Flow Timeline ========== */
.coin-flow-section {
    margin-bottom: 30px;
}

.flow-timeline {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.flow-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    height: 150px;
    margin-bottom: 16px;
    padding: 10px 0;
}

.flow-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.flow-bars {
    flex: 1;
    display: flex;
    gap: 2px;
    align-items: flex-end;
    width: 100%;
}

.flow-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.flow-bar.earned {
    background: linear-gradient(180deg, #28a745, #20c997);
}

.flow-bar.spent {
    background: linear-gradient(180deg, #dc3545, #ff6b6b);
}

.flow-label {
    font-size: 0.7rem;
    color: var(--text-secondary, #b4bcd0);
    text-transform: uppercase;
}

.flow-net {
    font-size: 0.75rem;
    font-weight: 600;
}

.flow-net.positive {
    color: #28a745;
}

.flow-net.negative {
    color: #dc3545;
}

.flow-net.neutral {
    color: var(--text-secondary, #b4bcd0);
}

.flow-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.flow-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary, #b4bcd0);
}

.flow-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.flow-legend .legend-dot.earned {
    background: linear-gradient(180deg, #28a745, #20c997);
}

.flow-legend .legend-dot.spent {
    background: linear-gradient(180deg, #dc3545, #ff6b6b);
}

/* ========== Peak Hours Section ========== */
.peak-hours-section {
    margin-bottom: 30px;
}

.peak-hours-chart {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.peak-hour-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.05));
}

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

.peak-rank {
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
}

.peak-time {
    min-width: 120px;
    font-size: 0.9rem;
    color: var(--text-primary, #ffffff);
    font-weight: 500;
}

.peak-bar-container {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.peak-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.8s ease;
}

.peak-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 80px;
}

.peak-total {
    font-size: 0.95rem;
    font-weight: 700;
    color: #28a745;
}

.peak-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #b4bcd0);
}

/* ========== Game Performance Section ========== */
.game-performance-section {
    margin-bottom: 30px;
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.game-stat-card {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.game-stat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.game-stat-card.top-game {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    border-color: rgba(102, 126, 234, 0.3);
}

.game-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.game-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary, #b4bcd0);
}

.game-stat-card.top-game .game-rank {
    font-size: 1.3rem;
}

.game-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-earnings {
    margin-bottom: 8px;
}

.game-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #28a745;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary, #b4bcd0);
    margin-bottom: 12px;
}

.game-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.game-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* ========== Responsive for New Sections ========== */
@media (max-width: 900px) {
    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .game-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .flow-chart {
        height: 120px;
        gap: 4px;
    }

    .flow-label {
        font-size: 0.6rem;
    }

    .flow-net {
        font-size: 0.65rem;
    }

    .peak-time {
        min-width: 90px;
        font-size: 0.8rem;
    }

    .peak-stats {
        min-width: 60px;
    }

    .peak-total {
        font-size: 0.85rem;
    }

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

    .highlight-icon {
        font-size: 32px;
        min-width: 40px;
    }

    .highlight-value {
        font-size: 1.2rem;
    }
}

/* ========== Print Styles ========== */
@media print {
    .balance-hero {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .floating-coins,
    .pulse-ring {
        display: none;
    }

    .infinite-scroll-loader,
    .infinite-scroll-end {
        display: none;
    }
}