/**
 * AI Booking Optimizer Styles
 * 
 * Styles for the AI-powered booking optimization UI elements
 * Designed to be subtle for clients, informative for staff
 */

/* Time slot optimization indicators */
.time-slot.ai-optimized {
    position: relative;
    transition: all 0.3s ease;
}

/* Recommendation levels - subtle for clients */
.time-slot.ai-excellent {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.05);
}

.time-slot.ai-very_good {
    border-color: #8BC34A;
    background-color: rgba(139, 195, 74, 0.05);
}

.time-slot.ai-good {
    border-color: #CDDC39;
    background-color: rgba(205, 220, 57, 0.05);
}

/* Hover effects for optimized slots */
.time-slot.ai-optimized:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Rank badges for top recommendations */
.ai-rank-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #FFD700;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* "Why?" button for staff view */
.ai-why-button {
    position: absolute;
    bottom: 2px;
    right: 2px;
    padding: 2px 6px;
    font-size: 11px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.time-slot:hover .ai-why-button {
    opacity: 1;
}

.ai-why-button:hover {
    background: #1976D2;
}

/* Reasoning modal */
.ai-reasoning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.ai-reasoning-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.ai-reasoning-content h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 20px;
}

.recommendation-level {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    margin-bottom: 16px;
}

.recommendation-level.excellent {
    background: #4CAF50;
    color: white;
}

.recommendation-level.very_good {
    background: #8BC34A;
    color: white;
}

.recommendation-level.good {
    background: #CDDC39;
    color: #333;
}

.recommendation-level.acceptable {
    background: #FFC107;
    color: #333;
}

.recommendation-level.poor {
    background: #F44336;
    color: white;
}

.reasoning {
    margin-bottom: 20px;
}

.reasoning strong {
    display: block;
    margin-bottom: 8px;
    color: #555;
}

.reasoning p {
    margin: 0;
    line-height: 1.6;
    color: #666;
}

.score-breakdown {
    margin-bottom: 20px;
}

.score-breakdown strong {
    display: block;
    margin-bottom: 8px;
    color: #555;
}

.score-breakdown ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.score-breakdown li {
    padding: 4px 0;
    color: #666;
    display: flex;
    align-items: center;
}

.score-breakdown li:before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.score-breakdown li.score-positive:before {
    background: #4CAF50;
}

.score-breakdown li.score-negative:before {
    background: #F44336;
}

.score-breakdown li.score-neutral:before {
    background: #9E9E9E;
}

.close-modal {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s ease;
}

.close-modal:hover {
    background: #e0e0e0;
}

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

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Client view - hide staff-only elements */
body:not(.staff-view) .ai-why-button,
body:not(.staff-view) .ai-rank-badge {
    display: none !important;
}

/* Client view - more subtle indicators */
body:not(.staff-view) .time-slot.ai-excellent {
    border-width: 2px;
}

body:not(.staff-view) .time-slot.ai-very_good {
    border-width: 1.5px;
}

/* Recommended slot indicator for clients */
.recommended-slot::after {
    content: 'Recommended';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

/* Good slot indicator for clients */
.good-slot {
    position: relative;
}

.good-slot::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: #8BC34A;
    border-radius: 50%;
}

/* Loading state for optimization */
.time-slots-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.time-slots-loading::after {
    content: 'Optimizing available times...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #666;
}
