/* ==========================================================================
   EINSTEIN COMPETITION — ADMIN PANEL STYLESHEET
   ==========================================================================
   Single stylesheet for the entire admin panel. Loaded via fragments.html.

   TABLE OF CONTENTS
   ------------------
   1.  CSS Variables
   2.  Reset & Base
   3.  Animations
   4.  Scrollbars
   5.  Layout — Desktop & Mobile Responsive
   6.  Header                 (fragments.html)
   7.  Sidebar                (fragments.html)
   8.  Mobile Menu            (fragments.html)
   9.  Toast Notifications    (fragments.html)
   10. Warning Box            (fragments.html)
   11. Footer                 (fragments.html + rtzlogin.html)
   12. Cards                  (all pages except rtzlogin)
   13. Tables                 (all pages except rtzlogin)
   14. Badges                 (matches, players, dashboard, submissions, adfree)
   15. Metrics                (dashboard, players, adfree)
   16. Buttons — Shared       (multiple pages)
   17. Button Loading States  (multiple pages)
   18. Login Page             (rtzlogin.html)
   19. Dashboard              (dashboard.html)
   20. Players Page           (players.html)
   21. Matches Page           (matches.html)
   22. Submissions Page       (submissions.html)
   23. Ad-Free Page           (adfree.html)
   ========================================================================== */


/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */

:root {
    /* Brand palette */
    --primary-green: #38ef7d;
    --primary-teal: #11998e;
    --secondary-green: #4ad27e;
    --dark-green: #22c55e;

    /* Neutrals */
    --bg-light: #f5f5f5;
    --bg-white-trans: rgba(255, 255, 255, 0.9);
    --text-dark: #333333;
    --text-muted: #888888;
    --border-light: rgba(255, 255, 255, 0.2);

    /* Gradients & shadows */
    --main-gradient: linear-gradient(90deg, var(--primary-green) 10%, var(--primary-teal) 90%);
    --shadow-green: rgba(34, 197, 94, 0.18);

    /* Layout constants */
    --sidebar-width: 240px;
    --header-height: 78px;
    --border-radius: 20px;
    --btn-radius: 30px;
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg, #e8e8e8, #f0f0f0);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Remove underlines from all links globally */
a, a:hover, a:focus, a:active, a:visited {
    text-decoration: none !important;
    outline: none;
}

/* Used in rtzlogin.html (login page) and sidebar logo */
.logotext-img {
    border-radius: var(--border-radius);
    display: block;
    width: 320px;
    height: auto;
    margin: 0 auto;
    animation: logoFloat 3s ease-in-out infinite;
}

/* Muted/italic text helper — used in dashboard.html, matches.html */
.text-muted {
    color: #aaa !important;
    font-style: italic;
}


/* ==========================================================================
   3. ANIMATIONS
   ========================================================================== */

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-10px); }
}

/* Page entrance animation — applied to .container */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Pulsing blink for live status badges — used in dashboard.html */
@keyframes blink {
    50% { opacity: 0.5; }
}

