* {
    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;
}

#maincontent h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

hr {
    border: none;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

/* Course List Container */
.courselist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    max-width: 1400px;
}

/* Course Link Wrapper */
.course-link {
    text-decoration: none;
    display: block;
}

/* Course Module Card */
.classmodule {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
}

.classmodule:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.classmodule img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Course Info Section */
.course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.classmodule h2 {
    color: white;
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* Course Meta Tags */
.course-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.course-id-tag,
.course-grade-tag {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.course-id-tag {
    background: rgba(255, 255, 255, 0.15);
}

.course-grade-tag {
    background: rgba(128, 128, 128, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Course Arrow */
.course-arrow {
    color: rgba(255, 255, 255, 0.5);
    font-size: 2em;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.classmodule:hover .course-arrow {
    color: white;
    transform: translateX(5px);
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 1.2em;
    opacity: 0.8;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-state h3 {
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 600;
}

.empty-state p {
    font-size: 1.1em;
    opacity: 0.8;
    margin-bottom: 10px;
}

/* Error State */
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.error-state h3 {
    font-size: 2em;
    margin-bottom: 15px;
    color: rgb(255, 100, 100);
}

.error-state p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.retry-button {
    background: rgba(0, 150, 255, 0.8);
    border: none;
    color: white;
    font-size: 1em;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.retry-button:hover {
    background: rgba(0, 150, 255, 1);
    transform: scale(1.05);
}

/* 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: 1200px) {
    .courselist {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    #maincontent {
        margin-left: 80px;
        padding: 20px;
    }
    
    #sidenavbar {
        width: 80px;
    }
    
    .navitem {
        width: 60px;
        height: 60px;
    }
    
    .courselist {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .classmodule {
        padding: 20px;
    }
    
    .classmodule img {
        width: 50px;
        height: 50px;
    }
    
    .classmodule h2 {
        font-size: 1.2em;
    }
}

/* Animation for course cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.classmodule {
    animation: fadeInUp 0.5s ease-out;
}

.classmodule:nth-child(1) { animation-delay: 0.1s; }
.classmodule:nth-child(2) { animation-delay: 0.2s; }
.classmodule:nth-child(3) { animation-delay: 0.3s; }
.classmodule:nth-child(4) { animation-delay: 0.4s; }
.classmodule:nth-child(5) { animation-delay: 0.5s; }
.classmodule:nth-child(6) { animation-delay: 0.6s; }