/* =========================================
   THEME VARIABLES (Light/Dark Mode)
   ========================================= */
:root {
    /* --- Light Mode Defaults --- */
    --bg-body: #f4f6f9;           /* Light Grey Background */
    --bg-card: #ffffff;           /* White Cards */
    --text-main: #212529;         /* Dark Text */
    --text-muted: #6c757d;        /* Grey Text */
    --border-color: #dee2e6;
    --nav-bg: #212529;            /* Keep Navbar Dark by default or use #092565 */
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] {
    /* --- Dark Mode Overrides --- */
    --bg-body: #000000;           /* Pure Black Background */
    --bg-card: #212529;           /* Dark Grey Cards */
    --text-main: #ffffff;         /* Pure White Text */
    --text-muted: #e0e0e0;        /* Very Light Grey (High Visibility) */
    --border-color: #495057;
    --nav-bg: #000000;
    --input-bg: #2c3034;
    --input-border: #495057;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Fix Bootstrap Utilities for Dark Mode */
/* Force dim text to be bright white/grey */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] small {
    color: var(--text-muted) !important;
}

[data-bs-theme="dark"] .card { background-color: var(--bg-card); color: var(--text-main); }
[data-bs-theme="dark"] .list-group-item { background-color: var(--bg-card); color: var(--text-main); border-color: var(--border-color); }
[data-bs-theme="dark"] .modal-content { background-color: var(--bg-card); color: var(--text-main); }
[data-bs-theme="dark"] .dropdown-menu { background-color: var(--bg-card); border-color: var(--border-color); }
[data-bs-theme="dark"] .dropdown-item { color: var(--text-main); }
[data-bs-theme="dark"] .dropdown-item:hover { background-color: var(--border-color); }

/* --- DARK MODE BUTTON & ACCENT OVERRIDES --- */
/* Forces Primary Buttons AND your custom Submit Button to use Gold in Dark Mode */
[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .submit-btn {
    background-color: #C98F35 !important;
    border-color: #C98F35 !important;
    color: #fff !important;
}

/* Hover State for Gold Buttons (Darker Gold) */
[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:active,
[data-bs-theme="dark"] .btn-primary:focus,
[data-bs-theme="dark"] .submit-btn:hover,
[data-bs-theme="dark"] .submit-btn:focus {
    background-color: #b07c2d !important;
    border-color: #b07c2d !important;
    color: #fff !important;
}

/* Active Navigation Links */
[data-bs-theme="dark"] .nav-pills .nav-link.active,
[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #C98F35 !important;
    border-color: #C98F35 !important;
    color: #fff !important;
}

/* ---  1. General Body & Layout --- */
/* This centers the form on pages that use it, like login/register */
.content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    /* Adjust as needed */
    padding: 20px 0;
}

/* --- 2. The Form Container --- */
.form-container {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow-color);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
}

/* --- 3. Form Headings and Text --- */
.form-container h2 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
    /* Bolder font for the heading */
    text-align: center;
}

.form-container p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
    text-align: center;
}

/* --- 4. Input Fields & Labels --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-main);
}

/* This targets the input fields Django generates */
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    /* Important for padding and width to work together */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    /* Smooth transition for focus effect */
}

/* Style for when the user clicks into an input field */
.form-group input:focus {
    outline: none;
    /* Remove default blue outline */
    border-color: #092565;
    /* Highlight with new primary blue color */
    box-shadow: 0 0 8px rgba(9, 37, 101, 0.2);
}

/* --- 5. The Submit Button --- */
.submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #092565;
    /* New primary blue */
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    /* Smooth transition for hover effect */
}

.submit-btn:hover {
    background-color: #061a48;
    /* A darker shade on hover */
    transform: translateY(-2px);
    /* Slight lift on hover */
}

/* --- 6. Form Footer Links --- */
.form-footer {
    text-align: center;
    margin-top: 25px;
}

