/* Booking Form Styles - InfoDisplay */

.booking-section {
    background: #f8f9fa;
    padding: 60px 0;
    border-top: 4px solid #33658A;
}

.booking-header {
    text-align: center;
    margin-bottom: 50px;
}

.booking-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2f4858;
    margin-bottom: 15px;
}

.booking-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.booking-form {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #33658A;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    font-size: 1.75rem;
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #2f4858;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    font-family: 'Poppins', sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s;
    width: 100%;
}

/* Listbox-style select dropdowns with proper text display */
select.form-control[size] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    overflow-y: auto;
    cursor: pointer;
    background: white;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #33658A #f0f0f0;
}

/* Webkit browsers (Chrome, Safari) scrollbar styling */
select.form-control[size]::-webkit-scrollbar {
    width: 8px;
}

select.form-control[size]::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

select.form-control[size]::-webkit-scrollbar-thumb {
    background: #33658A;
    border-radius: 4px;
}

select.form-control[size]::-webkit-scrollbar-thumb:hover {
    background: #2f4858;
}

select.form-control[size]:focus {
    border-color: #33658A;
    box-shadow: 0 0 0 3px rgba(51, 101, 138, 0.1);
    outline: none;
}

/* Option styling for listbox-style selects */
select.form-control[size] option {
    padding: 10px 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #2f4858;
    cursor: pointer;
    white-space: normal;
    word-wrap: break-word;
    min-height: 38px;
    border-radius: 6px;
    margin: 2px 0;
}

/* Hover state for options */
select.form-control[size] option:hover {
    background: #f0f7ff;
}

/* Selected option styling */
select.form-control[size] option:checked {
    background: linear-gradient(135deg, #33658A 0%, #21658A 100%);
    color: white;
    font-weight: 600;
}

/* Disabled option styling */
select.form-control[size] option:disabled {
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Workshop dropdown specific sizing - more compact */
#workshop_id {
    min-height: 180px;
    max-height: 180px;
}

/* County dropdown specific sizing - more compact */
#judet {
    min-height: 160px;
    max-height: 160px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    select.form-control[size] {
        font-size: 0.85rem;
    }

    select.form-control[size] option {
        padding: 8px 6px;
        font-size: 0.8rem;
        min-height: 36px;
    }

    #workshop_id {
        min-height: 160px;
        max-height: 160px;
    }

    #judet {
        min-height: 140px;
        max-height: 140px;
    }
}

.form-control:focus {
    border-color: #33658A;
    box-shadow: 0 0 0 3px rgba(51, 101, 138, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: #999;
}

.form-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 5px;
}

.custom-control-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #2f4858;
    cursor: pointer;
}

.custom-control-label a {
    color: #33658A;
    text-decoration: underline;
}

.custom-control-label a:hover {
    color: #F6AE2D;
}

.form-actions {
    text-align: center;
    margin-top: 40px;
}

.btn-submit {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #33658A 0%, #21658A 100%);
    border: none;
    padding: 15px 50px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(51, 101, 138, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 101, 138, 0.4);
    background: linear-gradient(135deg, #21658A 0%, #33658A 100%);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-submit i {
    margin-right: 8px;
}

.form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.form-message.success::before {
    content: '✓ ';
    font-weight: bold;
}

.form-message.error::before {
    content: '✗ ';
    font-weight: bold;
}

.calendar-busy-info {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #856404;
    display: none;
}

.calendar-busy-info.has-dates {
    display: block;
}

.calendar-busy-info strong {
    display: block;
    margin-bottom: 5px;
}

/* Date input with busy dates indicator */
input[type="date"].has-busy-dates {
    border-left: 4px solid #dc3545;
}

/* Time Slots Grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.time-slot-btn {
    font-family: 'Poppins', sans-serif;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #2f4858;
}

.time-slot-btn.available:hover {
    border-color: #33658A;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(51, 101, 138, 0.15);
}

.time-slot-btn.selected {
    background: linear-gradient(135deg, #33658A 0%, #21658A 100%);
    border-color: #33658A;
    color: white;
    box-shadow: 0 4px 15px rgba(51, 101, 138, 0.3);
}

.time-slot-btn.busy {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828;
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot-btn.busy::after {
    content: ' ✗';
    font-size: 0.85em;
}

#time-selection-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .booking-section {
        padding: 40px 15px;  /* Add horizontal padding to prevent edge crowding */
    }

    .booking-title {
        font-size: 2rem;
    }

    .booking-subtitle {
        font-size: 1rem;
    }

    .booking-form {
        padding: 25px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .form-row {
        display: block;
    }

    .form-row > .form-group {
        width: 100%;
        margin-bottom: 20px;
    }

    .btn-submit {
        width: 100%;
        padding: 15px 30px;
    }

    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .time-slot-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Loading state */
.booking-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom checkbox styling (Bootstrap compatible) */
.custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5rem;
    margin-bottom: 15px;
}

.custom-control-input {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 1rem;
    height: 1.25rem;
    opacity: 0;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #33658A;
    border-color: #33658A;
}

.custom-control-label::before {
    position: absolute;
    top: 0.25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 1px solid #adb5bd;
    border-radius: 0.25rem;
}

.custom-control-label::after {
    position: absolute;
    top: 0.25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}

/* School Autocomplete Dropdown */
.school-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #33658A;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: -8px;
}

.school-autocomplete-dropdown .dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.school-autocomplete-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.school-autocomplete-dropdown .dropdown-item:hover {
    background-color: #f0f7ff;
}

.school-autocomplete-dropdown .dropdown-item.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    cursor: default;
}

.school-autocomplete-dropdown .dropdown-item.no-results {
    text-align: center;
    color: #999;
    font-style: italic;
    cursor: default;
}

.school-autocomplete-dropdown .dropdown-item.error {
    text-align: center;
    color: #dc3545;
    font-style: italic;
    cursor: default;
}

.school-autocomplete-dropdown .school-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #2f4858;
    margin-bottom: 4px;
}

.school-autocomplete-dropdown .school-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
}

.school-autocomplete-dropdown .school-city,
.school-autocomplete-dropdown .school-judet,
.school-autocomplete-dropdown .school-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.school-autocomplete-dropdown .school-city {
    background: #e3f2fd;
    color: #1976d2;
}

.school-autocomplete-dropdown .school-judet {
    background: #f3e5f5;
    color: #7b1fa2;
}

.school-autocomplete-dropdown .school-type {
    background: #fff3e0;
    color: #e65100;
}

/* School input wrapper positioning */
#school {
    position: relative;
}

/* Mobile optimization for dropdown */
@media (max-width: 768px) {
    .school-autocomplete-dropdown {
        max-height: 300px;
        font-size: 0.9rem;
    }

    .school-autocomplete-dropdown .dropdown-item {
        padding: 10px 12px;
    }

    .school-autocomplete-dropdown .school-name {
        font-size: 0.95rem;
    }

    .school-autocomplete-dropdown .school-details {
        gap: 6px;
    }

    .school-autocomplete-dropdown .school-city,
    .school-autocomplete-dropdown .school-judet,
    .school-autocomplete-dropdown .school-type {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}
