:root {
    --primary-color: #3b82f6; /* Modern Blue */
    --secondary-color: #6b7280; /* Neutral Gray */
    --event-color: #10b981; /* Success Green */
    --accent-color: #f59e0b; /* Accent Yellow */
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --font-family: 'Inter', sans-serif;
}



.calendar-container {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* --- Header & Controls --- */
.calendar-header {
    display: flex;
    flex-wrap: wrap; /* Allows wrap on small screens */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.navigation-controls, .view-controls {
    display: flex;
    align-items: center;
    margin-bottom: 10px; /* Space on wrap */
}

#currentMonthYear {
    margin: 0 20px;
    color: var(--primary-color);
    font-size: clamp(1rem, 2vw, 22px);
    font-weight: 700;
        cursor: pointer;
}

.view-button, .nav-button {
    padding: 10px 18px;
    border: none;
    background-color: transparent;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1rem;
    margin: 0 2px;
    border: 1px solid var(--primary-color);
}

.nav-button {
    border: 1px solid var(--primary-color);
    padding: 8px 10px;
}

.view-button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.view-button:hover:not(.active), .nav-button:hover {
    background-color: var(--primary-color);
    color: #000;
}

/* --- Calendar Grid --- */
.calendar-days-header,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 1px; /* Minimal gap for separation */
}

.calendar-days-header span {
    padding: 12px 0;
    font-weight: 700;
    color: var(--secondary-color);
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.calendar-grid {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--border-color); /* Grid lines color */
}

.calendar-cell {
    min-height: 120px;
    background-color: var(--bg-white);
    padding: 10px;
    text-align: left;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.calendar-cell:hover {
    background-color: #f1f5f9;
}

.calendar-cell.inactive {
    background-color: #fcfcfc;
    color: var(--secondary-color);
    opacity: 0.7;
    cursor: default;
}

.calendar-cell .day-number {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1f2937;
    display: block;
    margin-bottom: 8px;
    position: absolute;
    top: 5px;
    right: 10px;
}

.calendar-cell.inactive .day-number {
    color: var(--secondary-color);
}

.calendar-cell .event-indicator {
    background-color: var(--event-color);
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%; /* Confine event text */
}

/* --- Weekly View Adjustment --- */
.weekly-view .calendar-cell {
}

/* Hide event indicators in weekly view on mobile to save space */
@media (max-width: 768px) {
    .calendar-days-header span {
        font-size: 0.85rem;
        padding: 8px 0;
    }

    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .navigation-controls {
        justify-content: space-between;
        width: 100%;
    }

    .view-controls {
        justify-content: center;
        margin-top: 15px;
    }
    
    .calendar-cell {
    min-height: 60px;
    
}

.calendar-cell .event-indicator{
        background-color: var(--event-color);
    color: white;
    font-size: 0;
    padding: 1px;
    border-radius: 50%;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height:5px;
    width:5px;
    margin:1.5px;
    
}
.calendar-cell .event-cator{
            display: flex;
        justify-content: space-around;
}
.calendar-cell .day-number {
    font-size: 1rem;
}

}



/* --- Modal Styling (No major changes, just ensuring modern consistency) --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.close-btn {
    color: var(--secondary-color);
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 15px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

#modalDateTitle {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

#modalEventList {
    margin-top: 20px;
}

#modalEventList div {
    padding: 15px;
    border-left: 6px solid var(--accent-color);
    background-color: var(--bg-light);
    margin-bottom: 12px;
    border-radius: 6px;
    line-height: 1.5;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- NEW: Picker Modal Styling --- */

.picker-content {
    max-width: 400px; /* Smaller size for the picker */
    padding: 20px;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.picker-title-clickable {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    transition: color 0.2s;
}

.picker-title-clickable:hover {
    color: var(--event-color);
}

.picker-grid {
    display: grid;
    gap: 5px;
    text-align: center;
}

/* Day View Grid */
.day-grid {
    grid-template-columns: repeat(7, 1fr);
}

.picker-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

/* Month/Year View Grid */
.month-grid, .year-grid {
    grid-template-columns: repeat(3, 1fr);
}

.picker-cell {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    background-color: var(--bg-light);
    transition: background-color 0.1s, transform 0.1s;
    font-weight: 500;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.picker-cell:hover:not(.inactive) {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.picker-cell.inactive {
    opacity: 0.5;
    cursor: default;
}

/* Event Dot Indicator */
.event-dot {
    position: absolute;
    bottom: 5px;
    /* Adjust based on cell type (day/month) */
    width: 6px; 
    height: 6px;
    background-color: red; /* Event Dot Color */
    border-radius: 50%;
}
.day-grid .picker-cell .event-dot {
    left: 50%;
    transform: translateX(-50%);
}

/* --- New Today Button & Highlight Styles --- */

/* Style for the Today button itself */
.view-button.today-btn {
    background-color: var(--accent-color); /* Use accent color for distinction */
    color: white;
    font-weight: 700;
    margin: 0 5px; /* Add some space around it */
    border: 1px solid var(--accent-color);
}

.view-button.today-btn:hover {
    background-color: darken(var(--accent-color), 10%); /* Slightly darker on hover */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Style for the Today's date cell highlight */
.calendar-cell.today {
    background-color: #fffbeb; /* Light yellow background */
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.4);
}

.calendar-cell.today .day-number {
    color: var(--accent-color); /* Highlight the day number color */
}