:root {
    --bg-dark: #0f172a;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --accent-blue: #38bdf8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(148, 163, 184, 0.1);
    
    --severity-green: #22c55e;
    --severity-yellow: #eab308;
    --severity-orange: #f97316;
    --severity-red: #ef4444;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

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

/* Background Effects */
.background-globule {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
    z-index: -1;
    filter: blur(80px);
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.logo-icon {
    font-size: 1.8rem;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 5px;
    background: rgba(30, 41, 59, 1);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.lang-btn.active {
    background: var(--accent-blue);
    color: #0f172a;
}

/* Main Content */
main {
    padding-top: 40px;
    padding-bottom: 60px;
}

.status-section {
    text-align: center;
    margin-bottom: 40px;
}

.last-updated {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.aggregate-status {
    font-family: var(--font-heading);
    font-size: 3.5rem; /* Significantly larger */
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 10px;
}

/* Grid */
.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-dim);
    font-size: 1.2rem;
}

/* Alert Card */
.alert-card {
    background: rgba(30, 41, 59, 0.6); /* More transparent for glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px; /* Breathing room */
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 6px solid var(--text-dim); /* Default border */
}

/* Remove old pseudo-element strip */
.alert-card::before {
    display: none;
}

.alert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.alert-severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light); /* Neutral white title */
    margin-bottom: 4px;
    line-height: 1.3;
}

.alert-area {
    font-size: 0.95rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.alert-content-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.alert-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
}

.alert-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.alert-instruction {
    background: rgba(15, 23, 42, 0.4);
    padding: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #cbd5e1;
    border-left: 4px solid var(--text-dim);
    margin-top: auto;
}

/* Icon in Header */
.alert-type-icon {
    font-size: 2rem;
    background: rgba(255,255,255,0.05);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* Severity Colors */
/* Severity Colors */
.severity-green { 
    border-left-color: var(--severity-green); 
}
.severity-green .alert-severity-badge { 
    background: rgba(34, 197, 94, 0.2); 
    color: var(--severity-green); 
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.severity-yellow { 
    border-left-color: var(--severity-yellow); 
}
.severity-yellow .alert-severity-badge { 
    background: rgba(234, 179, 8, 0.2); 
    color: var(--severity-yellow); 
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.severity-orange { 
    border-left-color: var(--severity-orange);
    box-shadow: 0 0 40px rgba(249, 115, 22, 0.1); 
}
.severity-orange .alert-severity-badge { 
    background: rgba(249, 115, 22, 0.2); 
    color: var(--severity-orange); 
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.severity-red { 
    border-left-color: var(--severity-red);
    background: linear-gradient(to bottom right, rgba(239, 68, 68, 0.1), rgba(30, 41, 59, 0.7));
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.15);
    border-top: 1px solid rgba(239, 68, 68, 0.3);
}
.severity-red .alert-severity-badge { 
    background: var(--severity-red); 
    color: white; 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 40px 0;
    border-top: 1px solid var(--card-border);
}

/* Responsiveness */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    .alerts-grid {
        grid-template-columns: 1fr;
    }
}

/* SEO Section */
.seo-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--card-border);
    color: var(--text-dim);
}

.seo-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-light);
    font-family: var(--font-heading);
}

.seo-text {
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 800px;
}

/* Section Titles */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-light);
}

/* Island Section */
.island-section {
    margin-bottom: 50px;
}

.island-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.island-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.island-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(56, 189, 248, 0.15);
    border-color: var(--accent-blue);
}

.island-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.island-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.island-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-dim);
}

.island-badge.has-alerts {
    background: rgba(249, 115, 22, 0.2);
    color: var(--severity-orange);
}

.island-badge.severe {
    background: rgba(239, 68, 68, 0.2);
    color: var(--severity-red);
}

/* All Alerts Section */
.all-alerts-section {
    margin-bottom: 20px;
}

/* Info Section (AEMET) */
.info-section {
    margin-top: 40px;
    margin-bottom: 40px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text-light);
    border-color: var(--accent-blue);
}

.filter-btn.active {
    background: var(--accent-blue);
    color: #0f172a;
    border-color: var(--accent-blue);
}

.filter-btn[data-filter="severe"].active {
    background: var(--severity-orange);
    border-color: var(--severity-orange);
}

.filter-btn[data-filter="moderate"].active {
    background: var(--severity-yellow);
    border-color: var(--severity-yellow);
    color: #0f172a;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb span {
    color: var(--text-dim);
}

/* Island Page Header */
.island-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.island-header-icon {
    font-size: 3rem;
}

.island-header-info h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.island-header-info p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .island-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .island-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .island-card {
        padding: 16px 12px;
    }

    .island-icon {
        font-size: 2rem;
    }

    .island-name {
        font-size: 0.9rem;
    }
}
