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

:root {
    --hornstein-red: #C51D24;
    --hornstein-dark-red: #A1181E;
    --hornstein-dark: #333333;
    --hornstein-light-gray: #F5F5F5;
    --text-color: #222222;
    --bg-color: #FAFAFA;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: white;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--hornstein-red);
}

.nav-actions {
    display: flex;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.2s;
}

.icon-btn:hover {
    background-color: var(--hornstein-light-gray);
    transform: scale(1.05);
}

/* Search Dropdown Overlay */
.search-overlay {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 999;
}

.search-overlay.active {
    transform: translateY(0);
    opacity: 1;
}

.search-bar-container {
    display: flex;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
    border-bottom: 2px solid #EEE;
    position: relative;
}

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

.search-input-wrapper input {
    width: 100%;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    padding: 0.5rem 3rem 0.5rem 0.5rem;
    outline: none;
    background: transparent;
}

.search-input-wrapper button {
    position: absolute;
    right: 10px;
}

.close-btn {
    margin-left: 20px;
}

.search-suggestions {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 1.1rem;
    color: #444;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: var(--hornstein-light-gray);
    color: var(--hornstein-red);
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Hero Section */
.hero-section {
    height: calc(100vh - 80px);
    background-image: url('hornstein-hero.jpeg');
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-image-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
}

.hidden {
    display: none !important;
}

/* Results View */
.search-results-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease forwards;
}

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

.results-header {
    background: white;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-color);
}

.back-btn:hover {
    color: var(--hornstein-red);
}

.results-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: fit-content;
}

.filter-search-box {
    display: flex;
    align-items: center;
    border: 1px solid #DDD;
    border-radius: 20px;
    padding: 4px 12px;
    margin-bottom: 1.5rem;
}

.filter-search-box input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px;
    font-size: 1rem;
}

.filter-search-box button {
    background: none;
    border: none;
    cursor: pointer;
}

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

.filter-list li {
    padding: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    border-radius: 6px;
}

.filter-list li:hover {
    background: var(--hornstein-light-gray);
}

.filter-list li.active {
    font-weight: 700;
    color: var(--text-color);
}

/* AI Answer Box */
.ai-result-container {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(197, 29, 36, 0.08);
    border-top: 4px solid var(--hornstein-red);
}

.ai-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.ai-badge {
    background: var(--hornstein-red);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
}

.ai-powered-by {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.ai-result-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.ai-result-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.ai-result-content th, .ai-result-content td {
    padding: 12px;
    border: 1px solid #DDD;
    text-align: left;
}

.ai-result-content th {
    background: var(--hornstein-light-gray);
}

.citation-link {
    color: var(--hornstein-red);
    font-weight: bold;
    text-decoration: none;
    font-size: 0.8em;
    vertical-align: super;
}

.ai-references {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #EEE;
}

.reference-item {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.reference-item a {
    color: var(--hornstein-red);
    text-decoration: none;
    font-weight: 600;
}

.reference-item a:hover {
    text-decoration: underline;
}

.ai-related-questions {
    margin-top: 2rem;
}

.related-question-btn {
    display: inline-block;
    background: #F0F4F8;
    color: #1A73E8;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s;
}

.related-question-btn:hover {
    background: #E1E9F4;
}

/* Spinner Loader */
.ai-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--hornstein-light-gray);
    border-top: 4px solid var(--hornstein-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .results-layout {
        grid-template-columns: 1fr;
    }
}
