/**
 * Interview Slots CSS
 * Styles for slot picker and availability calendar widgets
 */

/* ==========================================================================
   Slot Picker Widget
   ========================================================================== */

.interview-slot-picker-widget {
    margin-bottom: 1rem;
}

.interview-slot-picker-widget .card-title {
    font-size: var(--font-size-md);
    margin-bottom: 0;
}

/* Date Selector */
.slot-date-selector input[type="date"] {
    width: auto;
    min-width: 160px;
}

/* Quick Date Buttons */
.quick-dates .btn {
    font-size: var(--font-size-sm);
}

/* Slot Grid */
.slot-grid {
    min-height: 100px;
}

.slot-time-period {
    padding: 0.5rem 0;
}

.slot-period-label {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #eee;
}

/* Slot Items */
.slot-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 110px;
    text-align: center;
}

.slot-item.available {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.slot-item.available:hover {
    background-color: #a7f3d0;
    border-color: #34d399;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slot-item.booked {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    cursor: not-allowed;
}

.slot-item.unavailable {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

.slot-item.selected {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.slot-item.selected:hover {
    background-color: #2563eb;
}

/* Conflict Highlighting */
.slot-item.has-conflict {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #ef4444;
    position: relative;
}

.slot-item.has-conflict::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.slot-item.has-conflict:hover {
    background-color: #fee2e2;
    border-color: #dc2626;
}

/* Slot Time Display */
.slot-time {
    white-space: nowrap;
}

/* Timezone Indicator */
.slot-timezone-indicator {
    font-size: var(--font-size-xs);
    font-weight: normal;
    margin-left: 0.25rem;
    vertical-align: middle;
}

#slot-timezone-notice {
    background-color: #f0f9ff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border-left: 3px solid #3b82f6;
}

#slot-timezone-notice .text-info {
    font-size: var(--font-size-sm);
}

/* Conflict Warning Pulse Animation */
@keyframes conflict-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 0 10px rgba(234, 179, 8, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
    }
}

.conflict-pulse {
    animation: conflict-pulse 0.6s ease-out;
}

/* Retry Button Container */
#slot-retry-container {
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    border: 1px dashed #d1d5db;
}

#slot-retry-container .btn {
    min-width: 120px;
}

/* Conflict Checking Indicator */
#slot-conflict-checking {
    padding: 0.5rem;
    background-color: #f0f9ff;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* Conflict Unavailable Warning */
#slot-conflict-unavailable {
    padding: 0.5rem;
    background-color: #fffbeb;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* Legend */
.slot-legend {
    font-size: var(--font-size-sm);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.slot-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
}

.slot-dot.available {
    background-color: #d1fae5;
    border-color: #6ee7b7;
}

.slot-dot.booked {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.slot-dot.unavailable {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
}

.slot-dot.selected {
    background-color: #3b82f6;
    border-color: #2563eb;
}

.slot-dot.has-conflict {
    background-color: #fef2f2;
    border-color: #ef4444;
    position: relative;
}

.slot-dot.has-conflict::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
}

/* ==========================================================================
   Availability Calendar Widget
   ========================================================================== */

.availability-calendar-widget {
    margin-bottom: 1rem;
}

.availability-calendar-widget .card-title {
    font-size: var(--font-size-md);
    margin-bottom: 0;
}

/* Calendar Grid */
.calendar-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.calendar-day-header {
    padding: 0.25rem;
}

.calendar-week {
    margin-bottom: 0.25rem;
}

