:root {
    /* Color Palette */
    --bg-main: #0B0F19;
    --bg-secondary: #141C2F;
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --accent-primary: #3B82F6;
    --accent-secondary: #8B5CF6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    /* Glassmorphism */
    --glass-bg: rgba(20, 28, 47, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Other */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Shapes */
.bg-shape {
    position: absolute;
    filter: blur(120px);
    z-index: -1;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}
.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.15);
    top: -100px;
    left: -100px;
}
.shape-2 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.app-container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    gap: 32px;
    min-height: 100vh;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Sidebar */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 48px);
    position: sticky;
    top: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-area i {
    font-size: 32px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.filter-section {
    flex: 1;
}

.filter-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.year-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.4);
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background: var(--accent-gradient);
    border-color: transparent;
}
input:checked + .slider:before {
    transform: translateX(24px);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Hero / Header */
.hero-header {
    border-radius: var(--radius-lg);
    padding: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-text p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Search Bar */
.search-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 32px;
}
.search-bar {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 8px;
    align-items: center;
    transition: var(--transition);
}
.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.search-icon {
    font-size: 24px;
    color: var(--text-secondary);
    margin: 0 16px;
}
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px 0;
    font-size: 18px;
}
.search-bar input:focus {
    box-shadow: none;
    background: transparent;
}
.search-bar .btn-primary {
    width: auto;
    padding: 16px 32px;
    border-radius: var(--radius-md);
}

/* Category Buttons */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.cat-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 30px;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}
.cat-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Results Section */
.results-section {
    flex: 1;
}
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.results-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
}
.badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Results List (APA Format) */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* List Item */
.list-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    transition: var(--transition);
}
.list-item:hover {
    box-shadow: var(--glass-shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

.citation-content {
    flex: 1;
}

.citation-text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.citation-text strong {
    font-weight: 600;
}

.citation-text em {
    color: var(--text-secondary);
}

.item-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}
.item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
    flex-shrink: 0;
}

.btn-outline {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}
.btn-download {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-primary);
}
.btn-download:hover {
    background: var(--accent-primary);
    color: white;
}

/* Spinner */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 0;
    color: var(--text-secondary);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 48px;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
}
@media (max-width: 768px) {
    .hero-header {
        padding: 32px 16px;
    }
    .hero-text h1 {
        font-size: 32px;
    }
    .search-bar {
        flex-direction: column;
        border-radius: var(--radius-sm);
        padding: 16px;
        gap: 16px;
    }
    .search-bar input {
        width: 100%;
        padding: 8px 0;
    }
    .search-bar .btn-primary {
        width: 100%;
    }
}

/* Custom Enhancements */
.main-content {
    position: relative;
}

.top-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.theme-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.theme-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.lang-selector-top {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 700;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.15);
}

.rotating-text-container {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    max-width: 600px;
}

.rotating-text {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

.contact-email {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.contact-email:hover {
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.contact-email i {
    font-size: 14px;
}

/* Light Theme Variables & Overrides */
body.light-theme {
    --bg-main: #F3F4F6;
    --bg-secondary: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
}

body.light-theme input, body.light-theme select {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme input:focus, body.light-theme select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--accent-primary);
}

body.light-theme select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.light-theme .search-bar {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .search-bar input {
    background: transparent;
    color: var(--text-primary);
}

body.light-theme .cat-btn {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .cat-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

body.light-theme .cat-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

body.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .list-item {
    background: var(--glass-bg);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .list-item:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

body.light-theme .btn-outline {
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

body.light-theme .btn-outline:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .btn-download {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--accent-primary);
}

body.light-theme .btn-download:hover {
    background: var(--accent-primary);
    color: white;
}

body.light-theme .slider {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .badge {
    background: rgba(59, 130, 246, 0.1);
}

/* Grouped Select Custom Styling */
select optgroup {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-weight: 700;
    font-style: normal;
    padding: 6px;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500;
    padding: 4px;
}

body.light-theme select optgroup {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

body.light-theme select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
/* Sources Marquee Ticker Styling */
.sources-marquee-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 24px auto 24px auto;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

body.light-theme .sources-marquee-container {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.05);
}

.marquee-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.marquee-track-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
}

.marquee-track {
    display: flex;
    gap: 24px;
    width: max-content;
    animation: scroll 60s linear infinite;
}

.marquee-track span {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.65;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

body.light-theme .marquee-track span {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

.marquee-track span:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    opacity: 1;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}





