/* GRIT Common Training App Theme
   Inspired by mainstream platforms (Strava / TrainingPeaks style):
   clean white background, neutral surfaces, orange primary actions. */

body:not(.theme-dark) {
    --grit-primary: #fc4c02 !important;
    --grit-primary-dark: #e64500 !important;
    --grit-primary-light: #ff6a2c !important;
    --grit-accent: #2f6db3 !important;

    --bg-primary: #ffffff !important;
    --bg-secondary: #f7f8fa !important;
    --bg-tertiary: #eef1f4 !important;
    --background-color: #f4f6f8 !important;

    --card-background: #ffffff !important;
    --card-elevated: #ffffff !important;
    --border-color: #dfe3e8 !important;

    --text-primary: #1f2937 !important;
    --text-secondary: #4b5563 !important;
    --text-tertiary: #6b7280 !important;
    --text-muted: #9ca3af !important;
}

body:not(.theme-dark) {
    background: #f4f6f8 !important;
    color: var(--text-primary) !important;
}

body:not(.theme-dark) main,
body:not(.theme-dark) .container {
    background: transparent !important;
}

body:not(.theme-dark) header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

body:not(.theme-dark) header::after {
    display: none !important;
}

body:not(.theme-dark) .grit-logo img,
body:not(.theme-dark) .grit-logo-img,
body:not(.theme-dark) img[alt="GRIT Logo"] {
    filter: none !important;
}

body:not(.theme-dark) nav a {
    color: var(--text-secondary) !important;
    border-radius: 8px !important;
}

body:not(.theme-dark) nav a:hover {
    color: var(--text-primary) !important;
    background: #f3f4f6 !important;
}

body:not(.theme-dark) nav a.active {
    color: #fc4c02 !important;
    background: #fff1ea !important;
    font-weight: 600 !important;
}

body:not(.theme-dark) .card,
body:not(.theme-dark) [class*="card"] {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: none !important;
    transform: none !important;
}

body:not(.theme-dark) .card:hover,
body:not(.theme-dark) [class*="card"]:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    border-color: #d1d5db !important;
}

body:not(.theme-dark) .card::before,
body:not(.theme-dark) [class*="card"]::before {
    display: none !important;
}

body:not(.theme-dark) h1,
body:not(.theme-dark) h2,
body:not(.theme-dark) h3,
body:not(.theme-dark) h4,
body:not(.theme-dark) h5,
body:not(.theme-dark) h6 {
    color: var(--text-primary) !important;
}

body:not(.theme-dark) p,
body:not(.theme-dark) span,
body:not(.theme-dark) li,
body:not(.theme-dark) td,
body:not(.theme-dark) label {
    color: var(--text-secondary) !important;
}

body:not(.theme-dark) .btn,
body:not(.theme-dark) button[class*="btn"] {
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

body:not(.theme-dark) .btn-primary,
body:not(.theme-dark) button.btn-primary,
body:not(.theme-dark) [class*="btn-primary"] {
    background: #fc4c02 !important;
    border: 1px solid #fc4c02 !important;
    color: #ffffff !important;
}

body:not(.theme-dark) .btn-primary:hover,
body:not(.theme-dark) button.btn-primary:hover,
body:not(.theme-dark) [class*="btn-primary"]:hover {
    background: #e64500 !important;
    border-color: #e64500 !important;
}

body:not(.theme-dark) .btn-primary::after {
    display: none !important;
}

body:not(.theme-dark) .btn-secondary,
body:not(.theme-dark) button.btn-secondary,
body:not(.theme-dark) [class*="btn-secondary"] {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}

body:not(.theme-dark) .btn-secondary:hover,
body:not(.theme-dark) button.btn-secondary:hover,
body:not(.theme-dark) [class*="btn-secondary"]:hover {
    background: #f9fafb !important;
    color: var(--text-primary) !important;
}

body:not(.theme-dark) input,
body:not(.theme-dark) textarea,
body:not(.theme-dark) select {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
}

body:not(.theme-dark) input:focus,
body:not(.theme-dark) textarea:focus,
body:not(.theme-dark) select:focus {
    border-color: #fc4c02 !important;
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.16) !important;
    outline: none !important;
}

body:not(.theme-dark) table {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
}

