
:root { 
    --primary: #333; 
    --text-main: #202124;
    --text-light: #70757a;
    --accent: #006621;
    --border: #dfe1e5;
    --bg-soft: #f8f9fa;
    --gold: #dbb372;
}

body { 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    background: #fff; 
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
    padding: 0 20px;
    box-sizing: border-box;
    transition: padding 0.5s ease;
}

body.landing-state {
    justify-content: center;
    padding-bottom: 15vh; 
}

body.active-state {
    justify-content: flex-start;
    padding-top: 20px;
}

.logo-container {
    margin-bottom: 35px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    opacity: 1;
}

.logo-container img {
    height: 75px; 
    width: auto;
    display: block;
}

body.active-state .logo-container {
    margin-bottom: 15px;
}
body.active-state .logo-container img {
    height: 36px;
}

.search-container { 
    position: relative;
    width: 100%; 
    max-width: 650px; 
    z-index: 1000;
    transition: margin 0.5s ease;
}

body.landing-state .search-container {
    margin-bottom: 0;
}

body.active-state .search-container {
    position: sticky;
    top: 20px;
    margin-bottom: 40px;
}

#searchBox { 
    width: 100%; 
    padding: 14px 24px; 
    font-size: 16px; 
    border: 1px solid var(--border); 
    border-radius: 30px; 
    outline: none; 
    box-sizing: border-box; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#searchBox:focus { 
    box-shadow: 0 4px 12px rgba(32,33,36,0.15); 
    border-color: transparent;
}

#autocomplete-box { 
    position: absolute; 
    top: 55px; 
    left: 0; 
    right: 0; 
    background: white; 
    border-radius: 16px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); 
    display: none; 
    overflow: hidden; 
    animation: slideDown 0.2s ease-out;
}

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

.suggestion-item { 
    padding: 12px 20px; 
    cursor: pointer; 
    font-size: 15px; 
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.2s;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item.active { background-color: var(--bg-soft); }
.author-suggestion { color: var(--gold); font-weight: 500; background: #fffcf5; }
.video-suggestion { color: #1a73e8; font-weight: 500; background: #f4f8fe; }

#results-area { width: 100%; max-width: 750px; }

.stats { 
    font-size: 13px; 
    color: var(--text-light); 
    margin-bottom: 25px; 
    letter-spacing: 0.5px;
}

.result-card { 
    margin-bottom: 35px; 
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.video-icon { 
    background-image: url('/img/play.png'); 
    background-repeat: no-repeat; 
    background-size: contain; 
    display: inline-block; 
    width: 16px; 
    height: 16px; 
    margin-right: 6px; 
    vertical-align: middle; 
}

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

.result-card h3 { 
    display: inline-block;
    margin: 4px 0; 
    color: var(--primary); 
    font-size: 26px; 
    font-family: "Domine", serif;
    font-weight: 700; 
    cursor: pointer; 
    line-height: 1.3;
}

.result-card h3:hover { 
    color: #2882d1;
}

.meta { 
    font-size: 13px; 
    color: var(--text-light); 
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    overflow: hidden; 
    max-width: 100%;
}

.meta b { color: var(--text-main); font-weight: 600; white-space: nowrap; }
.meta .divider { color: #ccc; margin: 0 10px; shrink: 0; }
.meta .date-span { white-space: nowrap; shrink: 0; }

.section-list { 
    display: inline-flex; 
    gap: 5px; 
    margin-left: 15px; 
    overflow-x: auto;            
    white-space: nowrap;         
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; 
}

.section-list::-webkit-scrollbar { display: none; }
.section-list { -ms-overflow-style: none; scrollbar-width: none; }

.badge { 
    display: inline-block;
    font-size: 10px; 
    background: var(--bg-soft); 
    color: var(--text-light); 
    padding: 2px 8px; 
    border-radius: 4px; 
    border: 1px solid var(--border);
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;         
    transition: all 0.2s;
}
.badge:hover { background: #eee; color: #2882d1; cursor: pointer; }

.active-filter-banner {
    background: #fffcf5;
    border: 1px solid var(--gold);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.clear-filter-btn { color: #d93025; cursor: pointer; font-weight: bold; text-decoration: none; }

.result-card p { 
    margin: 0; 
    font-size: 15px; 
    color: #686e74;
    max-width: 680px;
}

mark { background: rgba(219, 179, 114, 0.2); color: #856404; padding: 0 2px; border-radius: 2px; font-weight: 600; }

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    margin-bottom: 10px;
}
.skeleton-title { height: 28px; width: 80%; }
.skeleton-text { height: 14px; width: 100%; }

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pagination { display: flex; gap: 15px; margin: 40px 0 120px 0; }
.page-btn { 
    padding: 10px 20px; 
    border: 1px solid var(--border); 
    background: white; 
    border-radius: 20px; 
    cursor: pointer; 
    font-size: 14px; 
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--text-light); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-back-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text-light);
    cursor: pointer;
    z-index: 2000;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}
.page-back-btn:hover {
    color: var(--primary);
}
.search-masthead {
    max-width: 450px;
    margin-top: 40px;
    border-radius: 5px;
    transition: 0.3s ease-in-out;
}
@media only screen and (max-width: 490px) {
    .search-masthead {
        max-width: 100%;
    }
}