/**
 * Orders Statistics Calendar Styling
 */

.orders-statistics-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Roboto', Arial, sans-serif;
}

.orders-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.orders-calendar-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.orders-calendar-wrapper {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    height: 80vh;
    max-height: 800px;
}

/* Calendar cell with order statistics */
.fc-daygrid-day-frame {
    position: relative;
    min-height: 120px;
}

/* Container for day's statistics */
.day-statistics {
    position: relative;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgb(249, 250, 251);
    border-radius: 6px;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
    margin: 0;
    height: 100%;
    width: 100%;
}

/* Status count badges */
.status-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 5px;
}

.status-badge {
    border-radius: 20px;
    padding: 3px 8px;
    margin: 3px;
    font-size: 0.85em;
    white-space: nowrap;
    color: white;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.status-received {
    background-color: #1a73e8; /* Vibrant blue */
    color: white;
    font-weight: bold;
}

.status-baking {
    background-color: #ff9500; /* Bright orange */
    color: white;
    font-weight: bold;
}

.status-ready {
    background-color: #0ac950; /* Vivid green */
    color: white;
    font-weight: bold;
}

.status-canceled {
    background-color: #ff3b30; /* Bright red */
    color: white;
    font-weight: bold;
}

/* Total orders count */
.day-orders-count {
    font-weight: bold;
    font-size: 1.3em;
    color: #1e1e1e;
    text-align: center;
    margin-top: 5px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    padding: 3px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Statistics panel for selected day */
.day-statistics-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 350px;
    background-color: #fff;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.panel-header h3 {
    margin: 0;
    color: #333;
}

.close-panel-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.close-panel-button:hover {
    color: #333;
}

.statistics-content {
    padding: 0 10px;
}

.total-orders {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stat-label {
    font-weight: bold;
    color: #555;
}

.stat-value {
    font-size: 1.2em;
    margin-left: 10px;
    color: #333;
}

.status-statistics-container,
.orders-by-type-container {
    margin-bottom: 20px;
}

.status-statistics-container h4,
.orders-by-type-container h4 {
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-top: 0;
}

.status-statistics,
.cake-type-statistics {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-stat-item,
.cake-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.status-label,
.cake-type-label {
    display: flex;
    align-items: center;
}

.status-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Today highlight */
.fc .fc-day-today {
    background-color: rgba(255, 248, 230, 0.8) !important;
}

.fc .fc-day-today .day-statistics {
    background-color: rgb(255, 248, 220);
    box-shadow: 0 0 6px rgba(255, 200, 0, 0.3), inset 0 0 10px rgba(255, 200, 0, 0.1);
    border: 1px solid rgb(255, 180, 0);
}

/* Fix FullCalendar background events */
.fc .fc-bg-event {
    opacity: 1 !important; /* Remove opacity to make background fully visible */
    background-color: transparent !important; /* Make default background transparent */
}

/* Adjust padding for day cells */
.fc .fc-daygrid-bg-harness {
    position: static !important; /* Override absolute positioning */
    margin: 15px !important;
    padding: 35px !important;
}

/* Week view specific styles */
.fc-dayGridWeek-view .status-badge {
    min-width: 40px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    padding: 2px 4px;
    margin: 2px;
    border-radius: 4px;
}

.fc-dayGridWeek-view .status-badge i {
    margin-left: 3px;
    font-size: 18px;
    line-height: 18px;
    vertical-align: middle;
}

.fc-dayGridWeek-view .day-orders-count {
    font-size: 1.1em;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .day-statistics-panel {
        width: 100%;
    }
    
    .orders-calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .orders-calendar-header h2 {
        margin-bottom: 10px;
    }
    
    .fc-header-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .fc-daygrid-day-frame {
        min-height: 80px;
    }
    
    .status-badge {
        padding: 1px 5px;
        font-size: 0.7em;
    }
}