/*-- -------------------------- -->
<---         Calendar           -->
<--- -------------------------- -*/

/* Calendar Section */
.cs-calendar-section {
    padding: 3rem 0;
    --sectionPadding: 3rem 0;
}

.cs-calendar-section .cs-container {
    width: 100%;
    max-width: 80rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 48px - 64px */
    gap: clamp(3rem, 6vw, 4rem);
}

.cs-calendar-section .cs-content {
    /* set text align to left if content needs to be left aligned */
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* centers content horizontally, set to flex-start to left align */
    align-items: center;
}

.cs-calendar-section .cs-topper {
    font-size: var(--topperFontSize);
    line-height: 1.2em;
    text-transform: uppercase;
    text-align: inherit;
    letter-spacing: .1em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    display: block;
}

.cs-calendar-section .cs-title {
    font-size: var(--headerFontSize);
    font-weight: 900;
    line-height: 1.2em;
    text-align: inherit;
    max-width: 43.75rem;
    margin: 0 0 1rem 0;
    color: var(--headerColor);
    position: relative;
}

/* Calendar Container */
.cs-calendar-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 2rem;
}

/* Calendar Header */
.cs-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.cs-calendar-nav {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    color: #666;
}

.cs-calendar-nav:hover {
    background-color: #e9ecef;
    color: #333;
}

.cs-calendar-month {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Calendar Grid */
.cs-calendar-grid {
    padding: 1rem;
}

.cs-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1rem;
}

.cs-weekday {
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cs-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e9ecef;
}

.cs-calendar-day {
    aspect-ratio: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
    padding: 0.25rem;
    font-weight: 500;
}

.cs-calendar-day:hover {
    background-color: #f8f9fa;
    transform: scale(1.02);
}

.cs-calendar-day-empty {
    background-color: #f8f9fa;
    cursor: default;
}

.cs-calendar-day-empty:hover {
    background-color: #f8f9fa;
    transform: none;
}

.cs-calendar-day-today {
    background-color: #007bff;
    font-weight: 700;
}

.cs-calendar-day-today:hover {
    background-color: #0056b3;
}

.cs-calendar-day-selected {
    background-color: #28a745;
    color: white;
}

.cs-calendar-day-has-event {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
}

.cs-calendar-day-has-event:hover {
    background-color: #ffeaa7;
}

/* Event Indicators - Multiple Dots */
.cs-event-indicators {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
    flex-wrap: wrap;
    max-width: 100%;
}

.cs-event-indicator {
    width: 6px;
    height: 6px;
    background-color: #dc3545;
    border-radius: 50%;
    flex-shrink: 0;
}

.cs-event-indicator-more {
    width: auto;
    height: auto;
    background-color: #dc3545;
    border-radius: 50%;
    color: white;
    font-size: 8px;
    font-weight: bold;
    min-width: 12px;
    min-height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Modal Styles */
.cs-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.cs-modal-content {
    background-color: #fff;
    margin: 10% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.cs-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cs-modal-close {
    color: #666;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cs-modal-close:hover,
.cs-modal-close:focus {
    color: #333;
    background-color: #e9ecef;
}

.cs-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 80px);
}

.cs-event-content {
    margin-bottom: 1.5rem;
}

.cs-event-content:last-child {
    margin-bottom: 0;
}

.cs-event-title {
    color: #333;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.cs-event-detail {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.cs-event-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
    flex-shrink: 0;
}

.cs-event-value {
    color: #333;
    flex: 1;
}

.cs-event-description {
    margin: 1rem 0;
    color: #555;
    line-height: 1.6;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.cs-event-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.cs-event-link:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

.cs-event-separator {
    border: none;
    height: 1px;
    background-color: #e9ecef;
    margin: 1.5rem 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .cs-calendar-header {
        padding: 1rem;
    }
    
    .cs-calendar-month {
        font-size: 1.25rem;
    }
    
    .cs-calendar-grid {
        padding: 0.5rem;
    }
    
    .cs-weekday {
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .cs-calendar-day {
        min-height: 50px;
        font-size: 0.875rem;
    }
    
    .cs-event-indicators {
        gap: 1px;
    }
    
    .cs-event-indicator {
        width: 4px;
        height: 4px;
    }
    
    .cs-event-indicator-more {
        min-width: 10px;
        min-height: 10px;
        font-size: 7px;
    }
    
    /* Mobile Modal Fixes */
    .cs-modal-content {
        margin: 24% auto;
        width: 95%;
        border-radius: 8px;
    }
    
    .cs-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .cs-modal-body {
        padding: 1rem;
        max-height: calc(95vh - 60px);
        -webkit-overflow-scrolling: touch;
    }
    
    .cs-event-title {
        font-size: 1.1rem;
    }
    
    .cs-event-detail {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .cs-event-label {
        min-width: auto;
    }
    
    .cs-event-link {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .cs-calendar-day {
        min-height: 40px;
        font-size: 0.8rem;
    }
    
    .cs-weekday {
        font-size: 0.7rem;
        padding: 0.5rem 0.125rem;
    }
    
    .cs-modal-content {
        margin: 1% auto;
        width: 98%;
        max-height: 98vh;
        border-radius: 6px;
    }
    
    .cs-modal-body {
        max-height: calc(98vh - 50px);
    }
}

/* Small Desktop - 1024px */
@media only screen and (min-width: 64rem) and (max-width: 81.25rem) {
    .cs-modal-content {
        margin: 14% auto;
    }
}
