:root {
    --bg-dark: #0f172a;
    --bg-glass: rgba(30, 41, 59, 0.65);
    --bg-glass-hover: rgba(51, 65, 85, 0.8);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: #38bdf8;
    --primary: #0ea5e9;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.background-glass {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.15) 0%, transparent 40%);
    z-index: -2;
}

.overlay-grad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opactiy='0.05'/%3E%3C/svg%3E");
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

h1 {
    font-size: 1.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem 2rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    font-size: 2rem;
    color: var(--accent-glow);
}

.brand-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    flex-grow: 1;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-family: var(--font-body);
}

.custom-select {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-body);
    min-width: 150px;
}

/* Grid & Cards */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.news-card {
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-4px);
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--text-secondary); /* Default */
}

.news-card.severity-high::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.news-card.severity-medium::before { background: var(--warning); box-shadow: 0 0 10px var(--warning); }
.news-card.severity-low::before { background: var(--success); box-shadow: 0 0 10px var(--success); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.issuer {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.date-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-alert {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(14, 165, 233, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    padding: 2rem;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.modal-backdrop:not(.hidden) .modal-content {
    transform: translateY(0) scale(1);
}

.large-modal {
    max-width: 1200px;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover { color: white; }

.dual-pane {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    height: 60vh;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pane h4 {
    color: var(--accent-glow);
    font-size: 1rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.ai-summary-box, pre {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

pre {
    font-family: monospace;
    color: #a7f3d0;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-glow);
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Utility */
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-item {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.rule-item h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.rule-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ══════════════════════════════════════════════ */
/* Login Splash Screen                            */
/* ══════════════════════════════════════════════ */
.login-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon-large {
    font-size: 3.5rem;
    color: var(--accent-glow);
    filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.5));
}

.login-brand h1 {
    font-size: 2.2rem;
}

.login-brand p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.login-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
}

.login-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

