/* Modern Premium History Fact Web App Styling */
:root {
    --bg-primary: #090d16;
    --bg-secondary: rgba(18, 26, 44, 0.75);
    --bg-card: rgba(26, 38, 64, 0.65);
    --accent-gold: #f59e0b;
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow-glow: 0 0 35px rgba(56, 189, 248, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.background-decorations {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
}
.circle-1 {
    position: absolute;
    top: -10%; left: 15%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
}
.circle-2 {
    position: absolute;
    bottom: -10%; right: 15%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon { font-size: 1.8rem; }
.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.badge {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-cyan);
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.85rem;
}

/* Hero Section */
.hero-section {
    padding: 3.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 40%, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 650px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Filters */
.filters-card {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 1rem 1.75rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}
.custom-select {
    background: #0f172a;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}
.custom-select:focus { border-color: var(--accent-cyan); }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(2, 132, 199, 0.6);
}
.btn-primary:active { transform: translateY(1px); }

.pulse-btn {
    animation: pulse 2.5s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.5); }
    50% { box-shadow: 0 0 0 15px rgba(2, 132, 199, 0); }
}

/* Fact Card */
.fact-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-top: 2.5rem;
    width: 100%;
    text-align: left;
    transition: all 0.4s ease;
    animation: fadeInUp 0.5s ease-out;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.badge-tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
}
.era-tag { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.category-tag { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.period-tag { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.fact-title {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    line-height: 1.35;
}
.fact-summary {
    color: #cbd5e1;
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Details & Sources */
.details-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}
.details-heading {
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}
.fact-details-text {
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.sources-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.25rem;
}
.sources-heading {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.sources-list {
    list-style: none;
}
.sources-list li {
    margin-bottom: 0.5rem;
}
.sources-list a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.sources-list a:hover { text-decoration: underline; }

/* Card Actions */
.card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}
.btn-secondary, .btn-accent {
    padding: 0.75rem 1.75rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--border-color);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.18); }
.btn-accent {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4); }

.hidden { display: none !important; }

/* Footer */
.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
