/* ScanningAssist Schedule Modal - Professional Styling */

/* Modal Overlay & Container */
.schedule-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.schedule-modal.active {
    display: block;
}

.schedule-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000 !important;
}

.schedule-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    z-index: 10001 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Steps */
.schedule-step {
    display: none;
}

.schedule-step.active {
    display: block;
}

/* Header */
.schedule-header {
    position: relative;
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.schedule-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    font-size: 1.75rem;
    color: #64748b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-weight: 300;
    line-height: 1;
}

.schedule-close:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: rotate(90deg);
}

.schedule-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.schedule-subtitle {
    font-size: 1.0625rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
    font-weight: 400;
}

/* Body */
.schedule-body {
    padding: 2rem 2.5rem;
}

/* Calendar Section */
.calendar-section {
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-month {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.calendar-nav {
    background: white;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    color: #475569;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav:hover {
    background: #f8fafc;
    border-color: #2f5aae;
    color: #2f5aae;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover:not(.disabled) {
    border-color: #2f5aae;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.calendar-day.selected {
    background: linear-gradient(135deg, #2f5aae 0%, #1e3b73 100%);
    color: white;
    border-color: #2f5aae;
    font-weight: 600;
}

.calendar-day.disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
    border-color: #f1f5f9;
}

.calendar-day.other-month {
    background: transparent;
    border: none;
}

/* Timeslots */
.timeslots-section {
    margin-bottom: 1.5rem;
}

.timeslots-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.timeslots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.timeslot {
    padding: 0.875rem 1rem;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    text-align: center;
}

.timeslot:hover:not(.disabled) {
    border-color: #2f5aae;
    background: #f8fafc;
    transform: translateY(-2px);
}

.timeslot.selected {
    background: linear-gradient(135deg, #2f5aae 0%, #1e3b73 100%);
    color: white;
    border-color: #2f5aae;
    font-weight: 600;
}

.timeslot.disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
    border-color: #f1f5f9;
    text-decoration: line-through;
}

/* Form */
.schedule-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.form-group label:has(+ input[required])::after,
.form-group label:has(+ select[required])::after,
.form-group label:has(+ textarea[required])::after {
    content: ' *';
    color: #dc2626;
    font-weight: 700;
}

.form-group input[required]:invalid:not(:placeholder-shown),
.form-group input[required]:invalid:not(:focus) {
    border-color: #fca5a5;
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #86efac;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2f5aae;
    box-shadow: 0 0 0 3px rgba(47, 90, 174, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-group::before {
    content: 'Select at least one option';
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    color: #334155;
    position: relative;
}

.checkbox-label:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background: linear-gradient(135deg, #2f5aae 0%, #1e3b73 100%);
    border-color: #2f5aae;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #2f5aae;
    background: #f8fafc;
}

/* Selected DateTime Display */
.selected-datetime {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
    color: #0c4a6e;
}

.selected-datetime strong {
    color: #075985;
}

/* Footer */
.schedule-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2.5rem 2rem;
    border-top: 1px solid #e2e8f0;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #2f5aae 0%, #1e3b73 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(47, 90, 174, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(47, 90, 174, 0.4);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
    position: relative;
}

.btn-primary:disabled:hover::after {
    content: 'Fill all required fields and select at least one interest';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Success Step */
.success-step {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.success-content {
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem 0;
}

.success-message {
    font-size: 1.125rem;
    color: #64748b;
    margin: 0 0 2rem 0;
}

.success-details {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 2rem;
    margin: 0 auto 2rem auto;
    text-align: center !important;
    color: #166534;
    line-height: 2;
    font-size: 1.0625rem;
    max-width: 500px;
    width: 100%;
}

.success-details * {
    text-align: center !important;
}

.success-details strong {
    color: #15803d;
    display: block;
    margin: 0 auto 0.75rem auto;
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.success-details div {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .schedule-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .schedule-header {
        padding: 1.5rem 1.25rem 1rem;
    }

    .schedule-body {
        padding: 1.5rem 1.25rem;
    }

    .schedule-footer {
        padding: 1rem 1.25rem 1.5rem;
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .schedule-title {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calendar-grid {
        gap: 0.375rem;
    }

    .calendar-day {
        font-size: 0.8125rem;
    }

    .timeslots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .success-content {
        padding: 2rem 1.25rem;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .success-title {
        font-size: 1.5rem;
    }

    .success-message {
        font-size: 1rem;
    }
}

/* Scrollbar Styling */
.schedule-modal-content::-webkit-scrollbar {
    width: 8px;
}

.schedule-modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

.schedule-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

.schedule-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