/* Toast slide-in from bottom */
@keyframes toast-smooth-in {
    0%   { opacity: 0; transform: translateY(100px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}


/* ==========================================================================
   4. SCROLLBARS
   ========================================================================== */

/* Generic custom scrollbar (attach .custom-scrollbar to any element) */
.custom-scrollbar::-webkit-scrollbar       { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track  { background: #f0f0f0; }
.custom-scrollbar::-webkit-scrollbar-thumb  { background: var(--primary-teal); border-radius: 4px; }

/* Sidebar nav-links scrollbar */
.nav-links::-webkit-scrollbar       { width: 8px; }
.nav-links::-webkit-scrollbar-thumb  { background: var(--primary-teal); border-radius: 4px; }


/* ==========================================================================
   5. LAYOUT — DESKTOP & MOBILE RESPONSIVE
   ========================================================================== */

/* --- Main content container (all pages except login) --- */
.container {
    width: 100%;
    margin: 0 auto;
    display: block;
    animation: slideUp 0.8s ease-out;
    padding-left: 20px;
    padding-right: 20px;
}

/* --- Desktop default (>768px) --- */

.desktop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    height: 100vh;
    z-index: 1300;
    overflow: hidden;
}

.desktop-header {
    position: fixed;
    top: 0;
    left: 340px;
    width: calc(100% - 340px);
    height: 85px;
    z-index: 5000;
    background: transparent;
}

/* Hide mobile menu on desktop */
.mobile-nav-tabs-wrapper {
    display: none;
}

/* Push page content past the sidebar */
body:not(.login-body) .container {
    margin-left: 340px !important;
    width: calc(100% - 340px) !important;
    padding-top: 105px !important;
    box-sizing: border-box;
}

/* --- Mobile (<= 768px) --- */

@media screen and (max-width: 768px) {
    .desktop-sidebar {
        display: none !important;
    }

    .desktop-header {
        left: 0 !important;
        width: 100% !important;
    }

    .mobile-nav-tabs-wrapper {
        display: block !important;
        position: fixed;
        top: 85px;
        left: 0;
        width: 100%;
        height: 65px;
        z-index: 4999;
        background: transparent;
    }

    body:not(.login-body) .container {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 160px !important;
    }
}


/* ==========================================================================
   6. HEADER  (fragments.html — "header" fragment)
   ========================================================================== */

.header-wrapper {
    width: 100%;
    height: 78px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: transparent;
}

.header {
    width: 98%;
    max-width: 1600px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    margin: 0 auto;
    border-radius: 0 0 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    max-width: calc(100% - 140px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title {
    pointer-events: auto;
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.header-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: #666;
    display: none;
}

/* Header back/home navigation buttons */
.nav-btn, .settings-btn {
    background: var(--main-gradient);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

.header .nav-btn {
    width: 50px;
    height: 40px;
    border-radius: 25px;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-green);
}

.nav-btn svg {
    display: block;
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================================
   7. SIDEBAR  (fragments.html — "sidebar" fragment)
   ========================================================================== */

/* Sidebar wrapper with glass-morphism background */
.sidebar-theme {
    height: 100%;
    background: linear-gradient(to right, rgba(17, 153, 142, 0.45) 0%, rgba(17, 153, 142, 0.05) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.sidebar-theme .top-section {
    margin-top: 40px;
    margin-bottom: 30px;
}

/* Sidebar logo — smaller than login page logo */
.desktop-sidebar .logotext-img {
    width: 280px;
    height: auto;
    border-radius: 20px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
    animation: none;
}

/* Sidebar nav container */
.nav-links {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 20px 0;
}

.sidebar-theme .nav-links {
    height: auto;
    max-height: 50vh;
    background: transparent;
}

/* Individual sidebar nav link */
.nav-link {
    width: 65%;
    max-width: 240px;
    padding: 14px 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 32px;
    color: #666;
    font-weight: 600;
    font-size: 16px;
    display: block;
    text-decoration: none !important;
    transition: all 0.25s;
    position: relative;
}

/* Icons inside nav links are absolutely positioned left */
.nav-link i {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    text-align: center;
    font-size: 1.1em;
}

.nav-link:hover, .nav-link.active {
    background: var(--main-gradient);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-green);
}

/* Override nav-link width inside sidebar theme */
.sidebar-theme .nav-link {
    width: 240px !important;
    max-width: none;
}

/* Sidebar logout button (link to rtzlogin) */
.nav-links a[href*="rtzlogin"] {
    width: 190px !important;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.7);
}

.nav-links a[href*="rtzlogin"]:hover {
    background: #e74c3c !important;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3);
    color: white !important;
}

/* Dashboard inline logout button — used in dashboard.html */
.logout-dashboard-btn:hover {
    background: #e74c3c !important;
    color: white !important;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
}

/* Sidebar footer */
.sidebar-theme .rights-footer {
    margin-top: auto;
    padding-bottom: 80px;
    width: 100%;
}


/* ==========================================================================
   8. MOBILE MENU  (fragments.html — "mobileMenu" fragment)
   ========================================================================== */

.mobile-nav-tabs {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    padding: 0 15px;
    height: 60px;
}

.tab-item {
    flex: 1;
    max-width: 130px;
    height: 52px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-item i {
    font-size: 18px;
    margin-bottom: 2px;
    color: #11998e;
}

.tab-item span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tab-item:hover {
    background: #f8fafc;
    transform: translateY(1px);
}

.tab-item.active {
    background: linear-gradient(90deg, #38ef7d 0%, #11998e 100%) !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 10px rgba(17, 153, 142, 0.3);
}

.tab-item.active i {
    color: #ffffff !important;
}

/* Mobile logout tab (red on hover) */
.logout-tab:hover {
    background: #ef4444 !important;
    color: white !important;
}

.logout-tab:hover i {
    color: white !important;
}


/* ==========================================================================
   9. TOAST NOTIFICATIONS  (fragments.html — "toast" fragment)
   ========================================================================== */

/* Toast positioning layer — covers bottom of viewport */
.toast-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px;
    z-index: 99999;
    pointer-events: none;
    background: transparent;
}

/* On dashboard pages, offset for sidebar */
body:not(.login-body) .toast-overlay {
    left: 340px;
    width: calc(100% - 340px);
}

.toast-bar {
    position: fixed;
    left: 0;
    bottom: 32px;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    animation: toast-smooth-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-card {
    min-width: 260px;
    max-width: 90vw;
    background: linear-gradient(90deg, #38ef7d 0%, #11998e 100%);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.4);
    color: #fff;
    font-size: 18px;
    padding: 16px 24px;
    text-align: center;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    font-weight: 500;
}

.toast-card.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4) !important;
}

/* Mobile toast adjustments */
@media (max-width: 768px) {
    .toast-overlay,
    body:not(.login-body) .toast-overlay {
        left: 0 !important;
        width: 100% !important;
        height: 200px;
    }

    .toast-bar {
        bottom: 75px;
    }

    .toast-card {
        font-size: 16px;
        width: 88%;
        padding: 14px 20px;
    }
}


/* ==========================================================================
   10. WARNING BOX  (fragments.html — "warningBox" fragment)
   ========================================================================== */

.warning-box-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    background: transparent !important;
}

.warning-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-card {
    width: 90vw;
    max-width: 480px;
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(17, 153, 142, 0.2);
    text-align: center;
}

.warning-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a3a3a;
    margin-bottom: 15px;
}

.warning-message {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 35px;
}

.warning-actions {
    display: flex;
    gap: 15px;
}

.warning-btn {
    flex: 1;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.warning-btn.confirm {
    background: linear-gradient(90deg, #38ef7d 0%, #11998e 100%);
    color: white;
}

.warning-btn.cancel {
    background: #f0f4f4;
    color: #666;
}

.warning-btn:active {
    transform: scale(0.96);
}


/* ==========================================================================
   11. FOOTER  (fragments.html sidebar + rtzlogin.html)
   ========================================================================== */

.rights-footer {
    text-align: center;
    width: 100%;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

/* Standard stacked layout (all pages) */
.footer-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

/* Login page override: side-by-side footer layout */
.login-body .footer-content-wrapper {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: left;
    gap: 20px;
}

.login-body .logo-container {
    margin-bottom: 0;
}


/* ==========================================================================
   12. CARDS  (dashboard, players, matches, submissions, adfree)
   ========================================================================== */

.admin-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 35px;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.05);
}

.admin-card.highlight {
    border-left: 5px solid var(--primary-teal);
}

.card-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 15px 25px 20px 25px;
}

/* Scrollable card body for tables on mobile */
.card-body.no-padding {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.card-body.no-padding::-webkit-scrollbar {
    display: none;
}


/* ==========================================================================
   13. TABLES  (dashboard, players, matches, submissions, adfree)
   ========================================================================== */

.admin-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
}

.admin-table th {
    background: #f8f9fa;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
}

.admin-table td {
    padding: 15px 10px;
    border-top: 1px solid #f1f1f1;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
}

/* Center the 2nd column (Status) — used in submissions.html, matches.html */
.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.admin-table td:nth-child(2) .small-input {
    margin: 0 auto;
    display: block;
    text-align: center;
}

.admin-table td:nth-child(2) .badge {
    margin: 0 auto;
    display: inline-block;
}

/* Compact sub-table — used in players.html, submissions.html */
.mini-table {
    margin-top: 10px;
    border: 1px solid #f1f1f1;
    border-radius: 8px;
}

.mini-table th { padding: 10px 15px !important; }
.mini-table td { padding: 10px 15px !important; }

/* Clickable player name button in table rows
   — used in dashboard.html, players.html, submissions.html, adfree.html */
.player-link-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    margin: 0;
    color: #1a1a1a;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    vertical-align: middle;
    line-height: 1;
}

.player-link-btn:hover {
    background: rgba(17, 153, 142, 0.08);
    color: #11998e;
}

.player-link-btn span {
    display: inline-block;
    line-height: 1;
}

/* Player name + email stack — used in players.html, adfree.html */
.player-contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.2;
}

.player-link-btn:hover .player-email {
    color: #11998e;
}

.player-name {
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

.player-email {
    color: #888;
    font-size: 12px;
    font-weight: 400;
}


/* ==========================================================================
   14. BADGES  (matches, players, dashboard, submissions, adfree)
   ========================================================================== */

/* Base badge style */
.badge {
    display: inline-block;
    width: 100px;
    text-align: center;
    padding: 6px 0;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status badges */
.badge.online     { background: #e6f9ed; color: var(--primary-teal); }
.badge.unresolved { background: #fff0f0; color: #e74c3c; }
.badge.pending    { background: #fff9e6; color: #f39c12; }
.badge.finished   { background: #f0f0f0; color: #999; border: 1px solid #ddd; width: 80px; }

/* Difficulty badges — used in matches.html */
.badge.easy    { background: #eaf4fc; color: #3498db; }
.badge.medium  { background: #fff4e6; color: #f39c12; }
.badge.hard    { background: #fff0f0; color: #e74c3c; }
.badge.extreme { background: #f4e6ff; color: #8e44ad; }
.badge.insane  { background: #fffde6; color: #b8960c; }

/* Medal badges — used in players.html */
.badge.gold   { background: #FFF9E6; color: #D4AF37; border: 1px solid #F3E5AB; }
.badge.silver { background: #F5F5F7; color: #707070; border: 1px solid #D1D1D1; }
.badge.copper { background: #FFF2EB; color: #A0522D; border: 1px solid #E6D2C1; }

/* Pulsing live-status indicator — used in dashboard.html, matches.html */
.status-badge.pulse {
    background: #ff4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    animation: blink 1.5s infinite;
}


/* ==========================================================================
   15. METRICS  (dashboard.html, players.html, adfree.html)
   ========================================================================== */

.metrics-flex {
    display: flex;
    justify-content: space-around;
    padding: 30px 0;
}

.metric-item label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-teal);
}

/* Competition info data list — used in dashboard.html, players.html */
.data-list p {
    margin-bottom: 18px;
    font-size: 15px;
    color: #444;
    line-height: 1.6;
}

/* Gold value text — used for medal counts */
.text-gold {
    color: #D4AF37 !important;
    font-weight: 700;
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   16. BUTTONS — SHARED  (multiple pages)
   ========================================================================== */

/* Primary green/teal gradient button — used in players.html */
.primary-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--main-gradient);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-green);
}

.primary-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Blue save button — used in players.html, adfree.html */
.save-btn {
    display: block;
    width: 110px;
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #2980b9, #2471a3);
    color: white !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.save-btn:hover, .force-finish-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Red danger button — used in matches.html, adfree.html */
.force-finish-btn {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.3);
    text-decoration: none;
    text-align: center;
    margin: 0 auto;
}

.force-finish-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.4);
}

.force-finish-btn:active {
    transform: translateY(0);
}

/* Vertical button stack in table cells — used in adfree.html */
.action-stack .force-finish-btn {
    width: 110px;
    box-sizing: border-box;
}

.action-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}


/* ==========================================================================
   17. BUTTON LOADING STATES  (save-btn, primary-btn, force-finish-btn, login-btn)
   ========================================================================== */

/* Hide text, keep button size, block clicks */
.save-btn.loading,
.primary-btn.loading,
.force-finish-btn.loading {
    color: transparent !important;
    position: relative;
    pointer-events: none;
}

/* Spinning white circle overlay */
.save-btn.loading::after,
.primary-btn.loading::after,
.force-finish-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -10px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


/* ==========================================================================
   18. LOGIN PAGE  (rtzlogin.html)
   ========================================================================== */

.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 50vh;
}

.login-logo-wrapper {
    margin-bottom: 100px;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Login container override — narrower, vertically centered */
.login-body .container {
    padding: 0 20px;
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    margin: 0 auto;
}

/* Glass-morphic form card */
.login-body .login-form {
    width: 100%;
    background: var(--bg-white-trans);
    backdrop-filter: blur(15px);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
}

.login-form h1 {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-dark);
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="username"],
input[type="password"] {
    width: 100%;
    height: 58px;
    padding: 18px 20px;
    border: 2px solid transparent;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 16px;
    color: #333;
    display: block;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary-teal);
}

.password-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

input[type="password"] {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
}

.login-btn {
    width: 100%;
    padding: 18px;
    background: var(--main-gradient);
    border: none;
    border-radius: var(--btn-radius);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--shadow-green);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(34, 139, 34, 0.4);
}

.login-btn.loading {
    color: transparent;
    position: relative;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.forgot-password {
    text-align: right;
    margin: 15px 0 35px;
}

.forgot-password a {
    color: var(--primary-teal);
    font-size: 14px;
    font-weight: 500;
}


/* ==========================================================================
   19. DASHBOARD  (dashboard.html)
   ========================================================================== */

/* No dashboard-specific styles beyond shared components (cards, metrics,
   tables, badges, .logout-dashboard-btn, .status-badge.pulse, .text-muted) */


/* ==========================================================================
   20. PLAYERS PAGE  (players.html)
   ========================================================================== */

/* Search bar row */
.search-flex {
    display: flex;
    gap: 15px;
}

.admin-input {
    flex: 1;
    height: 45px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fcfcfc;
}

/* Label + input rows in player detail card */
.input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.input-row label {
    width: 120px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Small inline input (also used in adfree.html) */
.small-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 200px;
}

.section-title {
    margin: 25px 0 15px;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: var(--text-dark);
}

.section-divider {
    height: 1px;
    background: #eee;
    margin: 15px 0;
}

/* Centered player stats row */
.metrics-flex.player-stats {
    padding: 20px 0;
    display: flex;
    justify-content: center;
    gap: 60px;
    text-align: center;
}

.player-stats .metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-value.small {
    font-size: 28px;
    font-weight: 700;
}

/* Red highlight for invalid/expired stat values */
#statInvalid, #statExpired {
    color: #e74c3c;
}


/* ==========================================================================
   21. MATCHES PAGE  (matches.html)
   ========================================================================== */

/* Matches page uses shared components: .admin-table, .badge (difficulty + status),
   .force-finish-btn, .save-btn, .status-badge.pulse, .text-muted.
   No additional matches-specific styles needed. */


/* ==========================================================================
   22. SUBMISSIONS PAGE  (submissions.html)
   ========================================================================== */

/* Collapsible solution text toggle button */
.solution-toggle-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-size: 0.85rem;
    color: #475569;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    max-width: 150px;
}

.solution-toggle-btn.expanded {
    background: #ffffff;
    border-color: #11998e;
    color: #11998e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 30ch;
    word-break: break-all;
    white-space: normal;
    margin-bottom: 5px;
    display: block;
    padding: 10px;
    line-height: 1.4;
}

.solution-toggle-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.solution-text {
    transition: opacity 0.2s ease-in-out;
}

.solution-text.fading {
    opacity: 0;
}

/* Vertical stack for solution text + copy button */
.solution-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 10px 0;
}

/* Blue copy-to-clipboard button */
.copy-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #2980b9, #2471a3);
    color: white !important;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}


/* ==========================================================================
   23. AD-FREE PAGE  (adfree.html)
   ========================================================================== */

/* Ad-free page uses shared components: .admin-table, .player-link-btn,
   .player-contact-info, .player-name, .player-email, .save-btn,
   .force-finish-btn, .action-stack, .small-input, .metrics-flex.
   No additional ad-free-specific styles needed. */
