/* static/css/service-request.css */

/* =========================================
   1. GENERAL FORM & UTILS
   ========================================= */
body { background-color: #f8f9fa; }

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.cursor-pointer { cursor: pointer; }
.transition-icon { transition: transform 0.3s ease-in-out; }
.rotate-180 { transform: rotate(180deg); }

/* Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-left-color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}
.spinner.hidden { display: none; }
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* =========================================
   2. WIZARD STEPPER (Top Nav)
   ========================================= */
.stepper-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    padding: 0 10px;
}
.stepper-nav::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}
.stepper-item {
    position: relative;
    z-index: 2;
    background: #f8f9fa;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px; 
}
.stepper-circle {
    width: 32px;
    height: 32px;
    background-color: #fff;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #adb5bd;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}
.stepper-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #adb5bd;
    text-transform: uppercase;
}

/* States */
.stepper-item.active .stepper-circle {
    border-color: #0d6efd;
    background-color: #0d6efd;
    color: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}
.stepper-item.active .stepper-label { color: #0d6efd; }

.stepper-item.completed .stepper-circle {
    border-color: #198754;
    background-color: #198754;
    color: white;
}
.stepper-item.completed .stepper-label { color: #198754; }

/* =========================================
   3. REFINED STEP HIGHLIGHTING (Cards & Badges)
   ========================================= */

/* The Card Container */
.form-section-card {
    border: 1px solid #e9ecef; /* Default subtle border */
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
    background: white;
    transition: all 0.25s ease-in-out;
    padding: 1.5rem;
}

/* Active Card State: Blue Glow + Border */
.form-section-card.active-step {
    border-color: #86b7fe;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1); /* The blue halo */
}

/* Section Headers */
.section-header {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

/* The Step Number (Badge) - Default State (Inactive) */
.step-badge {
    background-color: #e9ecef; /* Light Grey Background */
    color: #495057;            /* Dark Grey Text */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    margin-right: 15px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

/* The Step Number - Active State (Highlighted) */
.form-section-card.active-step .step-badge {
    background-color: #0d6efd; /* Blue Background */
    color: white;              /* White Text */
    transform: scale(1.1);     /* Subtle pop effect */
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* =========================================
   4. PAYMENT OPTIONS (Copied from Mail-In)
   ========================================= */
.payment-option-input { 
    display: none !important; 
    visibility: hidden;
}

.payment-option-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    background: white;
    display: block;
    position: relative;
    transition: all 0.2s ease;
}

/* Selected State Styles */
.payment-option-input:checked + .payment-option-card {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

.payment-option-card .bi {
    font-size: 2rem !important; 
    line-height: 1;
}

/* Icon Toggling */
.icon-checked { 
    display: none; 
    color: #0d6efd; 
    font-size: 1.5rem;
}
.icon-unchecked {
    color: #adb5bd; 
    font-size: 1.5rem;
}

.payment-option-input:checked + .payment-option-card .icon-checked { display: inline-block; }
.payment-option-input:checked + .payment-option-card .icon-unchecked { display: none; }

.payment-body {
    display: none;
    border-top: 1px solid #e9ecef;
    background: transparent; 
    padding-top: 15px;
    margin-top: 10px;
}
.payment-option-input:checked + .payment-option-card .payment-body { display: block; }

/* =========================================
   5. DATE & TIME PILLS
   ========================================= */
.date-pill-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
}
.date-pill, .time-pill {
    flex: 0 0 auto;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.date-pill {
    width: 70px;
    height: 75px;
    flex-direction: column;
}
.date-pill .day-name { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; margin-bottom: 2px; }
.date-pill .day-number { font-size: 1.5rem; font-weight: 700; line-height: 1; }

.time-pill {
    min-width: 120px;
    height: 50px;
    padding: 0 15px;
    font-weight: 600;
    font-size: 0.9rem;
}
.date-pill.selected, .time-pill.selected {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* =========================================
   6. QUANTITY STEPPER
   ========================================= */
.quantity-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    /* Custom Instruction Fix: Ensure center alignment for stepper input */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    /* Custom Instruction Fix: Ensure center alignment for stepper input */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
}
.stepper-btn {
    width: 60px;
    height: 50px;
    border: none;
    background: #f8f9fa;
    color: #0d6efd;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}
.stepper-btn:hover { background: #e2e6ea; }
.stepper-btn:active { background: #dae0e5; }
.stepper-input {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    text-align: center;
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    height: 50px !important;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* =========================================
   7. GOOGLE MAPS & AUTOFILL FIXES
   ========================================= */
.pac-container {
    z-index: 10000 !important;
    border-radius: 8px;
    margin-top: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: none;
    font-family: inherit;
    /* [FIX] Ensure it doesn't overflow the input group width */
    max-width: 100% !important;
}

/* Ensure the container of the address input is the anchor for the dropdown width calculation if possible,
   otherwise we fix the offset caused by the input-group-text icon */
.pac-container:after {
    display: none !important; /* Hide Google logo if it causes overflow issues */
}
input::-webkit-calendar-picker-indicator { display: none !important; }

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* =========================================
   8. INPUT VALIDATION VISUALS
   ========================================= */
.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
}
@supports selector(:has(*)) {
    .input-group:has(.form-control.is-valid) .input-group-text,
    .input-group:has(.form-select.is-valid) .input-group-text { border-color: #198754; color: #198754; }
    .input-group:has(.form-control.is-invalid) .input-group-text,
    .input-group:has(.form-select.is-invalid) .input-group-text { border-color: #dc3545; color: #dc3545; }
    .input-group:focus-within .input-group-text { border-color: #86b7fe; z-index: 3; }
    .input-group > .form-control.is-valid, .input-group > .form-select.is-valid { border-left: none !important; }
}
@supports not selector(:has(*)) {
    .form-control.is-valid, .form-select.is-valid { border-left: 1px solid #198754 !important; }
    .form-control.is-invalid, .form-select.is-invalid { border-left: 1px solid #dc3545 !important; }
}

/* =========================================
   9. MODERN BUBBLE INPUTS (REFACTORED)
   ========================================= */
/* Removed height: 50px !important to prevent layout detachment */
.form-control, 
.form-select, 
.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 0.75rem 1rem; /* Maintains size via padding instead of rigid height */
    min-height: 50px; 
    line-height: 1.5;
}

.form-control:focus, 
.form-select:focus {
    background-color: #ffffff;
    border-color: #86b7fe;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Ensure the wrapper is the anchor for the dropdown */
.input-group, 
.form-section-card .mb-3 {
    position: relative !important;
}

/* =========================================
   10. MOBILE SPECIFIC (Sticky Footer)
   ========================================= */
@media (max-width: 991px) {
    /* Hide desktop sidebar */
    #desktop-sidebar { display: none; }
    
    /* Reset Summary Card */
    .col-lg-5 .sticky-summary {
        position: static !important;
        margin-top: 20px;
        width: 100%;
        box-shadow: none;
        padding-bottom: 100px;
        z-index: 1;
    }
    
    /* Mobile Sticky Footer */
    .mobile-footer, .mobile-sticky-footer {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        padding: 12px 16px;
        /* Dynamic padding for iPhone Home Bar */
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 1px solid rgba(0,0,0,0.08) !important;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
        justify-content: space-between;
        align-items: center;
    }
    
    /* Theory: Leave room so the footer doesn't overlap the last input */
    #payment-form {
        padding-bottom: 220px;
    }

    .desktop-submit-btn { display: none !important; }
    
    h1 { font-size: 1.75rem; }
}
/* =========================================
   11. DROPDOWN & LIST FIXES
   ========================================= */
/* Constrain the Blade Type list so it doesn't feel "too large" */
.form-select, .dropdown-menu {
    max-height: 300px; /* Limits vertical span */
}

/* If you are using a custom dropdown library (Select2/Bootstrap) 
   that is appearing at the top of the page: */
.dropdown-menu, 
.select2-container--open .select2-dropdown {
    position: absolute !important;
    top: 100% !important; /* Forces it to attach to the bottom of the input */
    left: 0 !important;
    z-index: 1050; /* Sits above cards but below the mobile-sticky-footer (9999) */
    width: 100% !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    border: 1px solid #e9ecef !important;
    background: #fff;
}
