/* --- Global Theme Variables --- */
:root {
    --bg-color: transparent;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-text: #000000;
    --primary-accent: #00ff88;
    --header-bg: rgba(0,0,0,0.95);
    --nav-text: #ffffff;
}

body.light {
    --bg-color: #fdfdfd;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --card-text: #000000;
    --primary-accent: #006400; 
    --header-bg: #ffffff;
    --nav-text: #000000;
}

/* Ensure Icons are ALWAYS visible */
i.fas, i.fab {
    color: inherit; /* Inherit color from the parent link/button */
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Alignment for Top Bar */
.nav-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes settings left, search right */
    padding: 10px 5%;
}

.visual-settings {
    position: relative;
    order: 1; /* Force to left side */
}

.settings-toggle {
    background: var(--header-bg);
    color: var(--primary-accent) !important;
    border: 2px solid var(--primary-accent);
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.settings-dropdown {
    position: absolute;
    top: 55px;
    left: 0; /* Align dropdown to the left button */
    background: var(--card-bg);
    color: var(--card-text);
    border: 1px solid #ccc;
    border-radius: 12px;
    width: 92px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 10001;
}

/* Ensure dropdown buttons have visible icons */
.theme-opt {
    width: 100%;
    background: none;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--card-text);
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
}

.theme-opt i {
    margin-right: 2px;
    color: var(--primary-accent);
}

/* ===============================
   LOADER - STABLE VERSION
================================= */
#loader {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,0.2);
    border-top: 6px solid #00ff88;
    animation: spin 1s linear infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-circle img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* ===============================
   GLOBAL RESET
================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: var(--body-img);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease; /* Smooth transition */
}

.main-header {
    background: var(--header-bg) !important;
}

.navbar a {
    color: var(--nav-text) !important;
}

.hero-news, .news-card, .join-wrapper, .modal-content {
    background: var(--card-bg) !important;
    color: var(--card-text) !important;
}

.top-logo h1 {
    color: var(--primary-accent) !important;
}

/* Update any buttons that use the primary green */
.read-btn, .submit-btn, .join-btn {
    background: var(--primary-accent) !important;
}


body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: url('/img/one.jpg') no-repeat center center fixed;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    overflow:auto;
}

/* ===============================
   HEADER
================================= */
.main-header {
    position: sticky;
    top: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    width: 100%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

/* Logo Section */
.top-logo {
    text-align: center;
    padding: 15px 10px;
}

.top-logo img {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 50% / 35%;
    border: 3px solid #00ff88;
}

.top-logo h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-top: 8px;

    color: #98FB98;
}


