/* ==========================================================================
   Stats Page Styles
   ========================================================================== */

/* ==========================================================================
   Stats Hero Section
   ========================================================================== */
.stats-hero {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.stats-hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-green) 0%, #10B981 100%);
}

[data-theme="dark"] .stats-hero {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.stats-hero__title {
    font-size: 2.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stats-hero__subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 400;
}


/* ==========================================================================
   Charts Grid
   ========================================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Chart Card
   ========================================================================== */
.chart-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-green);
    transition: all 0.25s ease;
}

.chart-card:hover {
    background: var(--secondary-bg);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
    border-left-color: #10B981;
    border-color: var(--accent-green);
}

.chart-card__title {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}


/* ==========================================================================
   Summary Card (Green gradient)
   ========================================================================== */
.summary-card {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 103, 71, 0.2);
    color: white;
}

.summary-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-grid {
    display: grid;
    gap: 1rem;
}

.summary-item {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.summary-item__label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.summary-item__value {
    font-size: 2rem;
    font-weight: 800;
}

.summary-item__value--muted {
    color: #9ca3af;
}

.summary-item__note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

/* ==========================================================================
   CTA Box (for anonymous users)
   ========================================================================== */
.cta-box {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
}

.cta-box__title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.cta-box__description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cta-box__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

[data-theme="dark"] .cta-box {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
}

/* ==========================================================================
   Community Section Header
   ========================================================================== */
.community-header {
    text-align: center;
    margin-bottom: 3rem;
}

.community-header__title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.community-header__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ==========================================================================
   Round Card (for legacy stats)
   ========================================================================== */
.round-card {
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    background: var(--card-bg, linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%));
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-green);
    transition: all 0.25s ease;
    margin-bottom: 1rem;
}

.round-card:last-child {
    margin-bottom: 0;
}

