/**
 * Calendar Widget Styles - Premium Design
 * Compact, beautiful monthly calendar
 */

/* ==================== CONTAINER ==================== */
.cet-calendar-container {
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
}

.cet-calendar {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ==================== HEADER ==================== */
.cet-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cet-calendar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
}

.cet-calendar-month {
    font-weight: 700;
}

.cet-calendar-year {
    opacity: 0.8;
    font-weight: 400;
}

.cet-calendar-nav {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.cet-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.cet-calendar-today-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.cet-calendar-today-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

/* ==================== WEEKDAYS ==================== */
.cet-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(180deg, #f8f9fc 0%, #f1f3f8 100%);
    border-bottom: 1px solid #e8eaf0;
}

.cet-calendar-weekday {
    padding: 14px 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Shabbat column */
.cet-calendar-weekday:last-child {
    color: #764ba2;
}

/* ==================== CALENDAR GRID ==================== */
.cet-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: relative;
}

.cet-calendar-grid.cet-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== DAY CELLS ==================== */
.cet-calendar-day {
    min-height: 90px;
    padding: 8px;
    border-left: 1px solid #f0f2f5;
    border-bottom: 1px solid #f0f2f5;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
}

.cet-calendar-day:nth-child(7n) {
    border-left: none;
}

/* Last row */
.cet-calendar-day:nth-last-child(-n+7) {
    border-bottom: none;
}

.cet-calendar-day:hover {
    background: #f8f9fc;
}

/* Other month days */
.cet-day-other-month {
    background: #fafbfc;
}

.cet-day-other-month .cet-day-number {
    color: #c5c9d4;
}

/* Today */
.cet-day-today {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
}

.cet-day-today .cet-day-number {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

/* Has events */
.cet-day-has-events {
    cursor: pointer;
}

.cet-day-has-events:hover {
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ecff 100%);
}

/* Day number */
.cet-day-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* Shabbat column */
.cet-calendar-day:nth-child(7n) .cet-day-number {
    color: #764ba2;
}

/* ==================== EVENTS IN DAY ==================== */
.cet-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cet-calendar-perf {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.cet-calendar-perf:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.cet-perf-time {
    font-weight: 700;
    flex-shrink: 0;
}

.cet-perf-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.cet-perf-tag {
    font-size: 0.6rem;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    flex-shrink: 0;
}

/* Sold out */
.cet-perf-soldout {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    cursor: not-allowed;
}

.cet-perf-soldout:hover {
    transform: none;
    box-shadow: none;
}

.cet-tag-soldout {
    background: rgba(0, 0, 0, 0.2);
}

/* Unavailable */
.cet-perf-unavailable {
    background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%);
    cursor: not-allowed;
}

/* More events */
.cet-day-more {
    font-size: 0.7rem;
    color: #667eea;
    font-weight: 600;
    padding: 2px 4px;
    text-align: center;
}

/* ==================== LOADING ==================== */
.cet-calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.cet-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8eaf0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: cet-spin 0.8s linear infinite;
}

@keyframes cet-spin {
    to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .cet-calendar-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .cet-calendar-title {
        font-size: 1.2rem;
        width: 100%;
        justify-content: center;
    }
    
    .cet-calendar-day {
        min-height: 70px;
        padding: 6px 4px;
    }
    
    .cet-day-number {
        font-size: 0.8rem;
    }
    
    .cet-calendar-weekday {
        padding: 10px 4px;
        font-size: 0.7rem;
    }
    
    .cet-calendar-perf {
        padding: 3px 5px;
        font-size: 0.6rem;
        gap: 4px;
    }
    
    .cet-perf-title {
        display: none;
    }
}

@media (max-width: 480px) {
    .cet-calendar-day {
        min-height: 55px;
        padding: 4px 2px;
    }
    
    .cet-day-number {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    
    .cet-day-today .cet-day-number {
        width: 22px;
        height: 22px;
    }
    
    .cet-calendar-perf {
        padding: 2px 4px;
        border-radius: 4px;
    }
    
    .cet-perf-time {
        font-size: 0.55rem;
    }
    
    .cet-day-more {
        font-size: 0.6rem;
    }
    
    .cet-calendar-nav {
        width: 36px;
        height: 36px;
    }
    
    .cet-calendar-today-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* ==================== DARK THEME ==================== */
.cet-theme-dark .cet-calendar {
    background: #1a1a2e;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.cet-theme-dark .cet-calendar-weekdays {
    background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    border-color: #2a2a4a;
}

.cet-theme-dark .cet-calendar-weekday {
    color: #8b8bff;
}

.cet-theme-dark .cet-calendar-day {
    background: #1a1a2e;
    border-color: #2a2a4a;
}

.cet-theme-dark .cet-calendar-day:hover {
    background: #22223a;
}

.cet-theme-dark .cet-day-number {
    color: #e0e0e0;
}

.cet-theme-dark .cet-day-other-month {
    background: #151525;
}

.cet-theme-dark .cet-day-other-month .cet-day-number {
    color: #4a4a6a;
}

.cet-theme-dark .cet-day-today {
    background: linear-gradient(135deg, #2a2a1a 0%, #3a3a2a 100%);
}

.cet-theme-dark .cet-day-has-events:hover {
    background: linear-gradient(135deg, #22224a 0%, #2a2a5a 100%);
}

.cet-theme-dark .cet-calendar-loading {
    background: rgba(26, 26, 46, 0.9);
}
