/* 
 * Global Form Styles
 * Standardized, Compact, Professional Clinic UI
 */

/* --- 1. Compact Input Fields --- */
.form-control {
    display: block;
    width: 100%;
    height: 38px;
    /* Compact height */
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 5px;
    /* Subtle radius */
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #3498db;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

textarea.form-control {
    height: auto;
    padding: 8px 12px;
}

/* --- 2. Form Layout & Spacing --- */
.form-group {
    margin-bottom: 12px;
    /* Reduced from typical 20px+ */
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

small,
.text-muted {
    font-size: 12px;
}

/* --- 3. Grid Systems --- */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

/* Mobile Stack */
@media (max-width: 768px) {

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* --- 4. Modal Improvements --- */
/* Override widely used modal styles for compactness */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-color: #fff;
}

.modal-header {
    padding: 1rem 1.5rem;
    background: #2d5a8f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.modal-header h3 {
    margin: 0 !important;
    color: white !important;
    font-size: 1.25rem !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Close button standardization */
.modal-close-btn,
.modal-header .btn-outline-danger {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #e74c3c !important;
}

.modal-body {
    padding: 1.5rem;
}

/* Fix modal positioning system-wide */
.modal>div {
    margin-top: 5vh !important;
}

/* --- 5. Button Actions --- */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* --- 6. Section Headers within Forms --- */
.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #34495e;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* --- 7. Select Dropdowns --- */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    padding-right: 2rem;
}

/* --- 8. Booking Form V2 Styles --- */
.booking-v2-container {
    padding: 10px;
}

.booking-v2 .form-group {
    margin-bottom: 15px;
}

.booking-v2 .form-control {
    height: 42px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #d1d9e6;
    transition: all 0.2s ease;
}

.booking-v2 .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.booking-type-toggle {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.booking-type-toggle .btn {
    flex: 1;
    height: 42px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

.btn-book-submit {
    height: 52px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    width: 100%;
}

/* Autocomplete Suggestions */
.referral-group {
    position: relative;
}

.autocomplete-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d9e6;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
}

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f1f1;
}

.autocomplete-suggestion:hover {
    background: #f8f9fa;
    color: #3498db;
}

/* --- 9. Mobile Adjustments for Booking Form --- */
@media (max-width: 576px) {
    .booking-v2-container {
        padding: 0;
    }

    .booking-modal-overlay {
        padding: 0 !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: 100vh;
    }

    .modal-header {
        border-radius: 0 !important;
    }

    .modal-body {
        padding: 15px !important;
    }

    .booking-v2 .form-control {
        height: 48px;
        /* Larger touch target */
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    .booking-type-toggle {
        padding: 4px;
    }

    .booking-type-toggle .btn {
        height: 46px;
    }

    .btn-book-submit {
        height: 56px;
    }

    .form-grid-2 {
        gap: 12px;
    }
}