/* Admin-specific styles for calendar management */

/* Calendar Container */
.calendar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Controls */
.controls {
    padding: 1rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Week Navigator */
.week-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 2rem;
}

.nav-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.week-display {
    font-size: 1.1rem;
    color: #374151;
    text-align: center;
    min-width: 350px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.calendar-header {
    display: contents;
}

.day-header {
    position: sticky;
    top: 0;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    z-index: 10;
    font-size: 0.9rem;
}

.time-label {
    position: sticky;
    left: 0;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
    border-right: 2px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    z-index: 5;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot {
    height: 40px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
    position: relative;
}

.time-slot:hover:not(.booked) {
    background: #e0e7ff;
    transform: scale(1.02);
    z-index: 2;
}

.time-slot.available {
    background: #dcfce7;
    border-color: #16a34a;
    color: #15803d;
    cursor: pointer;
}

.time-slot.booked {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
    cursor: pointer;
    font-weight: 500;
}

.time-slot.blocked {
    background: #fef3c7;
    border-color: #d97706;
    color: #92400e;
    cursor: pointer;
}

.time-slot.unavailable {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Week Stats */
.stats {
    padding: 1rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    font-size: 0.875rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Callbacks List */
.callbacks-container {
    padding: 2rem;
}

.callbacks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.callbacks-list {
    display: grid;
    gap: 1rem;
}

.callback-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.callback-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.callback-item.urgent {
    border-left: 4px solid #dc2626;
}

.callback-item.today {
    border-left: 4px solid #d97706;
}

.callback-item.upcoming {
    border-left: 4px solid #16a34a;
}

.callback-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.callback-title {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
}

.callback-time {
    font-size: 0.9rem;
    color: #2563eb;
    font-weight: 500;
}

.callback-details {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.callback-phone {
    font-family: monospace;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.callback-intent {
    margin-top: 0.5rem;
    font-style: italic;
    color: #6b7280;
}

/* History List */
.history-container {
    padding: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.history-list {
    display: grid;
    gap: 1rem;
}

.history-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.history-item.success {
    border-left: 4px solid #16a34a;
}

.history-item.failed {
    border-left: 4px solid #dc2626;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.history-customer {
    font-weight: 600;
    color: #374151;
}

.history-timestamp {
    font-size: 0.85rem;
    color: #64748b;
}

.history-intent {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.history-outcome {
    font-size: 0.85rem;
    font-weight: 500;
}

.history-outcome.success {
    color: #16a34a;
}

.history-outcome.failed {
    color: #dc2626;
}

/* Stats Container */
.stats-container {
    padding: 2rem;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #64748b;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.success h3 {
    color: #16a34a;
}

.stat-card.warning h3 {
    color: #d97706;
}

.stat-card.info h3 {
    color: #2563eb;
}

/* Responsive Design for Admin */
@media (max-width: 1024px) {
    .calendar-grid {
        font-size: 0.8rem;
    }
    
    .day-header {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
    }
    
    .time-slot {
        font-size: 0.65rem;
        height: 35px;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .controls > * {
        width: 100%;
    }
    
    .week-navigator {
        flex-direction: column;
        gap: 1rem;
    }
    
    .calendar-grid {
        grid-template-columns: 60px repeat(7, 1fr);
        font-size: 0.7rem;
    }
    
    .day-header {
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
    }
    
    .time-slot {
        font-size: 0.6rem;
        height: 30px;
    }
    
    .time-label {
        font-size: 0.65rem;
    }
    
    .callbacks-header,
    .history-header,
    .stats-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .history-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .controls,
    .week-navigator,
    .tab-container,
    .legend {
        display: none;
    }
    
    .calendar-grid {
        max-height: none;
    }
    
    .time-slot:hover {
        transform: none;
    }
}
