/**
 * Frontend CSS for Clinic Reservation Plugin
 * Based on the original clinic reservation system styles
 */

/* Reset and base styles */
.clinic-reservation-frontend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    box-sizing: border-box;
}

.clinic-reservation-frontend *,
.clinic-reservation-frontend *::before,
.clinic-reservation-frontend *::after {
    box-sizing: inherit;
}

/* Notices */
.clinic-notice {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.clinic-notice-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.clinic-notice-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.clinic-notice-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Schedule header */
.clinic-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.schedule-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
}

.schedule-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-button {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.current-week {
    font-weight: 600;
    color: #2c3e50;
    padding: 0 10px;
}

/* Schedule grid */
.clinic-schedule-grid {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.schedule-time-header {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    font-weight: 600;
}

.time-label {
    font-size: 1.1em;
    text-align: center;
}

.schedule-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

/* Day columns */
.day-column {
    background: white;
    display: flex;
    flex-direction: column;
}

.day-column.today {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.day-column.weekend {
    background: #f8f9fa;
}

.day-column.holiday {
    background: #ffe6e6;
}

.day-header {
    background: #495057;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
}

.day-column.today .day-header {
    background: #ffc107;
    color: #212529;
}

.day-name {
    display: block;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.day-date {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
}

.day-closed {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #6c757d;
    font-style: italic;
    font-weight: 500;
}

.closed-text {
    padding: 20px;
    text-align: center;
}

/* Time slots */
.time-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.am-slots,
.pm-slots {
    flex: 1;
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.pm-slots {
    border-bottom: none;
}

.pm-closed {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-style: italic;
    border-top: 1px solid #dee2e6;
}

.time-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.time-slot:last-child {
    margin-bottom: 0;
}

.time-slot.available {
    background: #d4edda;
    border-color: #28a745;
}

.time-slot.unavailable {
    background: #f8d7da;
    border-color: #dc3545;
}

.time-slot.partial {
    background: #fff3cd;
    border-color: #ffc107;
}

.slot-time {
    font-size: 0.85em;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.slot-doctor {
    font-size: 0.75em;
    color: #007cba;
    margin-bottom: 4px;
    text-align: center;
}

.slot-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-indicator {
    font-size: 1.2em;
    font-weight: bold;
}

.available .status-indicator {
    color: #28a745;
}

.unavailable .status-indicator {
    color: #dc3545;
}

.partial .status-indicator {
    color: #ffc107;
}

.book-slot-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    color: #28a745;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.book-slot-btn:hover {
    background: #28a745;
    color: white;
    transform: scale(1.1);
}

/* Schedule legend */
.schedule-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-icon {
    font-size: 1.1em;
    font-weight: bold;
}

.legend-icon.available {
    color: #28a745;
}

.legend-icon.unavailable {
    color: #dc3545;
}

.legend-icon.partial {
    color: #ffc107;
}

.legend-text {
    font-size: 0.9em;
    color: #495057;
}

/* Modal styles */
.clinic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.modal-body {
    padding: 20px;
}

/* Booking form */
.booking-slot-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.booking-slot-info h4 {
    margin: 0 0 10px 0;
    color: #1565c0;
    font-size: 1.1em;
}

.booking-slot-info p {
    margin: 5px 0;
    color: #0d47a1;
}

.form-fields {
    display: grid;
    gap: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.field-group input,
.field-group select,
.field-group textarea {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 6px;
    width: auto;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.button-primary {
    background: #007cba;
    color: white;
}

.button-primary:hover {
    background: #005a87;
    color: white;
}

.button-secondary {
    background: #6c757d;
    color: white;
}

.button-secondary:hover {
    background: #545b62;
    color: white;
}

.booking-notice {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

.booking-notice p {
    margin: 0;
}

/* Theme variations */
.theme-minimal {
    font-size: 0.9em;
}

.theme-minimal .schedule-title {
    font-size: 1.2em;
}

.theme-minimal .time-slot {
    padding: 6px 4px;
}

.theme-compact .clinic-schedule-grid {
    box-shadow: none;
    border: 1px solid #dee2e6;
}

.theme-compact .time-slot {
    padding: 4px;
    margin-bottom: 4px;
}

/* Responsive design */
@media (max-width: 1024px) {
    .schedule-days {
        grid-template-columns: repeat(4, 1fr);
    }

}

@media (max-width: 768px) {
    .clinic-schedule-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .schedule-navigation {
        flex-direction: column;
        gap: 10px;
    }

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

    .legend-item {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }

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

    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .schedule-days {
        grid-template-columns: 1fr;
    }

    .time-slot {
        padding: 6px 4px;
    }

    .slot-time,
    .slot-doctor {
        font-size: 0.8em;
    }

    .schedule-legend {
        flex-direction: column;
        gap: 10px;
    }

    .nav-button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

/* Print styles */
@media print {

    .clinic-modal,
    .schedule-navigation,
    .book-slot-btn {
        display: none !important;
    }

    .clinic-schedule-grid {
        box-shadow: none;
        border: 1px solid #000;
    }

    .day-header {
        background: #f0f0f0 !important;
        color: #000 !important;
    }

    .time-slot {
        border: 1px solid #000;
        background: white !important;
    }

    .status-indicator {
        color: #000 !important;
    }
}

/* Accessibility improvements */
.clinic-reservation-frontend *:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.book-slot-btn:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .time-slot {
        border-width: 2px;
    }

    .day-header {
        border-bottom-width: 2px;
    }

    .clinic-notice {
        border-left-width: 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .time-slot,
    .nav-button,
    .book-slot-btn,
    .modal-close {
        transition: none;
    }

    .book-slot-btn:hover {
        transform: none;
    }
}