* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: rgb(0, 91, 150);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Sidebar Navigation */
#sidenavbar {
    position: fixed;
    left: 0;
    top: 0;
    width: 120px;
    height: 100vh;
    background: rgb(44, 44, 44);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.navitem {
    width: 80px;
    height: 80px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.navitem img {
    max-width: 50px;
    max-height: 50px;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.navitem:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Active navigation indicator */
.nav-indicator {
    position: absolute;
    left: -5px;
    width: 5px;
    height: 60px;
    background: rgb(0, 150, 255);
    border-radius: 0 3px 3px 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.5);
}

/* Main Content Area */
#maincontent {
    margin-left: 120px;
    min-height: 100vh;
    background: rgb(0, 76, 125);
    padding: 30px;
    transition: background-color 0.5s ease;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-header h1 {
    color: white;
    font-size: 2.5em;
    font-weight: 600;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-controls h2 {
    color: white;
    font-size: 1.5em;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.nav-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2em;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.today-button {
    background: rgba(0, 150, 255, 0.8);
    border: none;
    color: white;
    font-size: 1em;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.today-button:hover {
    background: rgba(0, 150, 255, 1);
    transform: scale(1.05);
}

hr {
    border: none;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

/* Calendar Wrapper */
.calendar-wrapper {
    display: flex;
    gap: 30px;
    height: calc(100vh - 200px);
}

/* Main Calendar (70%) */
.calendar-main {
    flex: 0 0 70%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    height: 100%;
}

.calendar-day-header {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1.1em;
    text-align: center;
    padding: 15px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

#calendar-days-container {
    display: contents;
}

.calendar-day {
    background: rgba(252, 251, 251, 0.3);
    border-radius: 10px;
    padding: 10px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day.today {
    background: rgba(0, 150, 255, 0.3);
    border: 2px solid rgba(0, 150, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 150, 255, 0.4);
}

.calendar-day.selected {
    background: rgba(0, 200, 100, 0.3);
    border: 2px solid rgba(0, 200, 100, 0.8);
}

.day-number {
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 5px;
}

.day-events {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-indicator {
    background: rgba(255, 100, 100, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.event-indicator.assignment {
    background: rgba(100, 255, 100, 0.7);
}

.event-indicator.event {
    background: rgba(255, 150, 100, 0.7);
}

.event-bar-container {
    width: 100%;
    height: 8px;
    display: flex;
    gap: 1px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.event-bar {
    flex: 1;
    transition: all 0.2s ease;
    cursor: pointer;
}

.event-bar:hover {
    opacity: 0.8;
    filter: brightness(1.2);
}

/* Calendar Sidebar (30%) */
.calendar-sidebar {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.sidebar-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.sidebar-section h3 {
    color: white;
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.selected-date-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    font-weight: 500;
}

/* Events and Assignments Lists */
.events-list,
.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.event-item,
.assignment-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    margin-bottom: 12px;
}

.event-item {
    border-left-color: rgba(255, 150, 100, 0.9);
}

.assignment-item {
    border-left-color: rgba(100, 255, 100, 0.9);
}

.event-item:hover,
.assignment-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(3px);
}

.item-title {
    color: white;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.item-details {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.item-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-course {
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.9em;
    display: inline-block;
    margin-top: 5px;
}

.empty-message {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .calendar-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .calendar-main {
        flex: 1;
        height: 60vh;
        min-height: 500px;
    }
    
    .calendar-sidebar {
        flex: 1;
    }
}

@media (max-width: 768px) {
    #maincontent {
        margin-left: 80px;
        padding: 20px;
    }
    
    #sidenavbar {
        width: 80px;
    }
    
    .calendar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .calendar-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .calendar-day {
        min-height: 80px;
    }
    
    .day-number {
        font-size: 1em;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}