/* ===============================
   NAVIGATION
================================= */
.navbar {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.navbar ul li {
    position: relative;
}

.navbar a {
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: 0.3s ease;
}

/* Navigation Background */
.navbar {
    background: #00ff88;
    padding: 10px 0;
}

/* Search Bar */
.search-container {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.search-container form {
    display: flex;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
}

.search-container input {
    border: none;
    padding: 8px 15px;
    outline: none;
}

.search-container button {
    background: #000;
    color: #00ff88;
    border: none;
    padding: 0 15px;
    cursor: pointer;
}



/* Footer Mint Green */
.main-footer {
    background: #00ff88;
    color: #000;
    align-items:flex-start;
}

.footer-nav a {
    color: #000;
}

/* Hover Effect */
.navbar a:hover {
    background: #7EFF66;
    color: #000;
}

/* Special Buttons */
.join-btn {
    background: #00ff88;
    color: #000 !important;
    font-weight: bold;
    border-radius: 4px;
}

.donate-btn {
    background: gold;
    color: #000 !important;
    font-weight: bold;
    border-radius: 4px;
}


/* ===============================
   DESKTOP DROPDOWN FIX ONLY
================================= */

/* Default hidden */
.dropdown-menu {
    display: none;
}

/* JS-controlled visibility */
.dropdown.active > .dropdown-menu {
    display: block;
}

/* DESKTOP behavior ONLY */
@media (min-width: 993px) {

    .navbar ul li {
        position: relative;
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #000;
        min-width: 220px;
        border-radius: 6px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.5);
        padding: 10px 0;
        z-index: 9999;
    }

}

/* This is the ONLY way the menu shows up */
.dropdown.active > .dropdown-menu {
    display: block !important;
}

/* Desktop Specific Adjustments */
@media (min-width: 993px) {
    .navbar ul {
        display: flex !important;
        justify-content: center;
    }
    
    .menu-toggle {
        display: none !important;
    }
}

/* Mobile Specific Adjustments (Your working logic) */
@media (max-width: 992px) {
    .navbar ul {
        display: none;
        flex-direction: column;
        background: #000;
        width: 100%;
    }

    .navbar ul.show {
        display: flex !important;
    }

    .menu-toggle {
        display: block !important;
    }

    /* Submenu pushes content down on mobile */
    .dropdown-menu {
        position: relative !important;
        width: 100%;
        box-shadow: none;
    }
}

/* ===============================
   MOBILE NAVIGATION
================================= */

.menu-toggle {
    display: none;
    text-align: right;
    padding: 14px 20px;
    font-size: 22px;
    cursor: pointer;
    color: #fff;
}

@media (max-width: 992px) {

    .navbar ul {
        display: none;
        flex-direction: column;
        background: #000;
        width: 100%;
    }

    .navbar ul.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    /* Make dropdown full width on mobile */
    .dropdown-menu {
        position: relative;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
    }

}

/* ===============================
   HERO SECTION - MODERNIZED
================================= */

.hero-news {
    position: relative;
    margin: 60px auto;
    max-width: 1200px;
    padding: 60px 40px;
    border-radius: 14px;
    overflow: hidden;

    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
}

/* ONM logo translucent layer */
.hero-news::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/img/one.jpg') center/contain no-repeat;
    opacity: 0.26;   /* Adjust */
    z-index: 0;
}

/* Ensure content stays above flag */
.hero-news > * {
    position: relative;
    z-index: 1;
}

.hero-card {
    height: 400px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.6),
        rgba(0,0,0,0.75)
    );
}

.overlay h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.read-btn {
    display: inline-block;
    padding: 10px 25px;
    background: #00ff88;
    color: #000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: 0.3s ease;
}

.read-btn:hover {
    background: #fff;
    color: #000;
}

.join-section {
    background: #fff; 
    text-align: center;
    padding: 80px 20px;
    margin-top: 80px;
}

.join-section h2,
.join-section p {
    color: #000;

}

.join-section p {
    font-size: 18px;
    margin-top: 15px;

}

.join-btn-large {
    display: inline-block;
    margin-top: 20px;
    padding: 14px 35px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: 0.3s ease;
}

.join-btn-large:hover {
    background: #fff;
    color: #000;
}

/* =====================
        JOIN WRAPPER
===================== */
.join-wrapper {
    background: #fff;
    padding: 50px;
    border: 2px solid #39ff14;
    max-width: 600px;
    margin: auto;
    box-shadow: 0 0 15px #39ff14;
}

.join-wrapper input,
.join-wrapper select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 2px solid #39ff14;
    outline: none;
}

.join-wrapper input:focus,
.join-wrapper select:focus {
    box-shadow: 0 0 8px #39ff14;
}

#submitBtn {
    background: grey;
    color: white;
    padding: 12px;
    border: none;
    width: 100%;
    cursor: not-allowed;
}

#submitBtn:not(:disabled) {
    background: #39ff14;
    cursor: pointer;
}

.spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 3px solid #39ff14;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}
/* =====================
   ABOUT US CONTENT
===================== */
.news-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
}

.news-card {
    background: #ffffff;
    color: #222;
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}

.news-card img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    opacity: 0.85;
}

.news-content {
    padding: 18px;
}

.news-content h2 a {
    color: #006400;
    text-decoration: none;
}

.preview {
    max-height: 90px;
    overflow: hidden;
}

