/* ========================================
   GALILEO TV BRANDING - VARIABLES
   ======================================== */
:root {
    /* Primärfarben - Joyn Galileo Branding */
    --galileo-blue: #00D9FF;
    --galileo-dark-blue: #001F3F;
    --galileo-orange: #FF8800;
    --galileo-light-blue: #3399FF;
    --galileo-gold: #FFB800;

    /* Hintergrund - Joyn Style (DUNKLER) */
    --bg-primary: #0B0E11;
    --bg-secondary: #141619;
    --bg-tertiary: #1A1D21;
    --bg-gradient-dark: linear-gradient(180deg, #0B0E11 0%, #000000 100%);

    /* Cards & UI */
    --card-bg: rgba(20, 22, 25, 0.95);
    --card-hover: rgba(25, 28, 32, 1);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #B8C5D6;
    --text-muted: #808080;

    /* Ampel-System */
    --source-green: #00C853;
    --source-yellow: #FFB300;
    --source-red: #FF3D00;

    /* Effects */
    --glow-blue: 0 0 24px rgba(0, 128, 255, 0.4);
    --glow-blue-strong: 0 0 32px rgba(0, 128, 255, 0.6);
    --glow-orange: 0 0 20px rgba(255, 136, 0, 0.3);
    --glow-gold: 0 0 16px rgba(255, 184, 0, 0.4);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 24px rgba(0, 128, 255, 0.4);
}

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

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

.hidden {
    display: none !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   LOGIN SCREEN - REDESIGNED
   ======================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--galileo-dark-blue) 0%, var(--galileo-blue) 50%, var(--galileo-light-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease;
    overflow: hidden;
}

.login-overlay::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particleMove 60s linear infinite;
}

@keyframes particleMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-container {
    background: rgba(30, 35, 45, 0.98);
    backdrop-filter: blur(20px);
    padding: 4rem 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 217, 255, 0.3);
    max-width: 480px;
    width: 90%;
    animation: slideUp 0.6s ease, pulseGlow 3s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 217, 255, 0.3); }
    50% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 217, 255, 0.5); }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    background: linear-gradient(135deg, #00D9FF, #0066CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(20, 25, 35, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--galileo-blue);
    box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.1), 0 0 20px rgba(0, 217, 255, 0.4);
    background: rgba(10, 15, 25, 0.9);
}

.error-message {
    color: var(--source-red);
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ========================================
   BUTTONS - REDESIGNED
   ======================================== */
.btn-primary,
.btn-secondary,
.btn-text {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--galileo-blue), var(--galileo-dark-blue));
    color: white;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--galileo-orange);
}

/* ========================================
   HEADER - TV BRANDING (JOYN STYLE)
   ======================================== */
