/**
 * Appointment Calendar Styles
 * Persian/RTL Support
 */

/* Modal Overlay */
.appointment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appointment-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.appointment-modal .modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

/* Modal Header */
.appointment-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.appointment-modal .modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.appointment-modal .close-appointment-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.appointment-modal .close-appointment-modal:hover {
    color: #1f2937;
}

/* Modal Body */
.appointment-modal .modal-body {
    padding: 30px;
}

/* Calendar Section */
.calendar-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
}

.calendar-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

/* Persian Calendar Customization */
.appointment-calendar {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.appointment-calendar table {
    width: 100%;
    border-collapse: collapse;
}

.appointment-calendar td,
.appointment-calendar th {
    padding: 10px;
    text-align: center;
    border: none;
}

.appointment-calendar th {
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.appointment-calendar td span {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.appointment-calendar td.available-date span {
    background: #d1fae5;
    color: #047857;
    font-weight: 600;
}

.appointment-calendar td.available-date span:hover {
    background: #10b981;
    color: #fff;
    transform: scale(1.1);
}

.appointment-calendar td.unavailable-date span {
    background: #f3f4f6;
    color: #d1d5db;
    cursor: not-allowed;
}

.appointment-calendar td.selected span {
    background: #4f46e5 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.appointment-calendar td.today span {
    border: 2px solid #4f46e5;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.calendar-legend .legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.calendar-legend .legend-color.available {
    background: #d1fae5;
}

.calendar-legend .legend-color.unavailable {
    background: #f3f4f6;
}

/* Time Slots Section */
.time-slots-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
}

.time-slots-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.time-slots-container {
    max-height: 400px;
    overflow-y: auto;
}

.select-date-first {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.select-date-first i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.select-date-first p {
    margin: 0;
    font-size: 16px;
}

/* Time Slots Grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.time-slot-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: right;
}

.time-slot-btn:hover:not(.disabled) {
    border-color: #4f46e5;
    background: #eef2ff;
}

.time-slot-btn.selected {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.time-slot-btn.disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot-btn .time {
    font-size: 16px;
    font-weight: 600;
}

.time-slot-btn .available-count {
    font-size: 12px;
    opacity: 0.8;
}

.time-slot-btn.selected .available-count {
    opacity: 1;
}

/* Booking Form */
.booking-form-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.selected-slot-info {
    background: #eef2ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.selected-slot-info h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #4f46e5;
}

.selected-slot-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.selected-slot-info .label {
    font-weight: 500;
    color: #6b7280;
}

.selected-slot-info .value {
    font-weight: 600;
    color: #1f2937;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group .form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Payment Info */
.payment-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
}

.fee-details {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
}

.fee-row.remaining {
    border-top: 2px solid #e5e7eb;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 600;
    font-size: 16px;
}

.fee-value {
    font-weight: 600;
    color: #4f46e5;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.form-actions .btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.form-actions .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.form-actions .btn-secondary:hover {
    background: #e5e7eb;
}

.form-actions .btn-primary {
    background: #4f46e5;
    color: #fff;
}

.form-actions .btn-primary:hover {
    background: #4338ca;
}

.form-actions .btn i {
    margin-left: 8px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* No Slots */
.no-slots {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .appointment-modal .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .appointment-modal .modal-body {
        padding: 20px;
    }

    .calendar-section,
    .time-slots-section {
        margin-bottom: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* RTL Support */
[dir="rtl"] .appointment-calendar td,
[dir="rtl"] .appointment-calendar th {
    text-align: center;
}

[dir="rtl"] .time-slot-btn {
    text-align: right;
}

[dir="rtl"] .form-actions .btn i {
    margin-left: 0;
    margin-right: 8px;
}
