/* ==========================================
   RESET & BASE STYLES
   ========================================== */

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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #f97316;
    --dark-bg: #0f172a;
    --dark-bg-secondary: #1e293b;
    --dark-bg-tertiary: #334155;
    --text-light: #f1f5f9;
    --text-gray: #cbd5e1;
    --text-dark: #1e293b;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --storm-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease, opacity 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   FORECAST VERIFICATION SYSTEM
   ========================================== */

.forecast-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 6rem 0 4rem 0;
    position: relative;
    overflow: hidden;
}

.forecast-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--storm-gradient);
    opacity: 0.1;
}

.forecast-section {
    padding: 4rem 0;
    min-height: 60vh;
}

/* Forecast Tabs */
.forecast-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.forecast-tab {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.forecast-tab:hover {
    color: var(--primary-light);
    background: rgba(37, 99, 235, 0.05);
}

.forecast-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

/* Forecast Tab Content */
.forecast-tab-content {
    display: none;
}

.forecast-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.forecast-card {
    background: var(--dark-bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

.forecast-card h2 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-gray);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
}

.form-group textarea {
    resize: vertical;
}

/* Cities Grid */
.cities-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.city-forecast-card {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.city-forecast-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.city-forecast-card h3 {
    color: var(--primary-light);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.forecast-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.forecast-inputs .form-group {
    margin-bottom: 0;
}

.forecast-inputs input {
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--storm-gradient);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-light);
}

/* Verification Card */
.verification-card,
.history-card {
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.verification-header,
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.verification-header h3,
.history-header h3 {
    color: var(--primary-light);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.verification-header p,
.history-header p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.forecast-notes {
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--text-gray);
}

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

.btn-danger {
    background-color: #dc2626;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

/* City Verification Grid */
.cities-verification-grid,
.cities-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.city-verification-item,
.city-history-item {
    background: var(--dark-bg-secondary);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.city-verification-item h4,
.city-history-item h4 {
    color: var(--primary-light);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

/* New Forecast Comparison Table Layout */
.forecast-comparison-table {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forecast-param {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.param-label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 60px;
    font-size: 0.95rem;
}

.param-values {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.value-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.value-label {
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.value-number {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.nws-value .value-label {
    color: rgba(251, 146, 60, 0.8);
}

.nws-value .value-number {
    color: var(--secondary-color);
}

/* Old forecast details (keep for backward compatibility) */
.forecast-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forecast-details span {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Comparison Grid */
.comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comparison-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row .label {
    font-weight: 600;
    color: var(--text-gray);
}

.comparison-row .forecast {
    color: var(--text-gray);
}

.comparison-row .actual {
    color: var(--primary-light);
    font-weight: 600;
}

.comparison-row .error {
    font-weight: 600;
    text-align: right;
}

.comparison-row .error.good {
    color: #10b981;
}

.comparison-row .error.moderate {
    color: #f59e0b;
}

.comparison-row .error.poor {
    color: #ef4444;
}

.comparison-row .nws-forecast {
    color: var(--secondary-color);
    font-weight: 500;
}

.comparison-row .winner {
    color: #10b981;
    font-weight: 700;
    font-size: 0.85rem;
}

.comparison-row .loser {
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Messages */
.loading-message,
.info-message,
.error-message {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.loading-message {
    background: var(--dark-bg);
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-message {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-light);
    border: 1px solid var(--primary-light);
}

.error-message,
.error-text {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.info-text {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.auth-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-gray);
    background: var(--dark-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-message a {
    color: var(--primary-light);
    text-decoration: underline;
}

.message-banner {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message-banner.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid #10b981;
}

.message-banner.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.message-banner.info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-light);
    border: 1px solid var(--primary-light);
}

/* Responsive Design for Forecasts */
@media (max-width: 768px) {
    .forecast-tabs {
        flex-direction: column;
    }

    .forecast-tab {
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .forecast-tab.active {
        border-left-color: var(--primary-light);
        border-bottom-color: transparent;
    }

    .cities-forecast-grid,
    .cities-verification-grid,
    .cities-history-grid {
        grid-template-columns: 1fr;
    }

    .verification-header,
    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comparison-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .comparison-row .error {
        text-align: left;
    }

    .param-values {
        flex-direction: column;
        gap: 0.75rem;
    }

    .forecast-param {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .param-label {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* ==========================================
   HOMEPAGE GRID FIXES
   ========================================== */

/* Force the homepage specific containers to grid mode */
#recent-blog-posts,
#recent-videos,
#recent-photos {
    display: grid !important; /* Forces grid layout if something else overrode it */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Ensure images inside cards don't blow out the width */
.blog-card-image img, 
.video-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Fallback */
@media (max-width: 768px) {
    #recent-blog-posts,
    #recent-videos,
    #recent-photos {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #fb-feed-container {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   NAVIGATION
   ========================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

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

.nav-logo-img {
    height: 80px;
    width: auto;
    display: block;
}

.nav-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-logo span {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-light);
}

.nav-menu a.active {
    color: var(--primary-light);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--storm-gradient);
}

.admin-link {
    padding: 0.5rem 1rem !important;
    background: var(--dark-bg-tertiary);
    border-radius: 6px;
    transition: background 0.3s ease, color 0.3s ease;
}

.admin-link:hover {
    background: var(--primary-color);
    color: white !important;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(15, 23, 42, 0.8) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 900px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 600;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-gray);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background: var(--text-gray);
    margin: 0.5rem auto;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--storm-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary-light);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* ==========================================
   PAGE SECTIONS
   ========================================== */

.page-header {
    padding: 8rem 0 4rem;
    text-align: center;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg-secondary) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-gray);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.section-header h3 {
    font-size: 1.8rem;
    color: var(--text-light);
}

.view-all {
    color: var(--primary-light);
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
}

.view-all:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* ==========================================
   ABOUT PREVIEW SECTION (HOME PAGE)
   ========================================== */

.about-preview {
    padding: 6rem 0;
    background: var(--dark-bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image .image-placeholder {
    background: var(--dark-bg-tertiary);
    border-radius: 12px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-image svg {
    width: 100px;
    height: 100px;
    color: var(--text-gray);
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content .lead {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* ==========================================
   RECENT CONTENT SECTION
   ========================================== */

.recent-content {
    padding: 6rem 0;
}

.content-section {
    margin-bottom: 5rem;
}

.blog-grid,
.video-grid,
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* ==========================================
   BLOG CARDS
   ========================================== */

.blog-card {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.blog-card-image {
    height: 200px;
    background: var(--dark-bg-tertiary);
    overflow: hidden;
    position: relative;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.1);
}

.blog-card-image .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-image svg {
    width: 60px;
    height: 60px;
    color: var(--text-gray);
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.blog-card-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.blog-card-date {
    color: var(--text-gray);
}

.blog-card-title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-weight: 700;
}

.blog-card-excerpt {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================
   VIDEO CARDS
   ========================================== */

.video-card {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.video-card-thumbnail {
    position: relative;
    height: 200px;
    background: var(--dark-bg-tertiary);
    overflow: hidden;
}

.video-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-thumbnail .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card-thumbnail svg {
    width: 60px;
    height: 60px;
    color: var(--text-gray);
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-card:hover .video-play-icon {
    background: var(--primary-light);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

.video-card-content {
    padding: 1.5rem;
}

.video-card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 700;
}

.video-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* ==========================================
   PHOTO CARDS
   ========================================== */

.photo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    background: var(--dark-bg-tertiary);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-card:hover img {
    transform: scale(1.1);
}

.photo-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-card:hover .photo-card-overlay {
    transform: translateY(0);
}

.photo-card-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.photo-card-meta {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.photo-card .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-card svg {
    width: 60px;
    height: 60px;
    color: var(--text-gray);
}

/* ==========================================
   BLOG PAGE
   ========================================== */

.blog-section,
.videos-section,
.photos-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.blog-filters,
.video-filters,
.photo-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    background: var(--dark-bg-secondary);
    color: var(--text-gray);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.filter-btn.active {
    background: var(--storm-gradient);
    color: white;
    border-color: transparent;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.no-content {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-gray);
}

.no-content svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    opacity: 0.5;
}

.no-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* ==========================================
   ABOUT PAGE
   ========================================== */

.about-content {
    padding: 4rem 0;
}

.about-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-text .lead {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-text p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-image-large .image-placeholder {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.about-image-large svg {
    width: 120px;
    height: 120px;
    color: var(--text-gray);
}

.team-section,
.mission-section,
.location-section {
    margin-bottom: 5rem;
}

.team-section h2,
.mission-section h2,
.location-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.team-grid {
    display: grid;
    gap: 3rem;
}

.team-member {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    background: var(--dark-bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-photo .image-placeholder {
    background: var(--dark-bg-tertiary);
    border-radius: 12px;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-photo svg {
    width: 80px;
    height: 80px;
    color: var(--text-gray);
}

.team-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.team-role {
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
    font-weight: 600;
}

.team-bio {
    color: var(--text-gray);
    line-height: 1.8;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.mission-card {
    background: var(--dark-bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.mission-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

.mission-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: var(--storm-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mission-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.mission-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.mission-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

.location-content {
    max-width: 800px;
    margin: 0 auto;
}

.location-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.location-text p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ==========================================
   ADMIN PANEL
   ========================================== */

.admin-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.admin-section {
    padding: 4rem 0;
    min-height: 70vh;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--dark-bg-secondary);
    flex-wrap: wrap;
}

.admin-tab {
    padding: 1rem 2rem;
    background: transparent;
    color: var(--text-gray);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.admin-tab:hover {
    color: var(--primary-light);
}

.admin-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-panel-header h2 {
    font-size: 2rem;
    color: var(--text-light);
}

.content-list {
    display: grid;
    gap: 1.5rem;
}

.content-item {
    background: var(--dark-bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.content-item-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.content-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-gray);
    flex-wrap: wrap;
}

.content-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.settings-content {
    max-width: 800px;
}

.setting-group {
    background: var(--dark-bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.setting-group h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.setting-group p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.warning-text {
    color: #f59e0b !important;
}

.setting-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==========================================
   FORMS
   ========================================== */

.admin-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.9rem;
    background: var(--dark-bg-tertiary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--dark-bg-secondary);
}

.form-group small {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* ==========================================
   MODALS
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-modal-content {
    padding: 2.5rem;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.blog-post-modal-content {
    padding: 3rem;
    max-height: 90vh;
    overflow-y: auto;
}

.video-modal-content {
    padding: 0;
    background: black;
    max-width: 1200px;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg-tertiary);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
}

.form-modal-content h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text-light);
}

/* Blog Post Modal */
#modal-post-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

#modal-post-content .post-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#modal-post-content .post-category {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

#modal-post-content .post-date {
    color: var(--text-gray);
}

#modal-post-content .post-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 2rem;
}

#modal-post-content .post-content {
    color: var(--text-gray);
    font-size: 1.1rem;
    line-height: 1.8;
}

#modal-post-content .post-content h2,
#modal-post-content .post-content h3 {
    color: var(--text-light);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#modal-post-content .post-content p {
    margin-bottom: 1.5rem;
}

#modal-post-content .post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Video Modal */
#modal-video-content iframe,
#modal-video-content video {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

#modal-video-content .video-info {
    padding: 2rem;
    background: var(--dark-bg-secondary);
}

#modal-video-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

#modal-video-content .video-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-gray);
}

#modal-video-content .video-description {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Photo Modal */
.photo-modal.active {
    display: flex;
}

.photo-modal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.photo-modal .modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
}

#modal-photo-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-caption {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    max-width: 600px;
    text-align: center;
}

.photo-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-nav:hover {
    background: var(--primary-color);
}

.photo-prev {
    left: 2rem;
}

.photo-next {
    right: 2rem;
}

/* The dark overlay behind the modal */
.fb-post-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000; /* Ensure it sits on top of everything */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Show the modal when JS adds the 'active' class */
.fb-post-modal.active {
    display: flex !important;
}

/* The actual modal box */
.fb-post-modal-content {
    background: #1e293b; /* Dark Slate Blue */
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Close Button (X) */
.fb-post-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.fb-post-modal-close:hover { background: rgba(255, 255, 255, 0.2); }

/* Left Side: Image/Media Area */
.fb-post-modal-media {
    flex: 1.5; /* Takes up 60% of width */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
}

.fb-post-modal-images {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fb-post-modal-images img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

/* Navigation Arrows (Prev/Next) */
.fb-post-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.2s;
}
.fb-post-modal-nav.prev { left: 0; }
.fb-post-modal-nav.next { right: 0; }
.fb-post-modal-nav:hover { background: rgba(37, 99, 235, 0.8); }

/* Image Counter (e.g., "1/4") */
.fb-post-modal-counter {
    position: absolute;
    bottom: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Right Side: Text/Content Area */
.fb-post-modal-body {
    flex: 1; /* Takes up 40% of width */
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.fb-post-modal-message {
    color: #cbd5e1; /* Light gray text */
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    white-space: pre-wrap; /* Preserves formatting */
}

.fb-post-modal-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.9rem;
}

.fb-post-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: #3b82f6; /* Blue link */
    font-weight: 600;
}

/* --- Responsive Mobile Layout --- */
@media (max-width: 900px) {
    .fb-post-modal-content {
        flex-direction: column; /* Stack image on top of text */
        max-height: 95vh;
    }
    .fb-post-modal-media {
        flex: none;
        height: 40vh; /* Image takes top 40% */
        min-height: auto;
    }
    .fb-post-modal-body {
        flex: 1;
        padding: 1.5rem;
    }
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: var(--dark-bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.footer-section h3 {
    font-size: 1.5rem;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

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

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        padding: 2rem;
        gap: 1rem;
        transition: left 0.3s ease;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .about-grid,
    .about-main,
    .team-member {
        grid-template-columns: 1fr;
    }

    .blog-posts-grid,
    .videos-grid {
        grid-template-columns: 1fr;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .mission-grid {
        grid-template-columns: 1fr;
    }

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

    .content-item {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1rem;
    }

    .form-modal-content,
    .blog-post-modal-content {
        padding: 2rem;
    }
}

@media (max-width: 640px) {
    .nav-logo-img {
        height: 40px;
    }

    .nav-logo span {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .photo-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .photo-prev {
        left: 1rem;
    }

    .photo-next {
        right: 1rem;
    }
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* Hint to browser which properties will change for better optimization */
.btn,
.blog-card,
.video-card,
.photo-card {
    will-change: transform;
}

.blog-card:hover,
.video-card:hover,
.photo-card:hover,
.btn:hover {
    will-change: auto;
}

/* Enable hardware acceleration for animations */
.hero-content,
.hero-scroll,
.modal-content {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize images */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   BLOG CAROUSEL / SLIDESHOW
   ========================================== */

.blog-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 2rem 0;
    background: var(--dark-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-slides {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0f172a;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem 1.5rem 1rem;
    margin: 0;
    font-size: 1rem;
    text-align: center;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

/* Dot Indicators */
.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
    background: var(--primary-light);
    transform: scale(1.2);
}

/* Carousel Builder Styles (Admin) */
.carousel-builder {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.carousel-upload-section {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.upload-options {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.carousel-images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 8px;
}

.carousel-preview-item {
    background: var(--dark-bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-preview-item .preview-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.carousel-preview-item .preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-preview-item .preview-details {
    padding: 0.75rem;
}

.carousel-preview-item .preview-details input {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.carousel-preview-item .preview-actions {
    display: flex;
    gap: 0.25rem;
}

.carousel-preview-item .preview-actions button {
    flex: 1;
    padding: 0.5rem;
    background: var(--dark-bg-tertiary);
    border: none;
    border-radius: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.carousel-preview-item .preview-actions button:hover:not(:disabled) {
    background: var(--primary-color);
}

.carousel-preview-item .preview-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-preview-item .preview-actions button.btn-danger:hover {
    background: #dc2626;
}

.carousel-settings {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.carousel-settings label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .carousel-prev {
        left: 0.5rem;
    }

    .carousel-next {
        right: 0.5rem;
    }

    .carousel-dots {
        bottom: 0.5rem;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    .carousel-caption {
        font-size: 0.875rem;
        padding: 1.5rem 1rem 0.75rem;
    }

    .carousel-images-preview {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* ==========================================
   WEATHER PAGE STYLES (UPDATED)
   ========================================== */

.weather-section {
    padding: 3rem 0;
}

.weather-section:nth-child(even) {
    background: var(--dark-bg-secondary);
}

.weather-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-section-title::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Alerts Section */
.alerts-section {
    background: var(--dark-bg);
}

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

.alert-card {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    border-left: 4px solid;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alert-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.alert-card.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--dark-bg-secondary) 100%);
}

.alert-card.watch {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--dark-bg-secondary) 100%);
}

.alert-card.advisory {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, var(--dark-bg-secondary) 100%);
}

.alert-card.statement {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, var(--dark-bg-secondary) 100%);
}

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

.alert-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-light);
}

.alert-card-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.alert-card.warning .alert-card-badge {
    background: #f59e0b;
    color: #000;
}

.alert-card.watch .alert-card-badge {
    background: #ef4444;
    color: #fff;
}

.alert-card.advisory .alert-card-badge {
    background: #3b82f6;
    color: #fff;
}

.alert-card-areas {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.alert-card-time {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.no-alerts {
    text-align: center;
    padding: 2rem;
    color: var(--text-gray);
    background: var(--dark-bg-secondary);
    border-radius: 12px;
}

.no-alerts-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Conditions Section */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.condition-card {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.condition-card:hover {
    transform: translateY(-4px);
}

.condition-card-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.condition-city {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
}

.condition-county {
    font-size: 0.85rem;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.condition-temp {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-light);
    margin: 0.5rem 0;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.condition-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.condition-details {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-gray);
}

.updated-text {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

/* Radar Section */
.radar-section {
    background: var(--dark-bg);
}

.radar-hint {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.radar-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--dark-bg-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radar-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.radar-expand-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    pointer-events: none;
}

.radar-close-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.radar-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    z-index: 9999;
}

.radar-container.fullscreen .radar-expand-icon {
    display: none;
}

.radar-container.fullscreen .radar-close-icon {
    display: flex;
}

/* Forecast Section */
/* FIX: Header & Selector Layout */
.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.forecast-title-area {
    position: relative;
    z-index: 5;
}

.forecast-title-area h2 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.2;
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forecast-subtitle {
    margin-top: 0.5rem;
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Selector styling */
.city-selector {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.05);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

.city-selector select option {
    background-color: #1e293b; /* Matches your dark theme secondary background */
    color: white;
}

.city-selector label {
    margin: 0;
    font-weight: 600;
    color: var(--primary-light);
    white-space: nowrap;
}

.city-selector select {
    background: transparent;
    border: none;
    color: white; /* Updated to white */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    padding-right: 2rem;
}

.city-selector select:focus {
    outline: none;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.forecast-day-card {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.forecast-day-card:hover {
    transform: translateY(-4px);
}

.forecast-day-badge {
    display: inline-block;
    background: var(--primary-dark);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.forecast-date {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.forecast-sky {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0.5rem 0;
    min-height: 1.5em;
}

.forecast-temps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0;
    font-size: 1.25rem;
}

.temp-high {
    font-weight: 700;
    color: var(--secondary-color);
}

.temp-low {
    font-weight: 600;
    color: var(--primary-light);
}

.forecast-precip-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

/* "Tap for Hourly" button styling */
.forecast-day-card div[style*="uppercase"] {
    background: rgba(255,255,255,0.05);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem !important;
    letter-spacing: 1px;
    margin-top: 12px !important;
    transition: background 0.2s ease;
    display: inline-block;
}

.forecast-day-card:hover div[style*="uppercase"] {
    background: var(--primary-color);
    color: white !important;
}

/* Alert Modal */
.alert-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.alert-modal.active {
    display: flex;
}

.alert-modal-content {
    background: var(--dark-bg-secondary);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.alert-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--dark-bg-tertiary);
}

.alert-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
}

.alert-modal-close {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.alert-modal-close:hover {
    color: var(--text-light);
}

.alert-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-gray);
    line-height: 1.7;
}

.alert-modal-body p {
    margin-bottom: 1rem;
}

.alert-modal-body strong {
    color: var(--text-light);
}

.loading-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--text-gray);
}
/* Responsive Weather */
@media (max-width: 992px) {
    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .weather-section {
        padding: 2rem 0;
    }
    
    .forecast-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .city-selector {
        width: 100%;
        justify-content: space-between;
    }

    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .conditions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .radar-container {
        aspect-ratio: 4/3;
    }
}

@media (max-width: 480px) {
    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .conditions-grid {
        grid-template-columns: 1fr;
    }
}
/* ==========================================
   FORCE GRID LAYOUT (Add to bottom of file)
   ========================================== */
#recent-blog-posts, 
#recent-videos, 
#recent-photos,
#fb-feed-container {   /* <--- Added this line */
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    width: 100% !important;
}

/* Ensure card contents don't break the grid */
.blog-card, .video-card, .photo-card {
    width: 100%;
    min-width: 0; /* Prevents flex/grid overflow issues */
}


/* ==========================================
   FINAL FIXES - UPDATED FOR FB-FEED.JS
   ========================================== */

/* 1. FORCE THE GRID LAYOUT */
#fb-feed-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 2rem !important;
    width: 100% !important;
}

/* 2. STYLE THE FACEBOOK CARDS (Targeting 'article.fb-post-card') */
.fb-post-card {
    /* Gradient Background for depth */
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
    
    /* Stronger, brighter border */
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    
    /* Deep shadow to lift it off the page */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4) !important;
    
    border-radius: 12px !important;
    padding: 0 !important; /* Reset padding (inner elements handle spacing) */
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
    height: 100% !important; /* Ensure all cards are same height */
}

/* Hover Effect */
.fb-post-card:hover {
    transform: translateY(-5px) !important;
    border-color: #3b82f6 !important; /* Bright Blue */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6) !important;
}

/* 3. FIX CARD CONTENT SPACING */
.fb-post-content {
    padding: 1.25rem !important;
    flex-grow: 1 !important; /* Pushes footer to bottom */
}

/* 4. FIX IMAGES */
.fb-post-image {
    width: 100% !important;
    height: 200px !important;
    position: relative !important;
    background: #0f172a !important;
}

.fb-post-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important; /* Remove radius since it's full width now */
    margin: 0 !important;
}

/* 5. FIX "CLICK TO EXPAND" FOOTER */
.fb-post-link {
    padding: 1rem 1.25rem !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

/* 6. FIX CITY SELECT DROPDOWN (Homepage Widget) */
#fw-city-select option {
    background-color: #1e293b !important;
    color: white !important;
}

/* Mobile Fix */
@media (max-width: 768px) {
    #fb-feed-container {
        grid-template-columns: 1fr !important;
    }
}
.carousel-slides {
    position: relative; /* Ensure container is the reference point */
    overflow: hidden;
}

.carousel-slide {
    position: absolute !important; /* Stack images on top of each other */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Hide all by default */
    visibility: hidden; /* Ensure they aren't clickable when hidden */
    transition: opacity 0.5s ease-in-out;
    display: block !important; /* Ensure they aren't display:none which breaks transitions */
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 5; /* Bring the active one to the front */
}

/* Ensure the nav buttons are always on top of the images */
.carousel-nav {
    z-index: 20 !important; 
    cursor: pointer;
}

/* ==========================================
   TINYMCE EDITOR FIXES FOR MODALS
   ========================================== */

/* Fix dropdown/popup z-index - must be higher than modal (2000) */
.tox-tinymce-aux {
    z-index: 10001 !important;
}

/* Fix for TinyMCE dropdowns being clipped by modal overflow */
.tox-tinymce-aux,
.tox-menu,
.tox-dialog,
.tox-dialog-wrap,
.tox-pop,
.tox-collection,
.tox-collection__group {
    z-index: 10001 !important;
}

/* Ensure the editor container itself is visible and interactive */
.tox-tinymce {
    border-radius: 8px !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
}

/* Hide the original textarea when TinyMCE is active */
#blog-content[style*="display: none"],
textarea#blog-content.tox-target {
    display: none !important;
}

/* Widen the blog form modal to fit TinyMCE toolbar properly */
#blog-form-modal .modal-content.form-modal-content {
    max-width: 950px !important;
    background: var(--dark-bg-secondary) !important;
}

/* Ensure toolbar has enough space */
.tox .tox-toolbar,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary {
    flex-wrap: wrap !important;
}

/* Fix TinyMCE toolbar button visibility */
.tox .tox-tbtn {
    visibility: visible !important;
    display: inline-flex !important;
}

/* ==========================================
   CHASE ARCHIVE
   ========================================== */

/* Public Page Layout */
.chase-archive-section {
    padding: 0;
    min-height: calc(100vh - 80px);
}

.chase-archive-layout {
    display: grid;
    grid-template-columns: 300px 1fr 0;
    height: calc(100vh - 180px);
    transition: grid-template-columns 0.3s ease;
}

.chase-archive-layout.panel-open {
    grid-template-columns: 300px 1fr 400px;
}

/* Filter Panel */
.chase-filter-panel {
    background: var(--dark-bg-secondary);
    padding: 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.chase-filter-panel h3 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

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

.filter-toggle-mobile {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
}

.filter-group {
    margin-bottom: 1.25rem;
}

.filter-group label {
    display: block;
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.event-type-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input {
    accent-color: var(--primary-color);
}

.event-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.event-marker.tornado { background: #ef4444; }
.event-marker.hail { background: #10b981; }
.event-marker.wind { background: #f59e0b; }
.event-marker.structure { background: #8b5cf6; }
.event-marker.other { background: #6b7280; }

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-buttons .btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.85rem;
}

/* Chase List */
.chase-list-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.chase-list-section h4 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.chase-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chase-list-card {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.chase-list-card:hover {
    border-color: var(--primary-color);
    background: var(--dark-bg-tertiary);
}

.chase-list-date {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.chase-list-title {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.chase-list-meta {
    font-size: 0.8rem;
    color: var(--text-gray);
    display: flex;
    gap: 1rem;
}

/* Map Container */
.chase-map-container {
    position: relative;
}

#chase-archive-map {
    width: 100%;
    height: 100%;
}

.filter-toggle-btn {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: var(--dark-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Custom Markers */
.chase-marker {
    background: transparent;
}

.chase-marker-inner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chase-tooltip {
    background: var(--dark-bg-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
}

.chase-tooltip::before {
    border-top-color: var(--dark-bg-secondary) !important;
}

/* Detail Panel */
.chase-detail-panel {
    background: var(--dark-bg-secondary);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    position: relative;
    width: 0;
}

.chase-detail-panel.active {
    transform: translateX(0);
    width: 400px;
}

.panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--dark-bg);
    border: none;
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: var(--primary-color);
    color: white;
}

.chase-detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chase-detail-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.chase-detail-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.chase-detail-header h2 {
    color: var(--text-light);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.chase-detail-route-info {
    color: var(--text-gray);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.chase-partners {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.chase-detail-summary {
    padding: 1.5rem;
    color: var(--text-gray);
    line-height: 1.7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chase-observations-section,
.chase-media-section {
    padding: 1.5rem;
}

.chase-observations-section h3,
.chase-media-section h3 {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Observation Cards */
.chase-observations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.observation-card {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.observation-card:hover {
    background: var(--dark-bg-tertiary);
}

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

.observation-type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.observation-time {
    color: var(--text-gray);
    font-size: 0.8rem;
}

.observation-card h4 {
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.observation-location {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.observation-description {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Tornado Stats */
.tornado-stats {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.ef-rating {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: white;
}

.ef-rating.ef-0 { background: #22c55e; }
.ef-rating.ef-1 { background: #eab308; color: black; }
.ef-rating.ef-2 { background: #f97316; }
.ef-rating.ef-3 { background: #ef4444; }
.ef-rating.ef-4 { background: #dc2626; }
.ef-rating.ef-5 { background: #7f1d1d; }

.tornado-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.tornado-stats-grid span {
    color: var(--text-gray);
}

.stat-fatalities {
    color: #ef4444 !important;
}

.damage-description {
    margin-top: 0.75rem;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-style: italic;
}

.nws-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-decoration: none;
}

.nws-link:hover {
    text-decoration: underline;
}

/* Media Grid */
.chase-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.chase-media-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.chase-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.chase-media-item:hover img {
    transform: scale(1.1);
}

.media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.media-play-icon svg {
    width: 20px;
    height: 20px;
}

.chase-media-item.video:hover .media-play-icon {
    background: rgba(255, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.media-play-icon {
    transition: background 0.2s ease, transform 0.2s ease;
}

/* Media Modal */
.media-modal-content {
    width: 90vw;
    max-width: 960px;
    max-height: 90vh;
    background: var(--dark-bg) !important;
    padding: 2rem;
}

#media-modal-body {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-modal-content img,
.media-modal-content video {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
}

.media-modal-content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    border: none;
}

.media-caption {
    text-align: center;
    color: var(--text-gray);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Loading & Error States */
.loading-message,
.error-message,
.no-chases {
    text-align: center;
    color: var(--text-gray);
    padding: 2rem;
}

.error-message {
    color: #ef4444;
}

/* ==========================================
   CHASE ARCHIVE ADMIN
   ========================================== */

/* Chase Form Modal - wider to fit map */
.chase-form-modal {
    max-width: 1200px !important;
    width: 95vw !important;
}

.chase-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chase-form-fields {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.chase-form-map {
    display: flex;
    flex-direction: column;
}

.chase-form-map label {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.map-instructions {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.chase-admin-map {
    flex: 1;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

/* Admin Map Controls */
.chase-map-controls {
    background: var(--dark-bg-secondary);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-control-btn {
    width: 36px;
    height: 36px;
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-gray);
}

.map-control-btn svg {
    stroke: currentColor;
}

.map-control-btn:hover {
    background: var(--dark-bg-tertiary);
    color: var(--text-light);
}

.map-control-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Observations List in Admin */
.observations-list {
    background: var(--dark-bg);
    border-radius: 8px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.no-observations {
    color: var(--text-gray);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}

.observation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--dark-bg-secondary);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.observation-item:last-child {
    margin-bottom: 0;
}

.obs-type-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    flex-shrink: 0;
}

.obs-type-badge.tornado { background: #ef4444; }
.obs-type-badge.hail { background: #10b981; }
.obs-type-badge.wind { background: #f59e0b; }
.obs-type-badge.structure { background: #8b5cf6; }
.obs-type-badge.other { background: #6b7280; }

.obs-title {
    color: var(--text-light);
    font-weight: 500;
    flex: 1;
}

.obs-location {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.obs-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.btn-icon:hover {
    text-decoration: underline;
}

.btn-icon.danger {
    color: #ef4444;
}

/* Media Add Form */
.media-add-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.media-add-form input,
.media-add-form select {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem;
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.media-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--dark-bg);
    border-radius: 6px;
    font-size: 0.85rem;
}

.media-type-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.media-url {
    color: var(--text-gray);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.media-thumb-wrapper {
    position: relative;
    flex-shrink: 0;
}

.media-thumb-wrapper .video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumb-wrapper .video-indicator svg {
    width: 10px;
    height: 10px;
    fill: white;
}

.media-type-badge.youtube {
    background: #ff0000;
}

.media-type-badge.video {
    background: #ef4444;
}

.media-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.media-caption-text {
    color: var(--text-gray);
    font-size: 0.8rem;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Observation Form Modal */
.observation-form-modal {
    max-width: 700px !important;
}

/* Form Row for side-by-side fields */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Responsive - Chase Archive */
@media (max-width: 1024px) {
    .chase-archive-layout {
        grid-template-columns: 1fr;
    }

    .chase-filter-panel {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 300px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .chase-filter-panel.active {
        transform: translateX(0);
    }

    .filter-toggle-btn,
    .filter-toggle-mobile {
        display: flex;
    }

    .chase-detail-panel {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100% !important;
        max-width: 400px;
        z-index: 1000;
    }

    .chase-archive-layout.panel-open {
        grid-template-columns: 1fr;
    }

    /* Chase Form on smaller screens */
    .chase-form-layout {
        grid-template-columns: 1fr;
    }

    .chase-form-fields {
        max-height: none;
    }

    .chase-admin-map {
        min-height: 300px;
    }
}