.header {
    background: rgba(11, 14, 17, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.logo-placeholder svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.header-text h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.3px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.last-update {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: transparent;
    padding: 0;
    font-weight: 400;
}

/* ========================================
   FILTERS SECTION (TAB STYLE)
   ======================================== */
.filters-section {
    background: transparent;
    padding: 0 0 2rem 0;
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    animation: fadeIn 0.7s ease;
}

.filters-section h2 {
    display: none;
}

.filter-info {
    display: none;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0;
}

.tag {
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    font-weight: 600;
    user-select: none;
    color: var(--text-secondary);
    position: relative;
}

/* Tag-Farbcodierung mit Icons */
.tag[data-type="Wissenschaft"],
.tag[data-type="Bildstark"] {
    border-color: var(--galileo-blue);
}

.tag[data-type="Gesellschaftlich Relevant"] {
    border-color: var(--source-green);
}

.tag[data-type="Gerade aktuell"],
.tag[data-type="Entertainment"] {
    border-color: var(--galileo-orange);
}

.tag[data-type="Technologie"] {
    border-color: #9C27B0;
}

.tag:hover {
    color: var(--text-primary);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.tag.active {
    background: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--galileo-blue);
    box-shadow: none;
    animation: none;
}

@keyframes subtlePulse {
    0%, 100% { transform: scale(1); box-shadow: var(--glow-blue-strong); }
    50% { transform: scale(1.03); box-shadow: var(--glow-blue-strong), 0 0 40px rgba(0, 128, 255, 0.5); }
}

.tag.dragging {
    opacity: 0.5;
}

.active-filters {
    display: none;
}

.active-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.no-filters {
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   TOPICS SECTION
   ======================================== */
.topics-section {
    animation: fadeIn 0.9s ease;
    padding-bottom: 4rem;
}

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

.topics-header {
    margin-bottom: 2rem;
}

.topics-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-controls label {
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-controls select {
    padding: 0.5rem 1rem;
    background: rgba(20, 22, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-controls select:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.5);
}

.topics-count {
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.topics-list {
    display: grid;
    gap: 3rem;
}

/* ========================================
   TOPIC CARDS - VIDEO THUMBNAIL STYLE
   ======================================== */
.topics-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.topic-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
    opacity: 0;
    animation: cardFadeIn 0.6s ease forwards;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

/* Stagger animation for multiple cards */
.topic-card:nth-child(1) { animation-delay: 0.1s; }
.topic-card:nth-child(2) { animation-delay: 0.2s; }
.topic-card:nth-child(3) { animation-delay: 0.3s; }
.topic-card:nth-child(4) { animation-delay: 0.4s; }
.topic-card:nth-child(5) { animation-delay: 0.5s; }
.topic-card:nth-child(6) { animation-delay: 0.6s; }
.topic-card:nth-child(7) { animation-delay: 0.7s; }
.topic-card:nth-child(8) { animation-delay: 0.8s; }
.topic-card:nth-child(9) { animation-delay: 0.9s; }
.topic-card:nth-child(10) { animation-delay: 1s; }

.topic-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 128, 255, 0.2);
    border-color: rgba(0, 217, 255, 0.3);
}

/* Card Link Wrapper */
.topic-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Thumbnail Area */
.topic-thumbnail {
    position: relative;
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.thumbnail-icon {
    font-size: 3rem;
    opacity: 0.5;
    filter: blur(0.5px);
    position: absolute;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Category Badge */
.topic-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 128, 255, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topic-content {
    padding: 1.25rem;
    padding-bottom: 3.5rem;
    position: relative;
    z-index: 2;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.topic-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.badge {
    padding: 0.375rem 0.875rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green {
    background: var(--source-green);
    color: white;
}

.badge-yellow {
    background: var(--source-yellow);
    color: var(--bg-primary);
}

.badge-red {
    background: var(--source-red);
    color: white;
}

.topic-tags {
    display: none;
}

.topic-tag {
    display: none;
}

.topic-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 1rem;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.visual-indicator {
    color: var(--galileo-gold);
    font-weight: 600;
}

.source-badge {
    color: var(--galileo-blue);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    display: inline-block;
}

.details-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 217, 255, 0.2);
    border: 1px solid var(--galileo-blue);
    color: var(--galileo-blue);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.details-btn:hover {
    background: rgba(0, 217, 255, 0.3);
    transform: scale(1.05);
}

.source-link {
    color: var(--galileo-blue);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.source-link:hover {
    background: rgba(0, 217, 255, 0.2);
    color: #00D9FF;
    transform: translateX(4px);
}

.visual-rating {
    display: none;
}

.visual-stars {
    display: none;
}

.duplicate-status {
    display: none;
}

.topic-actions {
    display: none;
}

.btn-outline {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-outline:hover {
    border-color: var(--galileo-blue);
    color: var(--galileo-blue);
    background: rgba(0, 102, 204, 0.05);
}

/* ========================================
   SOURCES SECTION (COLLAPSIBLE)
   ======================================== */
.sources-section {
    padding: 1.5rem 2rem 2rem 2.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

.sources-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.source-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.source-item:hover {
    border-color: var(--galileo-blue);
    transform: translateX(8px);
}

.source-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.source-icon {
    font-size: 1.2rem;
}

.source-name {
    font-weight: 600;
    color: var(--text-primary);
}

.source-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

.source-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.source-link {
    color: var(--galileo-blue);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.source-link:hover {
    color: var(--galileo-orange);
}

/* ========================================
   MODAL - REDESIGNED
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 1000px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow-blue);
}

.modal-header {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
    background: linear-gradient(135deg, var(--galileo-dark-blue), var(--galileo-blue));
}

.modal-header h2 {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-footer {
    padding: 1.5rem 2.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-primary);
}

/* ========================================
   LOADING & ANIMATIONS
   ======================================== */
.loading {
    text-align: center;
    padding: 4rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--galileo-blue);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ========================================
   SEARCH BAR SECTION - NEW
   ======================================== */
.search-section {
    padding: 2rem 0 2rem;
    animation: fadeIn 0.6s ease;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(20, 22, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 0.875rem 1.75rem;
    transition: all 0.3s ease;
    box-shadow: none;
}

.search-wrapper:focus-within {
    border-color: rgba(0, 217, 255, 0.5);
    background: rgba(20, 22, 25, 0.9);
}

.search-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.search-wrapper:focus-within .search-icon {
    color: var(--galileo-blue);
    filter: drop-shadow(var(--glow-blue));
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.search-clear:hover {
    background: rgba(255, 61, 0, 0.2);
    color: var(--source-red);
    transform: rotate(90deg);
}

.search-results-count {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem;
    background: rgba(0, 128, 255, 0.05);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.search-results-count span {
    color: var(--galileo-blue);
    font-weight: 700;
}

/* ========================================
   SEARCH LOADING STATES
   ======================================== */
.search-loading {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-primary);
    animation: fadeIn 0.4s ease;
}

.search-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 1rem;
    font-weight: 500;
}

.galileo-spinner {
    border: 4px solid rgba(0, 128, 255, 0.2);
    border-top: 4px solid var(--galileo-blue);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: var(--glow-blue);
}

.clear-search-inline-btn {
    background: var(--galileo-orange);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    margin-left: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 136, 0, 0.3);
}

.clear-search-inline-btn:hover {
    background: #FF6600;
    transform: scale(1.05);
    box-shadow: var(--glow-orange), 0 4px 12px rgba(255, 136, 0, 0.4);
}

.clear-search-inline-btn:active {
    transform: scale(0.98);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--galileo-blue);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Search Section Responsive */
    .search-section {
        padding: 2rem 0 1.5rem;
    }

    .search-wrapper {
        padding: 0.625rem 1.25rem;
    }

    .search-input {
        font-size: 1rem;
    }

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

    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-text h1 {
        font-size: 1.35rem;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .topics-header {
        flex-direction: column;
        gap: 1rem;
        align-items: start;
    }

    .topics-header h2 {
        font-size: 1.5rem;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-controls select {
        flex: 1;
    }

    .topic-header {
        flex-direction: column;
        gap: 1rem;
    }

    .topic-title {
        font-size: 1.25rem;
    }

    .topic-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: start;
    }

    .topic-actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.35rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
    }

    .login-container {
        padding: 2.5rem 2rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .topic-content {
        padding: 1.5rem;
        padding-left: 2rem;
    }

    .topic-title {
        font-size: 1.1rem;
    }

    .topic-actions {
        padding: 0 1.5rem 1.5rem 2rem;
    }

    .sources-section {
        padding: 1.5rem;
        padding-left: 2rem;
    }
}
.api-config-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease;
}

.api-config-container {
    padding: 1.5rem 2rem;
}

.api-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.api-config-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.api-config-panel {
    margin-top: 1.5rem;
    animation: slideDown 0.3s ease;
}

.api-config-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 128, 255, 0.05);
    border-left: 4px solid var(--galileo-blue);
    border-radius: 8px;
}

.api-config-info p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.api-config-info p:last-child {
    margin-bottom: 0;
}

.api-config-link a {
    color: var(--galileo-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.api-config-link a:hover {
    color: var(--galileo-orange);
    text-decoration: underline;
}

.api-config-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.api-key-input {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--galileo-blue);
    box-shadow: var(--glow-blue);
    background: var(--bg-secondary);
}

.api-key-input::placeholder {
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.api-key-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.api-key-status.success {
    background: rgba(0, 200, 83, 0.1);
    color: var(--source-green);
    border: 1px solid var(--source-green);
    animation: slideDown 0.3s ease;
}

.api-key-status.error {
    background: rgba(255, 61, 0, 0.1);
    color: var(--source-red);
    border: 1px solid var(--source-red);
    animation: shake 0.5s ease;
}

.api-key-status.info {
    background: rgba(0, 128, 255, 0.1);
    color: var(--galileo-blue);
    border: 1px solid var(--galileo-blue);
    animation: slideDown 0.3s ease;
}

/* ========================================
   LOADING OVERLAY (for API calls)
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow-blue);
    animation: slideUp 0.4s ease;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loading-spinner::before {
    width: 80px;
    height: 80px;
    border: 4px solid var(--border-color);
    border-top-color: var(--galileo-blue);
    animation: spin 1s linear infinite;
}

.loading-spinner::after {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border: 4px solid var(--border-color);
    border-bottom-color: var(--galileo-orange);
    animation: spin 0.7s linear infinite reverse;
}

.loading-text {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* API Config Responsive */