.calendar-day-cell {
    padding: 0.5rem 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day-cell:not(.past) {
    cursor: pointer;
}

.calendar-day-cell:not(.past):hover {
    background-color: #e2e8f0;
}

.calendar-day-cell.past {
    opacity: 0.5;
}

.calendar-day-cell.today {
    border: 2px solid #3b82f6;
    font-weight: bold;
}

.calendar-day-cell.weekend {
    background-color: #f8fafc;
}

.calendar-day-cell.has-slots {
    background-color: #ecfdf5;
}

.calendar-day-cell.no-slots {
    background-color: #fef2f2;
}

.calendar-day-cell.active {
    background-color: #dbeafe;
    border: 2px solid #3b82f6;
}

.day-number {
    font-size: var(--font-size-base);
    font-weight: 600;
}

.slot-count {
    font-size: var(--font-size-xs);
    margin-top: 0.25rem;
}

.slot-count .badge {
    font-size: var(--font-size-xs);
    padding: 0.15rem 0.35rem;
}

/* Calendar Legend */
.calendar-legend {
    font-size: var(--font-size-sm);
}

.calendar-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.calendar-dot.has-slots {
    background-color: #10b981;
}

.calendar-dot.no-slots {
    background-color: #ef4444;
}

.calendar-dot.today-marker {
    border: 2px solid #3b82f6;
    background-color: transparent;
}

/* Calendar Loading Overlay */
.calendar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ==========================================================================
   My Availability Page
   ========================================================================== */

.my-availability-page .weekly-schedule {
    margin-bottom: 2rem;
}

.my-availability-page .day-schedule {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.my-availability-page .day-schedule:last-child {
    border-bottom: none;
}

.my-availability-page .day-label {
    font-weight: 600;
    min-width: 100px;
}

.my-availability-page .slot-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #f8fafc;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.my-availability-page .slot-row:hover {
    background-color: #f1f5f9;
}

.my-availability-page .slot-row .slot-time {
    flex-grow: 1;
}

.my-availability-page .slot-row .slot-actions {
    display: flex;
    gap: 0.25rem;
}

/* Bulk Create Form */
.bulk-create-form {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.bulk-create-form .day-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.bulk-create-form .day-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Time Slot Generation Preview */
.slot-preview {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.slot-preview .preview-slot {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #d1fae5;
    border-radius: 0.25rem;
    margin: 0.25rem;
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .slot-item {
        min-width: 90px;
        padding: 0.4rem 0.75rem;
        font-size: var(--font-size-sm);
    }

    .quick-dates .btn-group {
        flex-wrap: wrap;
    }

    .quick-dates .btn {
        flex: 1 1 auto;
        margin-bottom: 0.25rem;
    }

    .calendar-day-cell {
        padding: 0.25rem;
    }

    .day-number {
        font-size: var(--font-size-sm);
    }

    .slot-count .badge {
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 576px) {
    .slot-date-selector .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .slot-date-selector .col-auto {
        width: 100%;
        text-align: center;
    }

    .slot-date-selector input[type="date"] {
        width: 100%;
    }

    .slot-items {
        justify-content: center;
    }

    .slot-item {
        flex: 1 1 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
}

/* ==========================================================================
   Dark Mode Support (if AdminLTE dark mode is enabled)
   ========================================================================== */

[data-bs-theme="dark"] .slot-item.available,
.dark-mode .slot-item.available {
    background-color: #064e3b;
    color: #d1fae5;
    border-color: #047857;
}

[data-bs-theme="dark"] .slot-item.booked,
.dark-mode .slot-item.booked {
    background-color: #7f1d1d;
    color: #fecaca;
    border-color: #b91c1c;
}

[data-bs-theme="dark"] .slot-item.unavailable,
.dark-mode .slot-item.unavailable {
    background-color: #374151;
    color: #9ca3af;
    border-color: #4b5563;
}

[data-bs-theme="dark"] .calendar-day-cell.weekend,
.dark-mode .calendar-day-cell.weekend {
    background-color: #1f2937;
}

[data-bs-theme="dark"] .calendar-day-cell.has-slots,
.dark-mode .calendar-day-cell.has-slots {
    background-color: #064e3b;
}

[data-bs-theme="dark"] .calendar-day-cell.no-slots,
.dark-mode .calendar-day-cell.no-slots {
    background-color: #7f1d1d;
}

[data-bs-theme="dark"] .bulk-create-form,
.dark-mode .bulk-create-form {
    background-color: #1f2937;
}

[data-bs-theme="dark"] .slot-row,
.dark-mode .slot-row {
    background-color: #1f2937;
}

[data-bs-theme="dark"] .slot-row:hover,
.dark-mode .slot-row:hover {
    background-color: #374151;
}

/* Dark Mode - Conflict Highlighting */
[data-bs-theme="dark"] .slot-item.has-conflict,
.dark-mode .slot-item.has-conflict {
    background-color: #7f1d1d;
    color: #fecaca;
    border-color: #dc2626;
}

[data-bs-theme="dark"] .slot-item.has-conflict:hover,
.dark-mode .slot-item.has-conflict:hover {
    background-color: #991b1b;
    border-color: #ef4444;
}

/* Dark Mode - Retry Container */
[data-bs-theme="dark"] #slot-retry-container,
.dark-mode #slot-retry-container {
    background-color: #1f2937;
    border-color: #4b5563;
}

/* Dark Mode - Conflict Checking Indicator */
[data-bs-theme="dark"] #slot-conflict-checking,
.dark-mode #slot-conflict-checking {
    background-color: #1e3a5f;
}

/* Dark Mode - Conflict Unavailable Warning */
[data-bs-theme="dark"] #slot-conflict-unavailable,
.dark-mode #slot-conflict-unavailable {
    background-color: #422006;
}

/* Dark Mode - Timezone Notice */
[data-bs-theme="dark"] #slot-timezone-notice,
.dark-mode #slot-timezone-notice {
    background-color: #1e3a5f;
    border-left-color: #60a5fa;
}

[data-bs-theme="dark"] .slot-timezone-indicator,
.dark-mode .slot-timezone-indicator {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}