.round-card:hover {
    background: var(--card-bg, #FFFFFF);
    border-left-color: #10B981;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
    transform: translateX(4px);
}

.round-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.round-card__title {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.round-card__date {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.round-card__score {
    font-size: 3rem;
    color: var(--accent-green);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

[data-theme="dark"] .round-card {
    background: var(--card-bg);
}

[data-theme="dark"] .round-card:hover {
    background: var(--secondary-bg);
}

/* ==========================================================================
   Stats Grid (within round cards)
   ========================================================================== */
.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-box {
    background: var(--card-bg, white);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-green);
    transition: all 0.2s ease;
}

.stat-box:hover {
    border-left-color: #10B981;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

.stat-box__label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-box__value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: -0.02em;
}

.stat-box__percentage {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-green);
    margin-top: 0.25rem;
}

[data-theme="dark"] .stat-box {
    background: var(--card-bg);
}

/* ==========================================================================
   Short Game Stats Display
   ========================================================================== */
.short-game-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.short-game-stat {
    text-align: center;
}

.short-game-stat__label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.short-game-stat__value {
    font-size: 2.5rem;
    font-weight: 700;
}

.short-game-stat__value--purple {
    color: #8b5cf6;
}

.short-game-stat__value--green {
    color: #059669;
}

.short-game-stat__detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Hole Performance (Best/Worst)
   ========================================================================== */
.hole-performance {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.hole-performance__section-title {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hole-performance__section-title--best {
    color: #059669;
}

.hole-performance__section-title--worst {
    color: #ef4444;
}

.hole-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.hole-item--best {
    background: #f0fdf4;
}

.hole-item--worst {
    background: #fef2f2;
}

.hole-item__name {
    font-weight: 600;
    color: var(--text-primary);
}

.hole-item__avg--best {
    color: #059669;
    font-weight: 600;
}

.hole-item__avg--worst {
    color: #ef4444;
    font-weight: 600;
}

[data-theme="dark"] .hole-item--best,
[data-theme="dark"] .hole-item--worst {
    background: var(--secondary-bg);
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal__content {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 28rem;
    width: 100%;
    padding: 2rem;
}

.modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal__text {
    color: #666;
    margin-bottom: 1.5rem;
}

.modal__actions {
    display: flex;
    gap: 1rem;
}

[data-theme="dark"] .modal__content {
    background: var(--card-bg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent-green) 0%, #10B981 100%);
    color: white;
    border: 2px solid var(--accent-green);
}

.btn--primary:hover {
    background: linear-gradient(135deg, #047857 0%, var(--accent-green) 100%);
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn--delete {
    background: white;
    color: #DC2626;
    border: 2px solid #DC2626;
}

.btn--delete:hover {
    background: #DC2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn--cancel {
    flex: 1;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    color: #666;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn--cancel:hover {
    background: #e0e0e0;
}

[data-theme="dark"] .btn--cancel {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn--delete {
    background: var(--secondary-bg);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    /* Page container - tighter padding */
    .max-w-7xl.px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.5rem !important;
    }

    /* Hero - compact */
    .stats-hero {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .stats-hero__title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .stats-hero__subtitle {
        font-size: 0.85rem;
    }

    /* CTA Box - compact */
    .cta-box {
        padding: 1.25rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 8px;
    }

    .cta-box__title {
        font-size: 1.2rem;
        margin-bottom: 0.35rem;
    }

    .cta-box__description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .cta-box__buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cta-box__buttons .action-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    /* Community header - compact */
    .community-header {
        margin-bottom: 1.5rem;
    }

    .community-header__title {
        font-size: 1.35rem;
        margin-bottom: 0.25rem;
    }

    .community-header__subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    /* Charts grid - compact */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Chart card - compact */
    .chart-card {
        padding: 1rem;
        border-radius: 8px;
        border-left-width: 3px;
    }

    .chart-card:hover {
        transform: none;
    }

    .chart-card__title {
        font-size: 1rem;
        margin-bottom: 1rem;
        gap: 0.4rem;
    }

    .chart-card__title i {
        font-size: 0.9rem;
    }

    /* Summary card - compact */
    .summary-card {
        padding: 1.25rem 1rem;
        border-radius: 8px;
    }

    .summary-card__title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        gap: 0.4rem;
    }

    .summary-grid {
        gap: 0.5rem;
    }

    .summary-item {
        padding: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .summary-item__label {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .summary-item__value {
        font-size: 1.5rem;
    }

    .summary-item__note {
        display: none;
    }

    /* Short game stats - horizontal compact */
    .short-game-stats {
        flex-direction: row;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .short-game-stat {
        flex: 1;
    }

    .short-game-stat__label {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }

    .short-game-stat__value {
        font-size: 1.75rem;
    }

    .short-game-stat__detail {
        font-size: 0.7rem;
    }

    /* Hole performance - compact side by side */
    .hole-performance {
        flex-direction: row;
        gap: 1rem;
        padding: 0.25rem 0;
    }

    .hole-performance > div {
        flex: 1;
    }

    .hole-performance__section-title {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .hole-item {
        padding: 0.35rem 0.5rem;
        margin-bottom: 0.35rem;
        font-size: 0.85rem;
    }

    /* Section headers - compact */
    .section {
        margin-bottom: 1rem;
    }

    .section-header {
        margin-bottom: 1rem;
    }

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

    /* Round cards - horizontal compact */
    .round-card {
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        border-left-width: 3px;
    }

    .round-card:hover {
        transform: none;
    }

    .round-card__header {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .round-card__title {
        font-size: 1rem;
        margin-bottom: 0.15rem;
    }

    .round-card__date {
        font-size: 0.8rem;
    }

    .round-card__score {
        font-size: 2rem;
    }

    /* Mini stats grid - 2x2 compact */
    .mini-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-box {
        padding: 0.65rem 0.5rem;
        border-left-width: 2px;
    }

    .stat-box:hover {
        box-shadow: none;
    }

    .stat-box__label {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
    }

    .stat-box__value {
        font-size: 1.1rem;
    }

    .stat-box__percentage {
        font-size: 0.8rem;
        margin-top: 0.15rem;
    }

    /* Toggle button - compact */
    #moreStatsToggle {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    /* Modal - compact */
    .modal__content {
        padding: 1.5rem;
    }

    .modal__title {
        font-size: 1.25rem;
    }

    .modal__actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn--cancel,
    .btn--delete {
        width: 100%;
        justify-content: center;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .stats-hero__title {
        font-size: 1.35rem;
    }

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

    .short-game-stat__value {
        font-size: 1.5rem;
    }

    .hole-performance {
        flex-direction: column;
        gap: 0.75rem;
    }

    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .summary-item__label {
        margin-bottom: 0;
    }
}
