/**
 * Tour Time Slots Styles
 * Consolidated styling for time slot functionality
 */

/* Main time slots container */
.form-time-slots {
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e5e5e5;
}

.form-time-slots .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: block;
    font-size: 16px;
}

/* Loading state */
.time-slots-loading {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
}

.time-slots-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1EC69A;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Time slots grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.time-slot-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.time-slot-item:hover:not(.disabled):not(.sold-out) {
    border-color: #1EC69A;
    background-color: #f8fff8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 198, 154, 0.15);
}

.time-slot-item.selected {
    border-color: #1EC69A;
    background-color: #1EC69A;
    color: #fff;
    box-shadow: 0 4px 15px rgba(30, 198, 154, 0.3);
}

.time-slot-item.disabled,
.time-slot-item.sold-out {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
    color: #999;
}

.time-slot-item.limited {
    border-color: #ff9800;
    background-color: #fff8f0;
}

.time-slot-item.limited:hover:not(.disabled) {
    border-color: #f57c00;
    background-color: #fff3e0;
}

/* Time slot content */
.time-slot-time {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
}

.time-slot-status {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-slot-capacity {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Status colors */
.text-success { color: #28a745 !important; }
.text-warning { color: #ff9800 !important; }
.text-danger { color: #dc3545 !important; }
.text-info { color: #17a2b8 !important; }

/* Sold out slots section */
.sold-out-slots {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.sold-out-toggle {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 0;
    text-decoration: underline;
}

.sold-out-toggle:hover {
    color: #333;
}

/* Empty state */
.time-slots-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.time-slots-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

/* Error state */
.time-slots-error {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #c53030;
    margin: 15px 0;
}

.time-slots-retry {
    background: #c53030;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.time-slots-retry:hover {
    background: #9c2828;
}

/* Responsive design */
@media (max-width: 768px) {
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .time-slot-item {
        padding: 10px 6px;
        min-height: 55px;
    }
    
    .time-slot-time {
        font-size: 14px;
    }
    
    .time-slot-status {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .form-time-slots {
        padding: 10px 0;
    }
}

/* Animation for loading slots */
.time-slot-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility improvements */
.time-slot-item:focus {
    outline: 2px solid #1EC69A;
    outline-offset: 2px;
}

.time-slot-item[aria-selected="true"] {
    border-color: #1EC69A;
    background-color: #1EC69A;
    color: #fff;
}

/* Print styles */
@media print {
    .time-slots-grid {
        display: block;
    }
    
    .time-slot-item {
        display: inline-block;
        margin: 5px;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
