/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Hide/Show Header on Scroll */
header {
    position: fixed;
    top: 0;
    left: 0;
    right:   0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

header.header-hidden {
    transform: translateY(-100%);
}



body {

    
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color:   #f8f8f8;
}

a {
    color: #0066cc;
    text-decoration:   none;
}

a: hover {
    text-decoration:  underline;
}

/* Header Styles */
header {
    background-color: #2a3f5f;
    color: white;
    padding: 0. 5rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin:   0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight:   700;
}

.logo a {
    color: white;
    text-decoration: none;
}

.logo {
    display: flex;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 5px;
    transition: all 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: #a7d7ff;
    border-bottom: 2px solid #a7d7ff;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background-color: transparent;

    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i:last-child {
    transform: rotate(180deg);
}

.dropdown-menu {
    position:  absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow:   0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top:  -10px;
    right: 20px;
    border-left:  10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom:  10px solid white;
}

.dropdown-search {
    display: flex;
    margin-bottom: 15px;
}

.dropdown-search input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius:   4px 0 0 4px;
    font-size: 0.95rem;
    outline: none;
}

.dropdown-search input:focus {
    border-color: #0066cc;
}

.dropdown-search button {
    background-color: #2a3f5f;
    color: white;
    border:   none;
    padding: 10px 14px;
    border-radius:   0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dropdown-search button:hover {
    background-color: #1c2d45;
}

/* Fix dropdown menu positioning on larger screens */
@media (min-width: 769px) {
    .dropdown-menu {
        right: auto;
        left: 0;
    }
    
    . dropdown-menu::before {
        right: auto;
        left:  20px;
    }
}

/* Search Results Styles */
.search-results {
    display: none;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    max-height: 350px;
    overflow-y:   auto;
}

.results-header {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom:  1px solid #eee;
}

.results-header strong {
    color: #333;
}

.results-list {
    list-style: none;
}

.results-list li {
    margin-bottom: 2px;
}

.results-list li a {
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.results-list li a:hover {
    background-color: #f0f7ff;
    text-decoration: none;
}

. result-id {
    display: inline-block;
    background-color: #2a3f5f;
    color: white;
    padding:   2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right:  8px;
    font-weight: 600;
}

.result-title {
    color: #0066cc;
    font-size: 0.9rem;
}

.result-title mark {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.result-section {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 3px;
    margin-left: 36px;
}

.no-results {
    padding: 10px;
    text-align:   center;
    color: #666;
}

. no-results p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

. no-results . suggestion {
    font-size: 0.8rem;
    color: #888;
}

. more-results {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    padding-top: 8px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

. dropdown-section {
    margin-bottom: 15px;
}

.dropdown-section: last-child {
    margin-bottom: 0;
}

.dropdown-section h4 {
    color: #2a3f5f;
    margin-bottom: 8px;
    font-size:   0.95rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.dropdown-section ul {
    list-style: none;
}

.dropdown-section ul li {
    margin-bottom: 6px;
}

.dropdown-section ul li a {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 4px 0;
}

.dropdown-section ul li a:hover {
    text-decoration: underline;
}

/* Container Layout */
.container {
    max-width: 1200px;
    margin: 0px auto;
    padding: 0 20px;
}

/* Main Content Styles */
.content {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.content h1 {
    color: #2a3f5f;
    font-size: 2rem;
    margin-bottom:  20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.content h2 {
    color: #2a3f5f;
    font-size: 1.6rem;
    margin:   30px 0 15px;
    padding-bottom: 8px;
    border-bottom:   1px solid #eee;
}

.content h3 {
    color: #2a3f5f;
    font-size: 1.3rem;
    margin:   25px 0 15px;
}

.content p {
    margin-bottom: 15px;
    font-size: 1rem;
}

.intro-box {
    background-color: #f0f7ff;
    border-left: 4px solid #0066cc;
    padding: 20px;
    margin-bottom:   30px;
    border-radius:  0 8px 8px 0;
}

.intro-box p: last-child {
    margin-bottom: 0;
}

/* Chapter List Styles */
.chapter-section {
    margin-bottom: 30px;
}

.chapter-section h3 {
    color: #2a3f5f;
    font-size: 1.2rem;
    margin-bottom:  10px;
    background-color: #f0f7ff;
    padding:   8px 15px;
    border-radius:  4px;
}

.chapter-section ul {
    list-style: none;
    margin-left: 15px;
}

.chapter-section ul li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

. chapter-section ul li:before {
    content:   "•";
    color: #0066cc;
    position: absolute;
    left:   0;
}

.chapter-section ul li a {
    color: #0066cc;
    text-decoration: none;
    font-size: 1rem;
}

.chapter-section ul li a:hover {
    text-decoration: underline;
}

/* Chapter Content Styles */
.chapter-content {
    line-height: 1.7;
}

.chapter-content p {
    margin-bottom: 20px;
}

.chapter-content ul, .chapter-content ol {
    margin-bottom: 20px;
    margin-left: 30px;
}

.chapter-content li {
    margin-bottom: 8px;
}

.chapter-content h2 {
    margin-top: 40px;
}

.chapter-content h3 {
    margin-top: 30px;
}

.artwork-example {
    margin:   30px 0;
    text-align: center;
}

.artwork-example img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.artwork-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

. definition-box {
    background-color: #f9f9f9;
    border-left: 4px solid #2a3f5f;
    padding: 15px;
    margin:   20px 0;
    border-radius: 0 8px 8px 0;
}

.definition-box h4 {
    color:   #2a3f5f;
    margin-bottom: 8px;
}

.note-box {
    background-color: #fff8e6;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin:  20px 0;
    border-radius: 0 8px 8px 0;
}

.note-box h4 {
    color:  #856404;
    margin-bottom:   8px;
}

/* Navigation Controls */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.prev-chapter, .next-chapter {
    padding: 10px 20px;
    background-color: #2a3f5f;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    display: inline-block;
}

.prev-chapter:hover, .next-chapter:hover {
    background-color:  #1c2d45;
    text-decoration: none;
}

.chapter-number {
    font-size: 0.9rem;
    display: block;
    color: #a7d7ff;
}

/* Footer Styles */
footer {
    background-color: #2a3f5f;
    color:  white;
    text-align:  center;
    padding: 20px;
    margin-top:  40px;
}

. footer-content p {
    margin-bottom: 8px;
}

.footer-content a {
    color: #a7d7ff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* Center logo/title on mobile */
    .logo {
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    
    .header-container {
        flex-direction: column;
        padding: 10px;
    }
    
    nav {
        margin-top: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    nav ul {
        margin-bottom: 10px;
    }
    
    nav ul li {
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .dropdown-menu {
        right: -50px;
        min-width: 280px;
    }
    
    .dropdown-menu::before {
        right: 70px;
    }
}

/* Glossary letter navigation grid */
.glossary-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    list-style: none;
    padding: 0;
}

.glossary-nav li {
    text-align: center;
}

.glossary-nav li a {
    display: block;
    padding: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.glossary-nav li a:hover {
    background-color: #2a3f5f;
    color: white;
    text-decoration: none;
}

@media (max-width: 600px) {
    .content {
        padding: 20px;
    }
    
    . chapter-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .prev-chapter, .next-chapter {
        text-align: center;
    }
    
    .glossary-nav {
        grid-template-columns: repeat(3, 1fr);
    }
}
