/* General Styling */
body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(-45deg, #fff383, #fff0a8, #fffad1, #fff970, #fff383);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#searchInput:focus + .search-icon {
    color: #ffc400;
}

#searchInput::-webkit-input-placeholder {
    color: #a0aec0;
    font-weight: 400;
}

#searchInput::-moz-placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Search Results Styling */
#searchResultsContainer {
    margin: 30px auto;
    transition: all 0.3s ease;
}

#searchResultsContainer > div:first-child {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f7fafc;
}

#noResultsMessage {
    padding: 20px;
    border-radius: 8px;
    background-color: #f7fafc;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
    transition: none;
}

header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 4px;
    background: linear-gradient(90deg, #fff383, #ffea70);
    border-radius: 2px;
}

.logo-image {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    margin-top: 10px;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-text {
    font-weight: 600;
    color: #6c757d;
    margin-bottom: -10px;
}

header h1 {
    font-size: 3.5rem;
    color: #000;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header p {
    font-size: 1.3rem;
    color: #4a5568;
    margin-bottom: 40px;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Search Bar Styling */
.search-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: #a0aec0;
    z-index: 10;
}

#searchInput {
    padding: 18px 25px 18px 55px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    width: 500px;
    font-size: 1.2rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background-color: #ffffff;
}

#searchInput:focus {
    border-color: #ffc400;
    box-shadow: 0 0 0 0.25rem rgba(255, 196, 0, 0.15), 0 8px 25px rgba(0,0,0,0.12);
    outline: none;
    transform: translateY(-2px);
}

#searchInput:focus + .search-icon {
    color: #5a67d8;
}

#searchInput::-webkit-input-placeholder {
    color: #a0aec0;
    font-weight: 400;
}

#searchInput::-moz-placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Stats Container */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.stat-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main h2 {
    font-size: 1.8rem; /* Larger */
    color: #2d3748; /* Darker heading color */
    border-bottom: 3px solid #e2e8f0; /* Thicker, softer border */
    padding-bottom: 15px;
    margin-top: 50px; /* Increased margin */
    font-weight: 600; /* Medium weight */
    display: flex; /* For icon alignment */
    align-items: center; /* For icon alignment */
}

main h2::before { /* Adding space for icons if they were to be added via CSS */
    margin-right: 10px;
    font-size: 1.5rem; /* Adjust icon size if needed */
}

/* Folder and File Structure */
.folder-container {
    margin-bottom: 40px;
}

.folder {
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.folder:hover {
    transform: translateY(-2px);
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #fff383;
}

.folder-header:hover {
    background-color: rgba(255, 243, 131, 0.15);
}

.folder-header i.fa-folder {
    color: #fff383;
    font-size: 1.2rem;
    margin-right: 15px;
    transition: transform 0.3s ease;
}

.folder-header.active i.fa-folder {
    color: #ffea70;
    transform: scale(1.1);
}

.folder-header span {
    flex-grow: 1;
    font-weight: 600;
    color: #4a5568;
}

.folder-header i.folder-arrow {
    color: #a0aec0;
    transition: transform 0.3s ease;
}

.folder-header.active i.folder-arrow {
    transform: rotate(180deg);
    color: #4a5568;
}

.folder-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    margin-top: 0;
    padding: 0 15px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 10px 10px;
}

.folder-content.active {
    max-height: 2000px; /* Increase to accommodate all possible content */
    transition: max-height 0.5s ease-in, padding 0.3s ease-in;
    padding: 15px;
    border-left: 4px solid rgba(255, 243, 131, 0.3);
    margin-left: 4px;
}

.file-button {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.file-button:hover {
    background-color: rgba(255, 243, 129, 0.1);
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #2d3748;
}

.file-button i {
    margin-right: 10px;
    color: #805ad5;
    font-size: 1.1rem;
}

.file-button span {
    font-weight: 500;
}

/* Search Results Styles */
#searchResultsContainer {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#searchResultsContainer mark {
    background-color: #f6e05e;
    color: #2d3748;
    padding: 0 3px;
    border-radius: 3px;
}

#searchResultsContainer .button-grid {
    margin-top: 15px;
}

/* Viewer Page Styling */
.viewer-body, .viewer-container {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.viewer-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: #fff;
    padding: 16px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.viewer-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: #000;
    font-weight: 700;
    text-align: center;
    grid-column: 2;
}

.back-button {
    font-size: 0.9rem;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    margin-left: 80px; /* Add space to avoid overlap with burger menu */
    grid-column: 1;
    justify-self: start;
}

.quiz-button {
    font-size: 0.9rem;
    color: #fff;
    background-color: #ffc400;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    grid-column: 3;
    justify-self: end;
}

.quiz-button:hover {
    background-color: #e6b000;
}

.iframe-container {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 56px);
    z-index: 1;
}

