/* Calendar Section Styles */
.calendar-section {
    padding: 100px 0;
    position: relative;
    min-height: 100vh;
}

/* Header Styling */
.calendar-header-wrapper {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.calendar-subtitle {
    display: block;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 500;
}

.calendar-main-title {
    font-size: 42px;
    color: #ffffff;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.calendar-header-line {
    width: 60px;
    height: 3px;
    background: #ffffff;
    margin: 20px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Main Calendar Container */
.calendar-container {
    background: rgba(20, 20, 20, 0.6);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    width: 98%;
    max-width: 100%;
    margin: 0 auto;
}

/* Instructions Text */
.calendar-instructions {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-top: 20px;
    line-height: 1.6;
    font-weight: 400;
}

.calendar-instructions .text-open {
    color: #00e5ff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.calendar-instructions strong {
    color: white;
    font-weight: 600;
}

/* Calendar Controls */
.calendar-controls {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
    min-height: 50px;
}

.calendar-legend-inline {
    position: absolute;
    left: 20px;
    display: flex;
    gap: 20px;
}

/* Mobile Legend Styling */
.calendar-legend-mobile {
    display: none; /* Hidden by default */
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.calendar-legend-mobile .legend-item {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 767px) {
    .calendar-legend-inline.desktop-only {
        display: none;
    }

    .calendar-legend-mobile {
        display: flex;
    }
    
    .calendar-controls {
        justify-content: center; /* Center controls when legend is gone */
    }
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.legend-item .dot.open {
    background: #00e5ff; /* Cyan for Open */
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.legend-item .dot.closed {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

.legend-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    max-width: 600px;
    line-height: 1.5;
}

.highlight-ticket {
    color: #5865F2;
    font-weight: 700;
    background: rgba(88, 101, 242, 0.1);
    padding: 2px 8px;
    border-radius: 5px;
    white-space: nowrap;
}



.discord-btn {
    display: inline-block;
    background: #5865F2;
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.3);
}

.discord-btn:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.5);
    color: white;
}

.highlight-text {
    color: #fff;
    font-weight: 600;
}



.current-month {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.calendar-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    min-width: 50px; /* Prevent shrinking */
    min-height: 50px; /* Prevent shrinking */
    flex-shrink: 0;   /* Prevent shrinking */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.calendar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
}

.weekday-header {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    padding-bottom: 15px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    min-height: 150px; /* Increased height */
    height: 100%; /* Fill grid cell */
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

/* Status Indicators on Days */
.calendar-day.status-open {
    border-top: 3px solid rgba(0, 229, 255, 0.5);
}

.calendar-day.status-closed {
    border-top: 3px solid rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.05);
    opacity: 0.8;
    cursor: not-allowed;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.today {
    background: rgba(22, 114, 75, 0.2);
    border-color: #16724B;
    box-shadow: 0 0 20px rgba(22, 114, 75, 0.2);
}

.calendar-day.has-event {
    background: rgba(22, 114, 75, 0.15);
    border-color: rgba(22, 114, 75, 0.4);
    box-shadow: inset 0 0 20px rgba(22, 114, 75, 0.1);
}

.calendar-day.has-event:hover {
    background: rgba(22, 114, 75, 0.25);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.day-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.today-dot {
    width: 8px;
    height: 8px;
    background: #16724B;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(22, 114, 75, 0.8);
}

.calendar-day.has-event .day-number {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
}

.calendar-day.today .day-number {
    color: #43b581;
    text-shadow: 0 0 10px rgba(67, 181, 129, 0.5);
    position: relative; /* For dot positioning if needed */
}

/* Event Indicators */
.event-pill {
    background: #16724B;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.event-pill:hover {
    background: #1e9663;
    transform: scale(1.02);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.event-modal {
    background: transparent;
    border: none;
    border-radius: 25px;
    width: 90%;
    max-width: 500px; /* Match card width */
    padding: 0;
    position: relative;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: none;
}

.modal-backdrop.active .event-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    background: rgba(0,0,0,0.6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-close:hover {
    color: white;
    background: #16724B;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px rgba(22, 114, 75, 0.5);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 2rem;
    color: white;
    margin: 0;
}

.modal-date {
    color: #16724B;
    font-size: 1.1rem;
    margin-top: 5px;
    font-weight: 500;
}

.modal-body {
    color: rgba(255, 255, 255, 0.8);
}

.info-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.info-label {
    width: 120px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.info-value {
    color: white;
    font-weight: 500;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.action-btn {
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
}

.btn-primary {
    background: #16724B;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #1e9663;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 114, 75, 0.4);
}

.events-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .weekday-header {
        display: none;
    }
    
    .calendar-day {
        min-height: 0;
        flex-direction: row;
        align-items: flex-start; /* Better for multiple events */
        justify-content: space-between;
        padding: 15px;
    }

    /* Show Weekday Name from data attribute */
    .day-number::before {
        content: attr(data-weekday);
        width: 35px; /* Fixed width for the weekday part (MON, TUE...) */
        display: inline-block;
        color: rgba(255, 255, 255, 0.5);
        font-weight: 400;
        text-transform: uppercase;
        font-size: 0.9em;
        text-align: left;
    }

    .day-number {
        margin-bottom: 0;
        white-space: nowrap;
        width: 75px; /* Rigid width for the whole number block */
        min-width: 75px; 
        flex-shrink: 0;
        display: flex;
        align-items: center; 
    }
    
    .calendar-day.empty {
        display: none;
    }

    .today-dot {
        display: none;
    }
    
    .events-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Left align events like in user diagram */
        gap: 5px;
        margin-top: 0;
        margin-left: 0; /* Remove margin as padding exists in cell/gap */
        flex: 1; 
        border-left: 1px solid rgba(255,255,255,0.1); /* Visual separator line */
        padding-left: 15px; /* Space after separator */
        min-width: 0; /* Critical for flex child truncation/wrap */
    }

    .event-pill {
        margin: 0;
        max-width: 100%;
        width: 100%; /* Fill wrapper width - SAME WIDTH FOR ALL */
        text-align: left;
        white-space: normal; /* Allow text wrapping */
        min-height: 0; /* Dynamic height based on content */
        height: auto;
        display: block; /* Standard block behavior for text wrapping */
        line-height: 1.4;
        padding: 8px 12px;
    }
}
