/* === 1. GLOBAL VARIABLES & THEME SETUP === */
:root {
    /* CONSTANT BRAND COLORS */
    --brand-gold: #D4AF37;       /* Metallic Gold */
    --brand-navy: #0B162C;       /* Deep Navy */
    --brand-navy-light: #152238; /* Lighter Navy */
}

/* === LIGHT MODE === */
[data-theme="light"] {
    --bg-main: #f4f6f8;
    --text-main: #0B162C;
    --text-muted: #555555;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --drawer-bg: #ffffff;
    --shadow: rgba(0,0,0,0.1);
}

/* === DARK MODE === */
[data-theme="dark"] {
    --bg-main: #0B162C;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --card-bg: #152238;
    --border-color: #333333;
    --input-bg: #152238;
    --drawer-bg: #152238;
    --shadow: rgba(0,0,0,0.5);
}

/* Global Resets */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-main); color: var(--text-main); transition: 0.3s; line-height: 1.6; overflow-x: hidden; }

/* === 2. TICKER === */
.ticker-wrap { width: 100%; height: 40px; background: var(--brand-navy); overflow: hidden; display: flex; align-items: center; position: relative; z-index: 3000; border-bottom: 1px solid var(--brand-gold); }
.ticker-label { background: var(--brand-gold); color: #000; padding: 0 15px; height: 100%; display: flex; align-items: center; font-weight: 900; font-size: 11px; z-index: 20; position: absolute; left: 0; letter-spacing: 1px; }
.ticker-content { display: flex; animation: ticker-scroll 60s linear infinite; padding-left: 100%; }
.ticker-item { color: #fff; padding-right: 100px; font-size: 13px; font-weight: bold; white-space: nowrap; transition: 0.3s; }
.ticker-item:hover { color: var(--brand-gold); }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* === 3. HEADER & NAV === */
.glass-header { position: sticky; top: 0; z-index: 4000; box-shadow: 0 5px 20px var(--shadow); }

/* Premium Gradient Header */
.brand-section { 
    padding: 15px 5%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    position: relative; 
    background: radial-gradient(circle at center, #1B3B6F, var(--brand-navy)); 
    border-bottom: 3px solid var(--brand-gold); 
}

.main-logo { font-size: 2rem; font-weight: 950; text-transform: uppercase; color: #fff; letter-spacing: 2px; cursor: pointer; transition: 0.3s; }
.main-logo:hover { color: var(--brand-gold); }
.menu-trigger { position: absolute; left: 5%; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--brand-gold); }

/* Navigation Bar */
.category-bar-horizontal { background: var(--card-bg); width: 100%; display: flex; justify-content: center; padding: 5px 0; border-bottom: 1px solid var(--border-color); }
.nav-scroll-container { display: flex; overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 10px; padding: 0 10px; }
.nav-item { padding: 8px 15px; text-decoration: none; color: var(--text-muted); font-size: 11px; font-weight: 800; transition: 0.3s; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-item.active-page { border-bottom: 3px solid var(--brand-gold); color: var(--brand-gold); }
.nav-item:hover:not(.active-page) { background: rgba(128,128,128,0.1); color: var(--text-main); border-radius: 4px; }

/* === 4. SEARCH BAR === */
.action-bar { background: var(--bg-main); padding: 10px 0; }
.search-pill { display: flex; align-items: center; background: var(--input-bg); border: 1px solid var(--brand-gold); border-radius: 50px; margin: 10px auto; max-width: 600px; transition: 0.3s ease; position: relative; overflow: hidden; }
.search-pill:focus-within { transform: scale(1.02); box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2); }
.search-input { flex: 1; border: none; padding: 10px 20px; outline: none; font-weight: 600; background: transparent; color: var(--text-main); }
.clear-search-btn { display: none; background: none; border: none; font-size: 18px; color: #999; cursor: pointer; padding: 0 10px; }
.clear-search-btn:hover { color: red; }
.search-submit-btn { background: var(--brand-gold); color: #000; border: none; width: 60px; height: 45px; cursor: pointer; transition: 0.3s; }
.search-submit-btn:hover { background: var(--text-main); color: #fff; }

/* === 5. SIDE DRAWER & OVERLAY === */
.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 4999; visibility: hidden; opacity: 0; transition: 0.3s; backdrop-filter: blur(3px); }
.menu-overlay.active { visibility: visible; opacity: 1; }

.side-drawer { position: fixed; top: 0; left: -300px; width: 280px; height: 100%; background: var(--drawer-bg); border-right: 2px solid var(--brand-gold); z-index: 5000; transition: 0.4s ease-in-out; padding: 20px; }
.side-drawer.open { left: 0; box-shadow: 50px 0 100px rgba(0,0,0,0.5); }
.drawer-header-main { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; }
.drawer-logo { font-weight: 950; font-size: 1.5rem; color: var(--brand-gold); }
.close-drawer { font-size: 32px; cursor: pointer; color: var(--text-main); transition: 0.3s; }
.close-drawer:hover { color: var(--brand-gold); transform: rotate(90deg); }
.drawer-item { display: block; padding: 15px 0; color: var(--text-main); text-decoration: none; font-weight: 900; border-bottom: 1px solid var(--border-color); text-transform: uppercase; transition: 0.3s; }
.drawer-item:hover { color: var(--brand-gold); padding-left: 10px; border-left: 3px solid var(--brand-gold); }

/* Theme Switcher */
.theme-switch-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; margin-top: 20px; border-top: 1px solid var(--brand-gold); }
.theme-switch-label { font-weight: 900; color: var(--text-main); }
.theme-switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border: 1px solid #999; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: #fff; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--brand-gold); border-color: var(--brand-gold); }
input:checked + .slider:before { transform: translateX(24px); background-color: #000; }

/* === 6. FEED CARDS === */
.content-wrapper { padding: 30px 5%; max-width: 800px; margin: 0 auto; }
.news-article { padding: 20px; margin-bottom: 20px; background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 10px var(--shadow); position: relative; }
.article-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--text-muted); font-size: 0.8rem; font-weight: bold; }

.share-btn { background: transparent; border: 1px solid var(--border-color); border-radius: 4px; padding: 4px 10px; font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 5px; color: var(--text-muted); }
.share-btn:hover { background: var(--brand-gold); color: #000; border-color: var(--brand-gold); }

.dynamic-img { width: 100%; border-radius: 8px; margin: 15px 0; border: 1px solid var(--border-color); transition: 0.5s; }
.dynamic-img:hover { transform: scale(1.01); border-color: var(--brand-gold); }

.budd-read-more { background: transparent; color: var(--brand-gold); border: 2px solid var(--brand-gold); padding: 8px 18px; border-radius: 4px; font-weight: 900; font-size: 0.7rem; cursor: pointer; margin-top: 10px; text-transform: uppercase; transition: 0.3s; }
.budd-read-more:hover { background: var(--brand-gold); color: #000; letter-spacing: 1px; }

.text-container { max-height: 0; overflow: hidden; opacity: 0; transition: 0.5s ease-out; }
.text-container.show-text { max-height: 5000px; opacity: 1; margin-top: 15px; }

/* === 7. ADMIN DASHBOARD (Centered & Fixed) === */
.admin-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9000; backdrop-filter: blur(5px); justify-content: center; align-items: center; }

.site-theme-dashboard { position: relative; background: var(--bg-main); width: 90%; max-width: 500px; padding: 25px; border-radius: 12px; border: 1px solid var(--brand-gold); color: var(--text-main); box-shadow: 0 20px 50px rgba(0,0,0,0.6); margin: auto; }

.admin-header-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.admin-brand h2 { font-size: 1.2rem; color: var(--brand-gold); margin: 0; text-transform: uppercase; letter-spacing: 1px; }

.close-btn { position: static; margin: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--text-muted); transition: 0.3s; background: none; border: none; }
.close-btn:hover { color: var(--brand-gold); transform: scale(1.1); }

.admin-tabs { display: flex; gap: 5px; margin-bottom: 20px; }
.admin-tabs button { flex: 1; padding: 10px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-muted); font-weight: 800; cursor: pointer; border-radius: 6px; }
.admin-tabs button:hover { background: var(--brand-gold); color: #000; }
.admin-tabs button.active { background: var(--brand-gold); color: #000; border-color: var(--brand-gold); }

.site-input { width: 100%; background: var(--input-bg); border: 1px solid var(--border-color); padding: 12px; margin-bottom: 12px; border-radius: 8px; font-weight: 600; color: var(--text-main); transition: 0.3s; }
.site-input:focus { border-color: var(--brand-gold); outline: none; }

/* --- THE UNLOCK BUTTON (.publish-action-btn) --- */
.publish-action-btn { 
    background: var(--brand-gold); 
    color: var(--brand-navy); 
    border: none; 
    padding: 12px; 
    width: 100%; 
    border-radius: 8px; 
    font-weight: 900; 
    cursor: pointer; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    transition: 0.3s; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.publish-action-btn:hover { 
    transform: translateY(-2px); 
    background: #fff; 
    color: var(--brand-navy);
}

.action-btn-main { width: 100%; padding: 14px; margin-top: 15px; background: var(--brand-gold); color: #000; border: none; font-size: 1rem; font-weight: 900; text-transform: uppercase; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.action-btn-main:hover { background: var(--text-main); color: #fff; }

.action-btn-sub { width: 100%; padding: 10px; margin-top: 10px; background: transparent; color: var(--text-muted); border: 1px dashed var(--border-color); font-weight: 700; text-transform: uppercase; border-radius: 8px; cursor: pointer; }
.action-btn-sub:hover { border-color: var(--brand-gold); color: var(--brand-gold); }

.backup-btn { width: 100%; padding: 12px; margin-bottom: 15px; background: #222; color: #fff; border: 1px solid #444; font-weight: bold; border-radius: 6px; cursor: pointer; }
.backup-btn:hover { background: #000; color: var(--brand-gold); border-color: var(--brand-gold); }

/* === 8. SETTINGS BUTTON (Invisible until Hover) === */
#admin-trigger { 
    position: fixed; 
    bottom: 10px; 
    right: 10px; 
    width: 30px; 
    height: 30px; 
    font-size: 18px; 
    opacity: 0.1; /* Almost Invisible */
    background: transparent; 
    color: var(--brand-gold); 
    border: none; 
    cursor: pointer; 
    z-index: 9999; 
    transition: 0.4s ease; 
}
#admin-trigger:hover { 
    opacity: 1; /* Wake up */
    transform: rotate(180deg) scale(1.2); 
    text-shadow: 0 0 10px var(--brand-gold);
}

/* === 9. FOOTER === */
.site-footer { background: var(--brand-navy); color: #fff; padding: 60px 8%; border-top: 6px solid var(--brand-gold); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; text-align: left; }
.footer-logo { font-size: 2rem; font-weight: 900; color: var(--brand-gold); transition: 0.3s; cursor: pointer; margin-bottom: 15px; display: inline-block; }
.footer-section h4 { color: var(--brand-gold); margin-bottom: 20px; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; border-bottom: 1px solid #333; display: inline-block; }
.footer-link { color: var(--brand-gold) !important; text-decoration: none; font-weight: bold; }
.premium-form input, .premium-form textarea { width: 100%; background: var(--brand-navy-light); border: 1px solid #333; padding: 12px; margin-bottom: 10px; color: #fff; border-radius: 6px; }
.premium-form button { background: var(--brand-gold); border: none; padding: 12px; width: 100%; font-weight: 900; cursor: pointer; border-radius: 6px; color: #000; }
.social-icons i { font-size: 1.5rem; margin-right: 25px; color: #fff; cursor: pointer; }
.social-icons i:hover { color: var(--brand-gold); }
/* === NEWSLETTER POP-UP === */
.newsletter-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.5s ease;
}

.newsletter-box {
    background: var(--brand-navy);
    border: 2px solid var(--brand-gold);
    width: 90%;
    max-width: 450px;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.2);
    position: relative;
}

.newsletter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--brand-gold);
    padding-bottom: 10px;
}

.newsletter-header h3 {
    color: var(--brand-gold);
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 1px;
}

.close-news {
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}
.close-news:hover { color: var(--brand-gold); }

.newsletter-box p {
    color: #ddd;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.newsletter-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: var(--brand-navy-light);
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    font-weight: bold;
}
.newsletter-form input:focus {
    border-color: var(--brand-gold);
    outline: none;
}

.newsletter-form button {
    width: 100%;
    padding: 12px;
    background: var(--brand-gold);
    color: #000;
    border: none;
    font-weight: 900;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.3s;
}
.newsletter-form button:hover {
    background: #fff;
    transform: scale(1.02);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }