/* Interactive Calendar Styles */

/* Calendar Container */
.calendar-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
}

.calendar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.calendar-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Calendar Header */
.calendar-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.calendar-nav button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.calendar-nav button:hover::before {
    width: 300px;
    height: 300px;
}

.calendar-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#current-month-year-all, #current-month-year-tab {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Calendar Grid */
.calendar-grid {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Weekdays */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.weekday {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.weekday:last-child {
    border-right: none;
}

/* Calendar Days */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
    z-index: 1;
}

.calendar-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.calendar-day:hover::before {
    opacity: 1;
}

.calendar-day:hover {
    background: #f8f9ff;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.calendar-day.other-month {
    background: #f5f5f5;
    color: #999;
}

.calendar-day.other-month:hover {
    background: #eeeeee;
}

.calendar-day.today {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

.calendar-day.has-events {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* Day Number */
.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.calendar-day.has-events .day-number {
    color: #1976d2;
}

.calendar-day.today .day-number {
    color: white;
    font-size: 1.2rem;
}

.calendar-day:hover .day-number {
    transform: scale(1.1);
}

/* Event Indicators */
.event-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2rem;
    animation: bounce 2s infinite;
    z-index: 3;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Interactive Event Type Labels */
.event-type-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    border-radius: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 4;
    opacity: 0.9;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    min-width: 65px;
    text-align: center;
    overflow: visible;
}

.event-type-label:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.event-type-label::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-type-label:hover::before {
    opacity: 0.3;
}

/* Event Type Colors */
.event-type-generic {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.event-type-activity {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.event-type-workshop {
    background: linear-gradient(135deg, #f7b731 0%, #f5af19 100%);
}

.event-type-environment {
    background: linear-gradient(135deg, #5f27cd 0%, #341f97 100%);
}

/* Event Count Badge */
.event-count-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 5;
    animation: countPulse 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.event-count-badge:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* Loading Animation */
.calendar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.calendar-loading.active {
    display: block;
}

.calendar-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-container {
        padding: 15px;
        margin: 10px;
    }
    
    .calendar-header {
        padding: 15px;
    }
    
    .calendar-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .calendar-nav button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    #current-month-year-all, #current-month-year-tab {
        font-size: 1.4rem;
        margin-top: 10px;
    }
    
    .weekday {
        padding: 10px 5px;
        font-size: 0.8rem;
    }
    
    .calendar-day {
        min-height: 90px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .event-type-label {
        font-size: 0.5rem;
        padding: 2px 4px;
        min-width: 45px;
    }
    
    .event-count-badge {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
}

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Accessibility */
.calendar-day:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.calendar-nav button:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .calendar-grid {
        background: #2d3748;
    }
    
    .calendar-day {
        background: #4a5568;
        color: white;
    }
    
    .calendar-day.other-month {
        background: #2d3748;
        color: #a0aec0;
    }
    
    .day-number {
        color: white;
    }
    
    .weekday {
        color: white;
    }
}
