/* 
 * TSP TIPS Unified Theme
 * Centralizes fonts, colors, and dark mode support
 */

/* -------------------------------------------------------------------------- */
/*                                Fonts                                       */
/* -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap');

/* -------------------------------------------------------------------------- */
/*                                Variables                                   */
/* -------------------------------------------------------------------------- */

:root {
    /* Brand Colors */
    --brand-primary: #39c082;
    --brand-primary-hover: #2ea56f;
    --brand-secondary: #282a2f;
    
    /* Backgrounds */
    --bg-body: #ffffff;
    --bg-card: #f9fafb;
    --bg-header: #39c082; /* Updated header color */
    
    /* Text */
    --text-main: #333333;
    --text-muted: #6B7280;
    --text-light: #ffffff;
    
    /* Borders */
    --border-color: #E5E7EB;
    
    /* Gradients */
    --gradient-primary: linear-gradient(90deg, #1a736e, #39c082);
    
    /* Fonts */
    --font-family-base: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

    /* Aliases for App Compatibility */
    --primary-color: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);
    --bg-color: var(--bg-body);
    --bg-secondary: var(--bg-card); /* bg-card matches bg-secondary in base_noheader */
    --text-main: #374340; /* Updated to match base_noheader slightly softer black */
}

/* -------------------------------------------------------------------------- */
/*                                Dark Mode                                   */
/* -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
    :root {
        /* Backgrounds */
        --bg-body: #111827; /* Darker gray, less harsh than pure black */
        --bg-card: #1f2937;
        --bg-header: #1f2937; /* Dark header in dark mode? Or keep green? Usually dark. User asked for #39c082 on all pages... assumingly light mode or global brand. I will keep green for now as requested, or maybe dark green? User rule "header background #39c082". Ill set it to the variable so it uses the root definition unless overridden. */
        /* Actually, I should check if they want it green in dark mode too. "On all the HTML pages... make the header background #39c082". I'll default to the global variable which is now green. */
        /* Wait, if I delete --bg-header here, it falls back to root. */
        
        /* Text */
        --text-main: #f3f4f6;
        --text-muted: #9ca3af;
        
        /* Borders */
        --border-color: #374151;
        
        /* Brand Adjustments for Dark Mode */
        --brand-primary: #39c082; /* Keep same or slightly lighter if needed */
    }

    /* Dark Mode Card Overrides */
    .card, .panel, .well {
        background-color: var(--bg-card) !important;
        border: 1px solid #ffffff !important; /* Thin white outline as requested */
    }
    
    .card-header, .panel-heading {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border-bottom: 1px solid #ffffff !important;
    }

    .card .btn-link {
        color: var(--text-main) !important;
        text-decoration: none;
    }
}

/* -------------------------------------------------------------------------- */
/*                                Global Resets                               */
/* -------------------------------------------------------------------------- */

body {
    font-family: var(--font-family-base) !important;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base) !important;
    font-weight: 700;
    letter-spacing: -0.025em; /* Tighter tracking for Inter */
    color: var(--text-main);
}

p, span, li, a {
    font-family: var(--font-family-base) !important;
}

a {
    color: var(--brand-primary);
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-primary-hover);
    text-decoration: none;
}

/* Ensure FontAwesome icons work despite global overrides */
.fa {
    font-family: FontAwesome !important;
}

/* -------------------------------------------------------------------------- */
/*                                Components                                  */
/* -------------------------------------------------------------------------- */

/* Buttons */
.btn-primary, .btn-green {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.btn-primary:hover, .btn-green:hover {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
}

.btn-gradient {
    background: var(--gradient-primary) !important;
    border: none;
    color: #ffffff !important;
}

.btn-gradient:hover {
    filter: brightness(1.1);
}

/* Cards */
.card, .panel, .well {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

/* Navbar */
.navbar {
    padding: 1rem 0 !important;
    background-color: var(--bg-header) !important;
    /* backdrop-filter: blur(10px); */ /* Removing blur to ensure solid color */
}

.navbar .nav-link, .navbar a:not(.cta-button) {
    color: rgba(255, 255, 255, 1.0) !important;
}

.navbar-inverse, .bg-dark {
    background-color: var(--bg-header) !important;
}

.bg-solid {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
}

/* Header Spacing Utility */
.px-header-80 {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}
@media (min-width: 1200px) { /* Adjust breakpoint as needed, usually large screens match the '96px' observation */
    .px-header-80 {
        padding-left: 80px !important;
        padding-right: 80px !important;
        max-width: 100%; /* Ensure it doesn't constrain like a standard container if we want full width + padding */
    }
}
/* Ensure standard container behavior on smaller screens if needed, or just fluid */


/* -------------------------------------------------------------------------- */
/*                                Utilities                                   */
/* -------------------------------------------------------------------------- */

.text-primary {
    color: var(--brand-primary) !important;
}

.bg-primary {
    background-color: var(--brand-primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}