.share {
    margin-top: 15px;
}

.share a {
    margin-right: 10px;
    text-decoration: none;
    font-size: 14px;
    color: #006400;
    font-weight: bold;
}
/* =====================
    CONSENT MODAL
======================== */
.modal {
 display:none;
 position:fixed;
 z-index:999;
 left:0;
 top:0;
 width:100%;
 height:100%;
 background:rgba(0,0,0,0.7);
}

.modal-content{
 background:#39ff14;
 padding:30px;
 width:70%;
 margin:8% auto;
 box-shadow:0 0 25px #39ff14;
 color:#000;
 border-radius:8px;
}

.close{
 float:right;
 font-size:24px;
 cursor:pointer;
}

/* ===============================
   ENHANCED FOOTER
================================= */
.main-footer {
    position: relative;
    padding: 0;
    color: #000;
    overflow: hidden;
    min-height: 400px;
}

.footer-map-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.3; /* This creates the watermark map effect */
    filter: grayscale(100%) invert(90%);
}

.footer-content {
    position: relative;
    z-index: 2;
    background: rgba(0, 255, 136, 0.9); /* Mint Green with Transparency */
    padding: 40px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: auto;
    text-align: left;
}

.footer-nav ul { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: 10px; }
.footer-nav a, .contact-info a {
    color: #000;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.footer-nav a:hover { padding-left: 10px; color: #fff; }

/* Back to Top */
#backToTop {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    background: #000;
    color: #00ff88;
    border: 2px solid #00ff88;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

/* Modal Styling */
.footer-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 0 20px #00ff88;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.submit-btn {
    background: #00ff88;
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}
.contact-info {
    margin: 10px 0;
}

.address {
    margin-top: 10px;
    font-size: 14px;
    color: #ccc;
}

.no-data {
    text-align: center;
    padding: 100px 20px;
    backdrop-filter: blur(3px);
}

.copyright {
    margin-top: 15px;
    text-align: center;
}


/* ===============================
   SPLASH LOADER
================================= */

#splash {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    transition: opacity 0.8s ease;
}

.loader img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    animation: spinBorder 2s linear infinite;
    border: 6px solid white;
    border-top: 6px solid #00ff88;
}

@keyframes spinBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ===============================
   FORCE DESKTOP DROPDOWN CONTROL
================================= */
@media (min-width: 993px) {

    /* ALWAYS hidden by default */
    .navbar .dropdown-menu {
        display: none !important;
    }

    /* ONLY show when JS adds .active */
    .navbar .dropdown.active > .dropdown-menu {
        display: block !important;
    }

}

/* Visual Settings Toggle */
.visual-settings-container {
    position: relative;
    display: inline-block;
    padding: 10px;
}

.settings-toggle {
    background: #000;
    color: #00ff88;
    border: 2px solid #00ff88;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-toggle:focus {
    outline: 3px solid gold; /* WCAG Accessibility requirement */
}

.settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-menu[hidden] { display: none; }

.mode-opt {
    padding: 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
    color: #000;
}

.mode-opt:hover { background: #00ff88; }

/* --- THEMES --- */

/* Eye Protection Mode (Warm/Sepia) */
body.eye-care {
    background-color: #f4ecd8 !important;
    background-image: none !important; /* Remove harsh image backgrounds */
    color: #433422 !important;
}

body.eye-care .main-header, 
body.eye-care .navbar {
    background: #5e4b37 !important;
}

body.eye-care .hero-news, 
body.eye-care .news-card {
    background: #fdf6e3 !important;
    color: #433422 !important;
    border: 1px solid #d3c6aa;
}

/* Dark Mode (High Contrast) */
body.dark {
    background: #121212 !important;
    background-image: none !important;
    color: #e0e0e0 !important;
}

body.dark .hero-news, 
body.dark .news-card,
body.dark .join-wrapper {
    background: #1e1e1e !important;
    color: #fff !important;
    border: 1px solid #333;
}

body.dark .top-logo h1 { color: #00ff88 !important; }