/* ============================================================
   WorldWardle — Page-specific styles

   Admin pages: use Bootswatch Flatly defaults (light theme)
   User pages:  use design-system.css tokens (dark ww-theme)

   This file contains page-specific overrides only.
   The design system (design-system.css) handles all base styles.
   ============================================================ */


/* ============================================================
   ADMIN PAGES (Flatly light theme — unchanged)
   These rules apply only when body does NOT have .ww-theme
   ============================================================ */

body:not(.ww-theme) {
    background-color: #f8f9fa;
}


/* ============================================================
   SHARED / LEGACY COMPONENT STYLES

   Used across both admin and user-facing pages.
   These will gradually be replaced by ww-* equivalents.
   ============================================================ */

/* Cards (admin) */
body:not(.ww-theme) .card {
    border-radius: 0.75rem;
}
body:not(.ww-theme) .card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Countdown displays */
.countdown-display {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body:not(.ww-theme) .countdown-display {
    color: #2c3e50;
}

body.ww-theme .countdown-display {
    color: var(--text-strong);
}

/* Post count per wordle */
.post-count {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

body:not(.ww-theme) .post-count {
    color: #18bc9c;
}

body.ww-theme .post-count {
    color: var(--accent-teal);
}

.wordle-label {
    font-size: 0.9rem;
}

body:not(.ww-theme) .wordle-label {
    color: #95a5a6;
}

body.ww-theme .wordle-label {
    color: var(--text-soft);
}

/* Wordle timer */
.wordle-timer {
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

body:not(.ww-theme) .wordle-timer {
    color: #95a5a6;
}

body.ww-theme .wordle-timer {
    color: var(--text-soft);
}

.wordle-timer .timer-value {
    font-size: 1.1rem;
    font-weight: 700;
}

body:not(.ww-theme) .wordle-timer .timer-value {
    color: #2c3e50;
}

body.ww-theme .wordle-timer .timer-value {
    color: var(--text-strong);
}

/* Battle countdown */
.battle-countdown {
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

body:not(.ww-theme) .battle-countdown {
    color: #95a5a6;
}

body.ww-theme .battle-countdown {
    color: var(--text-soft);
}

/* Gather status card layout */
.gather-countdown-col {
    min-width: 160px;
}

body:not(.ww-theme) .gather-countdown-col {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

body.ww-theme .gather-countdown-col {
    border-right: 1px solid var(--border-subtle);
}

.gather-wordle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.gather-wordle-row + .gather-wordle-row {
    border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.05));
}

.gather-wordle-num {
    font-weight: 700;
    min-width: 60px;
}

body:not(.ww-theme) .gather-wordle-num {
    color: #2c3e50;
}

body.ww-theme .gather-wordle-num {
    color: var(--text-strong);
}

.gather-stat {
    font-weight: 600;
}

body:not(.ww-theme) .gather-stat {
    color: #18bc9c;
}

body.ww-theme .gather-stat {
    color: var(--accent-teal);
}

.gather-stat-muted {
    color: var(--text-soft, #95a5a6);
}


/* ============================================================
   MEDAL RANKS (both themes)
   ============================================================ */

body:not(.ww-theme) .rank-1 {
    background: linear-gradient(135deg, #f1c40f22, #f1c40f11) !important;
    border-left: 4px solid #f1c40f !important;
}

body:not(.ww-theme) .rank-2 {
    background: linear-gradient(135deg, #95a5a622, #95a5a611) !important;
    border-left: 4px solid #95a5a6 !important;
}

body:not(.ww-theme) .rank-3 {
    background: linear-gradient(135deg, #e67e2222, #e67e2211) !important;
    border-left: 4px solid #e67e22 !important;
}

body.ww-theme .rank-1 {
    background: var(--medal-gold-muted) !important;
    border-left: 3px solid var(--medal-gold) !important;
}

body.ww-theme .rank-2 {
    background: var(--medal-silver-muted) !important;
    border-left: 3px solid var(--medal-silver) !important;
}

body.ww-theme .rank-3 {
    background: var(--medal-bronze-muted) !important;
    border-left: 3px solid var(--medal-bronze) !important;
}


/* ============================================================
   PLAYER ROWS & AVATARS
   ============================================================ */

.player-row {
    transition: background-color 0.15s;
}

body:not(.ww-theme) .player-row:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

body.ww-theme .player-row:hover {
    background-color: var(--bg-700);
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    vertical-align: middle;
    object-fit: cover;
}

body.ww-theme .avatar-sm {
    border: 1px solid var(--border-default);
}


/* ============================================================
   STATUS PAGE
   ============================================================ */

.status-card {
    margin-bottom: 1rem;
}

.wordle-number {
    font-size: 2rem;
    font-weight: 700;
}

body:not(.ww-theme) .wordle-number {
    color: #2c3e50;
}

body.ww-theme .wordle-number {
    color: var(--text-strong);
}

.timeline-item {
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

body:not(.ww-theme) .timeline-item {
    border-left: 3px solid #18bc9c;
}

body.ww-theme .timeline-item {
    border-left: 3px solid var(--accent-teal);
}


/* ============================================================
   WORKFLOW CARDS (admin only)
   ============================================================ */

.workflow-card {
    transition: transform 0.2s;
    margin-bottom: 1rem;
}

.workflow-card:hover {
    transform: translateY(-2px);
}


/* ============================================================
   LEADERBOARD
   ============================================================ */

.leaderboard-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.ww-theme .leaderboard-card {
    box-shadow: var(--shadow-md);
}


/* ============================================================
   DATA VIEWER
   ============================================================ */

.clickable-row {
    cursor: pointer;
}

body:not(.ww-theme) .clickable-row:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

body.ww-theme .clickable-row:hover {
    background-color: var(--bg-700);
}


/* ============================================================
   NAV (admin — light theme default)
   ============================================================ */

body:not(.ww-theme) .navbar .nav-link.active {
    font-weight: 600;
    border-bottom: 2px solid white;
}


/* ============================================================
   TABLES
   ============================================================ */

.table {
    font-size: 0.9rem;
}

body:not(.ww-theme) .table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #95a5a6;
    border-bottom-width: 1px;
}

body.ww-theme .table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border-default);
}


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

@media (max-width: 576px) {
    .post-count {
        font-size: 1.8rem;
    }
    .countdown-display {
        font-size: 1.3rem;
    }
    .wordle-number {
        font-size: 1.5rem;
    }
    .battle-countdown {
        font-size: 0.7rem;
    }
    .wordle-timer {
        font-size: 0.75rem;
    }
    .wordle-timer .timer-value {
        font-size: 0.95rem;
    }
    .gather-countdown-col {
        min-width: 120px;
    }
    .gather-wordle-row {
        font-size: 0.8rem;
    }
    .table th, .table td {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.35rem 0.25rem;
    }
    .avatar-sm {
        width: 22px;
        height: 22px;
    }
    .navbar-brand {
        font-size: 1rem;
    }
    .card-body {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .post-count {
        font-size: 2rem;
    }
    .countdown-display {
        font-size: 1.5rem;
    }
}