body:not(.theme-dark) table th {
    background: #f9fafb !important;
    color: #6b7280 !important;
}

body:not(.theme-dark) table td {
    color: #374151 !important;
}

body:not(.theme-dark) table tr:hover {
    background: #f9fafb !important;
}

body:not(.theme-dark) .metric-value,
body:not(.theme-dark) .stat-value,
body:not(.theme-dark) .big-number {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #111827 !important;
    text-shadow: none !important;
}

body:not(.theme-dark) .mobile-bottom-nav {
    background: #ffffff !important;
    border-top: 1px solid var(--border-color) !important;
    backdrop-filter: none !important;
}

body:not(.theme-dark) .mobile-bottom-nav a {
    color: #6b7280 !important;
}

body:not(.theme-dark) .mobile-bottom-nav a.active {
    color: #fc4c02 !important;
}

body:not(.theme-dark) ::-webkit-scrollbar-track {
    background: #f3f4f6 !important;
}

body:not(.theme-dark) ::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

body:not(.theme-dark) ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Temporary product scope simplification */
a[href="training-plans-new.html"],
a[href="crews.html"],
a[href="coach-dashboard.html"],
a[href="analytics.html"],
a[href="atp.html"],
a[href="pace-curve.html"] {
    display: none !important;
}

/* Hide quick links/buttons that point to removed modules */
.analytics-tab[href="analytics.html"],
.analytics-tab[href="atp.html"],
.analytics-tab[href="pace-curve.html"],
.quick-action[href="atp.html"],
.quick-action[href="training-plans-new.html"] {
    display: none !important;
}

/* Unified header hard override */
body:not(.theme-dark) header.grit-simple-header,
body.theme-light header.grit-simple-header {
    background: #184b86 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.32) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.26) !important;
    color: #fff !important;
    height: 96px !important;
}

body:not(.theme-dark) header.grit-simple-header .grit-unified-left,
body.theme-light header.grit-simple-header .grit-unified-left {
    align-items: center !important;
    gap: 14px !important;
}

body:not(.theme-dark) header.grit-simple-header .grit-logo,
body.theme-light header.grit-simple-header .grit-logo {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

body:not(.theme-dark) header.grit-simple-header .grit-logo-img,
body.theme-light header.grit-simple-header .grit-logo-img,
body:not(.theme-dark) header.grit-simple-header .grit-logo img,
body.theme-light header.grit-simple-header .grit-logo img {
    height: 82px !important;
    width: auto !important;
    max-height: none !important;
}

body:not(.theme-dark) header.grit-simple-header .grit-unified-title,
body.theme-light header.grit-simple-header .grit-unified-title {
    color: #fff !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

body:not(.theme-dark) header.grit-simple-header nav.simple-header-nav a,
body.theme-light header.grit-simple-header nav.simple-header-nav a {
    color: #ffffff !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
}

body:not(.theme-dark) header.grit-simple-header nav.simple-header-nav a:hover,
body.theme-light header.grit-simple-header nav.simple-header-nav a:hover {
    background: rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
}

body:not(.theme-dark) header.grit-simple-header nav.simple-header-nav a.active,
body.theme-light header.grit-simple-header nav.simple-header-nav a.active {
    background: #ffffff !important;
    color: #1f5fa8 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
}

body:not(.theme-dark) header.grit-simple-header .quick-add-nav-btn,
body.theme-light header.grit-simple-header .quick-add-nav-btn {
    background: #fff !important;
    color: #1f5fa8 !important;
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1.35rem !important;
}

/* Footer hard override (prevents gray text from global nav/p/span rules) */
body:not(.theme-dark) footer,
body.theme-light footer {
    color: #ffffff !important;
}

body:not(.theme-dark) footer *,
body.theme-light footer * {
    color: #ffffff !important;
    opacity: 1 !important;
}

body:not(.theme-dark) footer nav a,
body.theme-light footer nav a,
body:not(.theme-dark) footer nav a:hover,
body.theme-light footer nav a:hover,
body:not(.theme-dark) footer nav a:visited,
body.theme-light footer nav a:visited,
body:not(.theme-dark) footer .footer-content,
body.theme-light footer .footer-content {
    color: #ffffff !important;
}