.form-footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.form-footer a {
    color: #092565;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* =================================================================== */
/* FORM FIELD ALIGNMENT FIX
/* =================================================================== */
/* This targets any text, email, or password input inside our form
   and forces it to have the correct, full-width Bootstrap style. */

.form-container .mb-3 input[type="text"],
.form-container .mb-3 input[type="email"],
.form-container .mb-3 input[type="password"] {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* This ensures the focus highlight works correctly too */
.form-container .mb-3 input:focus {
    border-color: #1342a8;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(9, 37, 101, 0.25);
}

/*
  Force verification modal to the front
  --------------------------------------------------
  This rule ensures the modal's stacking order is higher
  than the dark backdrop, making its buttons clickable.
*/
#verificationWarningModal {
    z-index: 9999 !important;
}

.hover-lift:hover {
    transform: translateY(-5px);
    transition: transform 0.2s ease-in-out;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);

    /* --- LIGHT MODE IMAGE --- */
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url("../images/thnback1_light.f45de8bb3eea.png");

    background-attachment: fixed;
    background-position: center;
    background-repeat: repeat;
    background-size: auto;

    /* --- STICKY FOOTER SETUP --- */
    /* This forces the body to take up at least 100% of the screen height */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[data-bs-theme="dark"] body {
    /* --- DARK MODE IMAGE --- */
    /* The 0.9 value means 90% Black Overlay. Lower it to 0.7 to make the image clearer. */
    background-image: linear-gradient(rgba(33, 37, 41, 0.92), rgba(33, 37, 41, 0.92)), url("../images/thnback1_dark.5075fd02c2dd.png");

    background-attachment: fixed;
    background-position: center;
    background-repeat: repeat;
    background-size: auto;
}

/* =================================================================== */
/* SIDEBAR FILTER FORM STYLING (Corrected)
/* =================================================================== */
/* Hides the labels for the filter dropdowns in the left sidebar */
.col-lg-2 .form-label {
    display: none;
}

/* Limits the width of the dropdowns in the sidebar */
.col-lg-2 select {
    max-width: 20ch;
}
/* =================================================================== */
/* CUSTOM BUTTON STYLES
/* =================================================================== */
/* Custom button for 'View Details' */
.btn-view-details {
    background-color: #C98F35 !important;
    border-color: #C98F35 !important;
    color: #fff !important;
}

.btn-view-details:hover {
    background-color: #b07c2d !important;
    /* A darker shade */
    border-color: #b07c2d !important;
    color: #fff !important;
}

/* --- Ported Utility Classes --- */
.btn-gold {
    background-color: #E59F24;
    border-color: #E59F24;
    color: #fff;
}

.btn-gold:hover {
    background-color: #C98B20;
    border-color: #C98B20;
    color: #fff;
}

.price-badge-green {
    background-color: #198754 !important;
    color: #fff !important;
    font-weight: normal !important;
}

/* =================================================================== */
/* FOOTER ALIGNMENT FIX
/* =================================================================== */
/* This ensures the footer sits at the bottom of the screen if content is short,
   or at the bottom of the content if the page is long. */
footer,
.footer {
    margin-top: auto;
}

/* =================================================================== */
/* UNIVERSAL GOLD THEME OVERRIDES (Applies to Light & Dark)
/* =================================================================== */

/* 1. Force Bootstrap Variables to Gold for BOTH themes */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-primary: #C98F35;
    --bs-primary-rgb: 201, 143, 53;
    --bs-btn-bg: #C98F35;
    --bs-btn-border-color: #C98F35;
    --bs-btn-hover-bg: #b07c2d;
    --bs-btn-hover-border-color: #b07c2d;
    --bs-link-color: #C98F35;
    --bs-link-hover-color: #b07c2d;
}

/* 2. Force Buttons (Primary, Submit, & Clear Filters) to Gold */
.btn-primary,
.btn-secondary,          /* Targets standard "Clear/Cancel" buttons */
.btn-outline-secondary,  /* Targets outline style buttons */
.submit-btn,
button[type="submit"] {
    background-color: #C98F35 !important;
    border-color: #C98F35 !important;
    color: #ffffff !important;
}

/* 3. Button Hover/Focus States */
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active,
.btn-outline-secondary:hover, .btn-outline-secondary:focus,
.submit-btn:hover, .submit-btn:focus {
    background-color: #b07c2d !important;
    border-color: #b07c2d !important;
    color: #ffffff !important;
}

/* 4. Fix Focus Rings (The glow when you click) */
.btn-check:focus+.btn,
.btn:focus,
input:focus,
select:focus {
    box-shadow: 0 0 0 0.25rem rgba(201, 143, 53, 0.5) !important;
    border-color: #C98F35 !important;
}

/* =================================================================== */
/* MENU, LINK & FORM INPUT OVERRIDES (Universal)
/* =================================================================== */

/* 1. Sidebar & Nav Links - Text turns Gold on Hover */
.nav-link:hover,
.list-group-item-action:hover,
a.text-decoration-none:hover {
    color: #C98F35 !important;
}

/* 2. Dropdown Menu Items (Standard Bootstrap Dropdowns) */
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:active {
    background-color: #C98F35 !important;
    color: #ffffff !important;
}

/* 3. Active Menu Items (Selected Page) */
.nav-link.active,
.dropdown-item.active,
.list-group-item.active {
    background-color: #C98F35 !important;
    border-color: #C98F35 !important;
    color: #ffffff !important;
}

/* 4. Navbar Links */
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #C98F35 !important;
}

/* 5. FORM INPUT FOCUS (Text boxes and Select dropdowns) */
/* This changes the "Blue Glow" around inputs to Gold when you click them */
input:focus,
select:focus,
textarea:focus {
    border-color: #C98F35 !important;
    box-shadow: 0 0 0 0.25rem rgba(201, 143, 53, 0.25) !important;
}

/* 6. CHECKBOXES & RADIO BUTTONS (When checked) */
.form-check-input:checked {
    background-color: #C98F35 !important;
    border-color: #C98F35 !important;
}

/* --- LOGO STYLES (Saved from dark-theme.css) --- */
.fullscreen-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.fullscreen-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Ensure all form labels adapt to theme */
.form-label, .form-check-label {
    color: var(--text-main) !important;
}