#doc-iframe {
    width: 100vw;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
    /* Ensure videos display properly */
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* Ensure burger menu is visible on viewer page */
.viewer-body .burger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1200;
    transition: left 0.3s cubic-bezier(.4,2,.6,1);
}

.viewer-body .burger-menu:hover {
    background-color: #fff381;
}

.viewer-body .burger-menu.active {
    left: 320px;
    background-color: #fff381;
}

/* Animated Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 196, 0, 0.3);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 15s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 18s;
}

.particle:nth-child(3) {
    left: 70%;
    animation-delay: 4s;
    animation-duration: 22s;
}

.particle:nth-child(4) {
    left: 80%;
    animation-delay: 6s;
    animation-duration: 16s;
}

.particle:nth-child(5) {
    left: 90%;
    animation-delay: 8s;
    animation-duration: 20s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Category headings */
main h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #2d3748;
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 243, 129, 0.5);
}

.category-icon {
    margin-right: 15px;
    color: #fff381;
    font-size: 1.5rem;
}

/* Subfolder Styling */
.subfolder {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 243, 129, 0.5);
}

.subfolder-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid #ffc400;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.subfolder-header:hover {
    background-color: rgba(255, 243, 129, 0.25);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.subfolder-header i {
    color: #fff381;
    font-size: 1.1rem;
    margin-right: 10px;
}

.subfolder-header.active {
    background-color: rgba(255, 243, 129, 0.2);
    border-left-color: #ffc400;
}

.subfolder .folder-content {
    display: none;
    margin-left: 15px;
    padding-left: 10px;
    border-left: 2px dashed rgba(255, 243, 129, 0.7);
}

.subfolder .folder-content.active {
    display: block;
}

.subfolder .subfolder-content {
    display: none;
    margin-left: 15px;
    padding-left: 10px;
    border-left: 2px dashed rgba(255, 243, 129, 0.7);
}

.subfolder .subfolder-content.active {
    display: block;
}

.subfolder .subfolder-content {
    display: none;
    margin-left: 15px;
    padding-left: 10px;
    border-left: 2px dashed rgba(255, 243, 129, 0.7);
}

.subfolder .subfolder-content.active {
    display: block;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #fff381 0%, #ffdc4d 100%);
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 0;
    list-style-type: none;
}

.sidebar-menu-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 243, 129, 0.15);
}

.sidebar-menu-item.active {
    background-color: rgba(255, 243, 129, 0.3);
}

.sidebar-submenu {
    padding-left: 20px;
    list-style-type: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sidebar-submenu.active {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.sidebar-submenu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.sidebar-submenu-item:hover {
    background-color: rgba(255, 243, 129, 0.1);
}

.sidebar-file-list {
    margin-top: 8px;
    padding-left: 15px;
    display: none;
}

.sidebar-file {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 2px 0;
    text-decoration: none;
    color: #555;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-file:hover {
    background-color: rgba(255, 243, 129, 0.2);
    color: #333;
    transform: translateX(5px);
}

.sidebar-file i {
    margin-right: 8px;
    width: 16px;
    color: #fff383;
}

.sidebar-subfolder-list {
    margin-top: 8px;
    padding-left: 10px;
    display: none;
}

.sidebar-subfolder-item {
    margin: 5px 0;
    padding: 8px 12px;
    background-color: rgba(255, 243, 129, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    transition: all 0.2s ease;
}

.sidebar-subfolder-item:hover {
    background-color: rgba(255, 243, 129, 0.2);
    transform: translateX(3px);
}

.sidebar-subfolder-item .sidebar-file-list {
    margin-top: 5px;
    padding-left: 10px;
}

.burger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1200;
    transition: left 0.3s cubic-bezier(.4,2,.6,1);
}

.burger-menu:hover {
    background-color: #fff381;
}

.burger-menu.active {
    left: 320px;
    background-color: #fff381;
}

.burger-icon {
    position: relative;
    width: 20px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

.burger-icon::before,
.burger-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

.burger-icon::before {
    transform: translateY(-6px);
}

.burger-icon::after {
    transform: translateY(6px);
}

.burger-menu.active .burger-icon {
    background-color: transparent;
}

.burger-menu.active .burger-icon::before {
    transform: rotate(45deg);
}

.burger-menu.active .burger-icon::after {
    transform: rotate(-45deg);
}

/* Overlay when sidebar is open */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: none;
}

/* Quick Links Bar */
.quick-links-bar {
    display: flex;
    justify-content: center;
    padding: 5px 0 5px 0;
    background: white;
    margin-bottom: 30px;
    border-radius: 10px;
    position: sticky;
    top: 25px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-25px);
}

.quick-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    margin: 0 10px;
    background-color: #fff383;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: none;
}

.quick-link:hover {
    transform: translateY(-2px);
    background-color: #fff381;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.quick-link i {
    margin-right: 8px;
    color: #ffc400;
}

/* Adjust container for sidebar */
.container.sidebar-active {
    margin-left: 320px !important;
}