/* Calendar UI Overhaul - Full Match Design */
.ac-calendar-wrapper {
    font-family: 'Inter', sans-serif;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}
.ac-calendar-wrapper, .ac-calendar-wrapper * {
    box-sizing: border-box;
}

/* Top Header */
.ac-top-header {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.ac-month-title-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    width: 100%;
}
.ac-month-title-text {
    text-align: center;
    position: relative;
}
.ac-month-title-text h1 {
    font-size: 42px;
    font-weight: 800;
    color: #1e3a5f;
    margin: 0;
    text-transform: capitalize;
}
.ac-month-title-text span {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: 8px;
    text-transform: uppercase;
    display: block;
    position: relative;
}
.ac-month-title-text span::before, .ac-month-title-text span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: #fbd6b1;
}
.ac-month-title-text span::before { left: -50px; }
.ac-month-title-text span::after { right: -50px; }

.ac-nav-area {
    display: flex;
    gap: 10px;
}
.ac-nav-btn {
    width: 100px;
    height: 40px;
    border-radius: 8px;
    background: #1e3a5f;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ac-nav-btn svg { width: 20px; height: 20px; }

/* Main Layout */
.ac-main-layout {
    max-width: 1200px;
    width: 100%;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Left Panel */
.ac-left-panel {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ac-category-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 2px solid transparent;
}
.ac-category-card.ac-card-red { border-color: #ffd6d6; }
.ac-category-card.ac-card-blue { border-color: #d6ebff; }
.ac-category-card.ac-card-green { border-color: #d6ffd6; }
.ac-category-card.ac-card-purple { border-color: #faebff; }

.ac-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
}
.ac-card-header svg { width: 24px; height: 24px; }
.ac-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.ac-card-red .ac-card-header { background: #ffebeb; color: #ff3333; }
.ac-card-red .ac-card-header svg { fill: #ff3333; color: #ff3333; }
.ac-card-blue .ac-card-header { background: #ebf5ff; color: #1e70c9; }
.ac-card-blue .ac-card-header svg { fill: #1e70c9; color: #1e70c9; }
.ac-card-green .ac-card-header { background: #ebffeb; color: #339933; }
.ac-card-green .ac-card-header svg { fill: #339933; color: #339933; }
.ac-card-purple .ac-card-header { background: #faebff; color: #993399; }
.ac-card-purple .ac-card-header svg { fill: #993399; color: #993399; }

.ac-month-events-list {
    margin: 0;
    padding: 15px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ac-month-events-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}
.ac-month-events-list li .ac-date-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: white;
    font-weight: 800;
    min-width: 60px;
    text-align: center;
}
.ac-card-red .ac-date-badge { background: #ff5c5c; }
.ac-card-blue .ac-date-badge { background: #3b91eb; }
.ac-card-green .ac-date-badge { background: #5cbd5c; }

/* Right Panel - Grid */
.ac-right-panel {
    flex: 1;
}

.ac-grid-container {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.ac-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-weight: 800;
    font-size: 13px;
    text-align: center;
}
.ac-grid-header div {
    padding: 12px 0;
    color: white;
    background: #284b72;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.ac-grid-header div.ac-saturday { background: #fbd6b1; color: #1e3a5f; }
.ac-grid-header div.ac-sunday { background: #ffcccc; color: #cc0000; border-right: none; }

.ac-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.ac-day {
    min-height: 120px;
    padding: 10px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ac-day:nth-child(7n) { border-right: none; }
.ac-day.empty { background: #fafafa; }
.ac-day.ac-is-sunday .ac-date-num { color: #cc0000; }

.ac-date-num {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
}

/* Event Badges Inside Grid Cells */
.ac-grid-event-badge {
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-radius: 8px;
    margin-bottom: 5px;
    text-align: center;
    gap: 4px;
}
.ac-grid-event-badge svg {
    width: 20px;
    height: 20px;
}
.ac-grid-event-badge span {
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
}

/* Badge Color Classes */
.ac-badge-red { background: #fff0f0; color: #e60000; }
.ac-badge-red svg { fill: #e60000; color: #e60000; }
.ac-badge-yellow { background: #fffbf0; color: #d49a00; }
.ac-badge-yellow svg { fill: #d49a00; color: #d49a00; }
.ac-badge-blue { background: #f0f8ff; color: #0066cc; }
.ac-badge-blue svg { fill: #0066cc; color: #0066cc; }
.ac-badge-green { background: #f0fff0; color: #228b22; }
.ac-badge-green svg { fill: #228b22; color: #228b22; }
.ac-badge-purple { background: #f8f0ff; color: #8a2be2; }
.ac-badge-purple svg { fill: #8a2be2; color: #8a2be2; }

/* Bottom Legend */
.ac-bottom-legend {
    margin-top: 30px;
    background: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    gap: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.ac-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}
.ac-legend-item svg { width: 24px; height: 24px; }
.ac-icon-red { color: #e60000; fill: #e60000; }
.ac-icon-yellow { color: #d49a00; fill: #d49a00; }
.ac-icon-blue { color: #0066cc; fill: #0066cc; }
.ac-icon-green { color: #228b22; fill: #228b22; }
.ac-icon-purple { color: #8a2be2; fill: #8a2be2; }

.ac-footer-note {
    margin-top: 15px;
    font-size: 14px;
    font-style: italic;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ac-footer-note::before, .ac-footer-note::after {
    content: '';
    width: 30px;
    height: 1px;
    background: #ccc;
}

@media (max-width: 900px) {
    .ac-main-layout { flex-direction: column; width: 100%; max-width: 100%; }
    .ac-left-panel { flex: auto; width: 100%; flex-direction: row; flex-wrap: wrap; }
    .ac-category-card { flex: 1; min-width: 250px; }
    .ac-bottom-legend { flex-wrap: wrap; justify-content: center; border-radius: 12px; width: 100%; }
    
    .ac-right-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .ac-grid-container {
        overflow-x: auto;
        width: 100%;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .ac-grid-header, .ac-grid {
        min-width: 700px;
    }
    .ac-month-title-area {
        gap: 20px;
    }
    .ac-month-title-text h1 {
        font-size: 32px;
    }
}

@media (max-width: 600px) {
    .ac-calendar-wrapper { padding: 20px 10px; }
    .ac-left-panel { flex-direction: column; }
    .ac-category-card { min-width: 100%; }
    
    .ac-month-title-area {
        gap: 10px;
    }
    .ac-month-title-text h1 {
        font-size: 24px;
    }
    .ac-month-title-text span {
        letter-spacing: 2px;
        font-size: 10px;
    }
    .ac-month-title-text span::before { left: -30px; width: 20px; }
    .ac-month-title-text span::after { right: -30px; width: 20px; }
    
    .ac-nav-btn { width: auto; height: 36px; }
}
