:root {
    --primary-dark: #0f172a;
    --accent-gold: #c5a880;
    --bg-canvas: #f8fafc;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --ad-bg: #f1f5f9;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Header Base Layout */
.oxford-header {
    background-color: var(--primary-dark);
    color: white;
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.site-tagline {
    font-size: 0.85rem;
    color: var(--accent-gold);
    margin: 2px 0 0 0;
}

/* Toggle Menu Bars Structure & Animation States */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 18px;
    width: 24px;
    padding: 0;
    z-index: 110;
}

.menu-toggle .bar {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Transforms 3 lines into an "X" when open */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Screen Dimming Background Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Side Navigation Window Frame */
.side-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: var(--primary-dark);
    box-shadow: -5px 0 15px rgba(0,0,0,0.25);
    z-index: 100;
    transition: right 0.3s ease;
    padding-top: 5rem;
}

.side-nav.open {
    right: 0;
}

.side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-nav ul li a {
    display: block;
    color: white;
    padding: 1.2rem 2rem;
    text-decoration: none;
    font-size: 1.05rem;
    border-bottom: 1px solid #1e293b;
}

/* Brand New Eye-Catching Bordered Search Container Layout */
.search-container-box {
    padding: 0 1.2rem 1.2rem 1.2rem;
    position: relative;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background-color: white;
    border: 2.5px solid var(--accent-gold); /* Noticeable solid gold border all sides */
    border-radius: 6px;
    overflow: hidden;
}

.search-wrapper #searchBar {
    width: 100%;
    border: none;
    padding: 0.9rem 3.5rem 0.9rem 1rem; /* Space on right avoids text overlap with icon */
    font-size: 1.1rem;
    outline: none;
    color: var(--text-primary);
}

.search-icon-holder {
    position: absolute;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    pointer-events: none;
}

.search-icon-holder svg {
    width: 20px;
    height: 20px;
}

/* Content Elements & Layout Configurations */
.main-layout {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.word-entry {
    background: white;
    padding: 1.5rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.entry-header {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    border-bottom: 2px solid var(--primary-dark);
    padding-bottom: 0.5rem;
    margin-bottom: 1.2rem;
}

.headword {
    font-size: 2.2rem;
    margin: 0;
    color: var(--primary-dark);
    font-weight: 700;
}

.pos {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
}

.definitions-list {
    margin: 0;
    padding-left: 1.2rem;
}

.definitions-list li {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-left: 0.2rem;
}

.definition-text {
    display: block;
    margin-bottom: 0.6rem;
    color: #000000;
}

.example-item {
    color: #475569;
    border-left: 3px solid var(--accent-gold);
    padding-left: 0.8rem;
    font-style: italic;
    font-size: 1rem;
}

.ad-placeholder {
    background-color: var(--ad-bg);
    border: 1px dashed #cbd5e1;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.8rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.banner-ad {
    height: 90px;
}

/* Modern Vector Social Buttons Formatting */
.oxford-footer {
    text-align: center;
    padding: 3rem 1rem 2rem 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: 3rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--primary-dark);
    background-color: white;
    border: 1.5px solid var(--border-light);
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-icon-btn:hover, .social-icon-btn:active {
    color: white;
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: scale(1.05);
}

.social-icon-btn svg {
    width: 20px;
    height: 20px;
}

.footer-credit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Dynamic Quiz Framework & Alphabet Spacings */
.section-title-badge {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.section-redirect-link {
    display: inline-block;
    margin-top: 1rem;
    color: #1e293b; /* Set directly to match premium ink */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.section-intro-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

/* Grid Formats matching .word-entry sizes seamlessly */
.alphabet-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.alphabet-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.alphabet-row span {
    flex: 1;
    text-align: center;
    background-color: var(--bg-canvas);
    border: 1px solid var(--border-light);
    padding: 10px 0;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    margin: 0 3px;
    cursor: pointer;
    color: var(--text-primary);
}

.alphabet-row span:active {
    background-color: var(--primary-dark);
    color: white;
}

.grid-divider {
    border: 0;
    height: 1px;
    background: var(--border-light);
    margin: 6px 0;
}

/* Quiz Interface Layouts */
.quiz-card {
    background: transparent;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: bold;
    margin-bottom: 0.8rem;
}

.quiz-question {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    white-space: pre-line; /* Allows linebreaks inside strings to render smoothly */
}

.quiz-options-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-opt-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background-color: var(--bg-canvas);
    border: 1.5px solid var(--border-light);
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.quiz-opt-btn.correct-flash {
    background-color: #dcfce7 !important;
    border-color: #22c55e !important;
    color: #15803d !important;
    font-weight: bold;
}

.quiz-opt-btn.wrong-flash {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
}

.quiz-action-footer {
    margin-top: 1.2rem;
    text-align: right;
}

.quiz-next-btn {
    background-color: var(--primary-dark);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

/* Letter List View Layout Upgrades */
.entry-letter-title {
    font-size: 2.2rem !important;
    color: var(--primary-dark) !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--primary-dark);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem !important;
}

.letter-words-list-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.letter-word-row-item {
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    background-color: var(--bg-canvas);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.letter-word-row-item:hover, .letter-word-row-item:active {
    background-color: #f1f5f9;
    border-color: var(--accent-gold);
    padding-left: 22px;
}

/* Search Dropdown Panel Alignment Logic Fixes */
.search-dropdown-list {
    position: absolute;
    width: calc(100% - 2.4rem);
    left: 1.2rem;
    top: 100%;
    background: white;
    border: 2px solid var(--accent-gold);
    border-top: none;
    z-index: 999;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-row-item {
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    color: var(--primary-dark);
    text-align: left;
    font-size: 1.05rem;
    transition: background 0.2s ease;
}

.dropdown-row-item:hover, .dropdown-row-item:active {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.dropdown-row-item:last-child {
    border-bottom: none;
}
