@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;700&display=swap');

:root {
    --bg-color: #262626;
    --text-color: #ffffff;
    --border-color: #616162;
    --hover-color: rgb(187, 150, 114);
}

:root.light-mode {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #d0d0d0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: Arial, sans-serif;
}

body {
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    height: 60px;
    justify-content: space-between;
    transition: background-color 0.3s ease;
}

.logo-container, .search-container, .theme-toggle-container {
    display: flex;
    align-items: center;
}

.logo-container {
    flex: 0 0 auto;
    margin-right: 1rem;
}

.search-container {
    flex: 2;
    justify-content: center;
    margin-right: 100px;
}

.theme-toggle-container {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: 1rem;
    width: auto; /* Allow the container to size to its content */
    max-width: 24px; /* Limit the maximum width to the size of the toggle button */
}

.logo {
    font-size: 1.5rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
    white-space: nowrap;
}

.logo:hover {
    color: var(--hover-color);
}

#search-input {
    width: 100%;

    max-width: 600px;
    padding: 10px 40px 10px 15px;
    font-size: 16px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#search-input:focus {
    border-bottom-color: var(--hover-color);
}

#search-button {
    position: absolute;
    right: 10px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    padding: 5px;
    outline: none;
    transition: color 0.3s ease;
}

#search-button:hover {
    color: var(--hover-color);
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

#theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-color);
    position: absolute;
    transition: opacity 0.3s ease, stroke 0.3s ease;
}

#theme-toggle .sun-icon {
    opacity: 1;
}

#theme-toggle .moon-icon {
    opacity: 0;
}

:root.light-mode #theme-toggle .sun-icon {
    opacity: 0;
}

:root.light-mode #theme-toggle .moon-icon {
    opacity: 1;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    margin-top: 50px;
    background-color: var(--bg-color);
    padding: 1rem;
    height: 100%;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    position: fixed;
    z-index: 999;
    top: 70px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-item {
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.sidebar-title {
    font-size: 19px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-color);
    width: 100%;
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 5px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: flex-start;
    position: relative;
}

.sidebar-title:hover {
    color: var(--hover-color);
}

.toggle {
    font-size: 16px;
    color: var(--text-color);
    font-weight: 300;
    margin-left: 5px;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.sidebar-content {
    display: none;
    padding-left: 20px;
    margin-top: 5px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.sidebar-content a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    font-size: 17px;
    font-weight: 400;
    margin-top: 10px;
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 3px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-content a:hover,
.sidebar-link.active {
    color: var(--hover-color);
}

.sidebar-item.expanded .sidebar-content {
    display: block;
}

.additional-links {
    margin-top: 20px;
}

.sidebar-separator {
    margin: 20px auto;
    width: 80%;
    height: 1px;
    background-color: var(--border-color);
    opacity: 0.5;
    transition: background-color 0.3s ease;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: calc(100% - 250px);
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-y: auto;
}

.content-wrapper {
    height: auto;
    max-height: none;
    overflow: visible;
}

.tab-content {
    background-color: var(--bg-color);
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-bottom: 0;
    font-family: 'Work Sans', sans-serif;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tab-content:last-child {
    border-bottom: none;
}

.tab-content-left {
    width: 25%;
    padding-right: 20px;
    flex-shrink: 0;
}

.tab-content h2 {
    font-size: 23px;
    font-weight: 400;
    color: var(--hover-color);
    margin: 0 0 15px 0;
    transition: color 0.3s ease;
}

.grade, .source {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.source a {
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.source a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--hover-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.source a:hover {
    color: var(--hover-color);
}

.source a:hover::after {
    transform: scaleX(1);
}

.source a, .source a:link, .source a:visited {
    text-decoration: none !important;
    border-bottom: none !important;
}
.grade-value {
    font-weight: 400;
}

.tab-content-body {
    flex-grow: 1;
}

.tab-content p {
    width: 80%;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.tab-content a {
    color: var(--hover-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tab-content a:hover {
    text-decoration: underline;
}

.welcome-section {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    color: var(--text-color);
    flex: 1;
    min-width: 300px; /* Minimum width before wrapping */
    max-width: none; /* Maximum width on larger screens */
    padding: 20px;
    margin-left: 300px;
    scrollbar-width: none;
    overflow-y: visible;
}

.welcome-section::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.welcome-section h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.welcome-section h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.welcome-section p, .welcome-section ul {
    font-size: 18px;
    line-height: 1.6;
}

.welcome-section ul {
    padding-left: 20px;
}

.welcome-section a {
    color: var(--hover-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.welcome-section a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--hover-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.welcome-section a:hover::after {
    transform: scaleX(1);
}

.mobile-menu, #mobileSourcesDropdown, #mobileMoreDropdown {
    display: none;
}

@media (max-width: 1024px) {

    #mobileSourcesDropdown, #mobileMoreDropdown {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    * {
        transition: none !important;
        box-sizing: border-box;
    }

    html, body {
        width: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .main-container {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .content-wrapper, .content-container {
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        height: auto;
    }

    .welcome-section {
        max-height: none;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: visible;
        flex: 1;
        margin-left: 0;
        padding-top: 80px; /* Adjust based on your header height */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        height: auto;
        min-height: calc(100vh - 60px);
    }

    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }

    .header-spacer {
        height: 80px; /* Adjust this to match your header height */
        width: 100%;
    }

    #mobileSourcesDropdown .sidebar-title,
    #mobileSourcesDropdown .sidebar-link,
    #mobileMoreDropdown .sidebar-link {
        font-family: 'Work Sans', sans-serif;
        font-size: 17px; /* Adjust this value to match the 'About' section font size */
        padding: 10px 15px;
        display: block;
        color: var(--text-color);
        text-decoration: none;
    }

    #mobileSourcesDropdown .sidebar-link.active,
    #mobileMoreDropdown .sidebar-link.active {
        color: var(--hover-color);
    }

    /* Ensure the active link is visible when its parent is expanded */
    #mobileSourcesDropdown .sidebar-item.expanded .sidebar-content,
    #mobileMoreDropdown .sidebar-item.expanded .sidebar-content {
        display: block;
    }

    #mobileSourcesDropdown .sidebar-title {
        font-weight: 400; /* Make this the same as the links */
    }

    /* Ensure consistency for all mobile dropdown items */
    .mobile-dropdown .sidebar-item,
    .mobile-dropdown .sidebar-content,
    .mobile-dropdown .sidebar-link,
    .mobile-dropdown .additional-links a {
        font-family: 'Work Sans', sans-serif;
        font-weight: 400;
        font-size: 17px;
    }

    .logo-container {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 10px;
    }

    .logo {
        margin-right: 0;

    }

    .mobile-menu {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin-top: 10px;
    }

    .mobile-menu-button {
        background-color: transparent;
        color: var(--text-color);
        border: none;
        padding: 5px 10px;
        font-size: 14px;
        cursor: pointer;
        margin: -8px 5px 0 0;
    }

    .mobile-menu-button.active {
        background-color: var(--hover-color);
    }

    .theme-toggle-container {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .search-container {
        width: 90%;
        max-width: 400px;
        position: relative;
        order: 1;
        margin-right: 20px;
    }

    #search-input {
        width: 100%;
        max-width: none;
        padding: 10px 40px 10px 15px;
    }

    #search-button {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
    }

    #mobileSourcesDropdown, #mobileMoreDropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        border-top: 1px solid var(--border-color);
        z-index: 1001;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    #mobileSourcesDropdown.show, #mobileMoreDropdown.show {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
        overflow-y: hidden;
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .tab-content {
        flex-direction: column;
        padding: 20px 10px;
        margin: 0 0 10px;
        box-sizing: border-box;
        width: 100%;
        overflow: visible;
    }

    .tab-content-left, .tab-content-body, .tab-content h2, .grade, .source, .tab-content p {
        width: 100%;
    }

    .tab-content h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .welcome-section {
        max-height: none;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        flex: 1;
        overflow-y: visible; /* Change from auto to visible */
    }

    .welcome-section h1 {
        font-size: 28px;
    }

    .welcome-section h2 {
        font-size: 22px;
    }

    .welcome-section p, .welcome-section ul {
        font-size: 16px;
    }

    .sidebar-item, .sidebar-content, .sidebar-link, .additional-links {
        width: 100%;
        box-sizing: border-box;
    }

    .sidebar-title, .sidebar-link, .additional-links a {
        padding: 10px 15px;
        display: block;
        color: var(--text-color);
        text-decoration: none;
        font-family: 'Work Sans', sans-serif;
    }

    .sidebar-title {
        font-weight: bold;
        cursor: pointer;
    }

    .sidebar-content {
        display: none;
        padding-left: 20px;
    }

    .sidebar-item.expanded .sidebar-content {
        display: block;
    }

    .toggle {
        float: right;
    }

    #mobileSourcesDropdown .sidebar-content,
    #mobileMoreDropdown .sidebar-content {
        font-family: 'Work Sans', sans-serif;
    }
    .index-page .main-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 80px; /* Adjust based on your header height */
    }

    .index-page .sidebar {
        display: block;
        width: 90%;
        max-width: 400px;
        position: static;
        height: auto;
        border-radius: 10px;
    }

    .index-page .main-content {
        width: 100%;
        margin-left: 0;
    }

    .index-page .sidebar-item {
        margin-bottom: 15px;
    }

    .index-page .sidebar-title {
        font-size: 18px;
        font-weight: normal;
        padding: 10px;
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .index-page .sidebar-content {
        padding-left: 15px;
    }

    .index-page .sidebar-content a {
        padding: 8px 0;
        font-size: 16px;
    }

    .index-page .additional-links {
        margin-top: 15px;
    }

    .index-page .additional-links a {
        display: inline-block;
        margin-right: 10px;
        margin-bottom: 10px;
        padding: 5px 10px;
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
    }

}


@media (max-width: 1024px) {
    header {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem;
        justify-content: center;
    }
}

@media (min-width: 1025px) {
    .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

.sidebar-link,
.additional-links a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    font-size: 17px;
    font-weight: 400;
    padding: 5px 10px;
    margin-top: 10px;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link:hover,
.additional-links a:hover {
    color: var(--hover-color);
}

.additional-links {
    margin-top: 20px;
}

.sidebar-separator {
    margin: 20px auto;
    width: 80%;
    height: 1px;
    background-color: var(--border-color);
    opacity: 0.5;
}


