/* =========================================
   FEATURE TOGGLES (HIDE/SHOW FEATURES)
   To reactivate, simply comment out or remove 
   the relevant selector below.
   ========================================= */

/* Hide Article Action Bar Items (Colleague & Reading List) */
.action-btn[data-action="Email a colleague"],
.action-btn[data-action="Add to reading list"] {
    display: none !important;
}

/* Base styles and variables */
:root {
    --theme-primary: #549e60;
    --theme-primary-dark: #3b7344;
    --theme-primary-light: #73ba80;
    --theme-background: linear-gradient(135deg, #3b7344 0%, #549e60 50%, #73ba80 100%);
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --hover-effect: rgba(84, 158, 96, 0.05);
    
    /* Typography */
    --font-main: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --bg-light: #1a1a1a;
    --bg-white: #121212;
    --border-color: #444444;
    --border-muted: #333333;
    --hover-effect: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    width: 100%;
}

a {
    color: var(--theme-primary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--theme-primary-light);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none; /* Hidden by default — click only */
    position: absolute;
    background-color: var(--theme-primary-light);
    min-width: 200px;
    box-shadow: 0px 8px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    top: 100%;
    left: 0;
    border-radius: 4px;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: white !important;
    padding: 12px 16px !important;
    text-decoration: none;
    display: block !important;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.2) !important;
    font-weight: 500 !important;
    position: relative;
    z-index: 1;
}

/* Kill the underline pseudo-element inherited from .nav-links a */
.dropdown-content a::after {
    display: none !important;
}

.dropdown-content a:last-child {
    border-bottom: none !important;
}

.dropdown-content a:hover {
    background-color: var(--theme-primary-dark);
    color: white !important;
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: var(--theme-primary); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary-dark); 
}

/* Top Advertisement Banner */
.top-banner {
    background-color: #f4f0ec;
    padding: 15px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.top-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ad-tag {
    font-size: 10px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.ad-image-placeholder {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #e8dbcc;
    padding: 10px 30px;
    border-radius: 4px;
}

.ad-image-placeholder h2 {
    font-weight: 400;
    font-family: Georgia, serif;
    color: #4a4a4a;
}
.ad-image-placeholder i {
    font-style: italic;
}
.ad-image-placeholder span {
    font-size: 14px;
    color: #666;
}

/* Brand Bar */
.brand-bar {
    background: var(--theme-background);
    padding: 38px 0; 
    color: var(--text-light);
}

.brand-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.logo a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo a:hover {
    opacity: 0.85;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.auth-btn {
    color: #000000;
    background: #ffffff;
    border: 2px solid #a855f7;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 25px;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-btn:hover {
    background: #f3e8ff;
    border-color: #9333ea;
    color: #000000;
    transform: translateY(-1px);
}

.auth-btn.outline {
}

.header-menu-container {
    position: relative;
    display: inline-block;
}

.header-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 250px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 10px 0;
    display: none;
    z-index: 6000;
    border: 1px solid var(--border-color);
}

/* Hero Logos / Ad Space (Global) */
.hero-logos {
    display: flex;
    gap: 30px;
    align-items: center;
    padding-right: 20px;
    flex-shrink: 0;
}

/* Global Settings Styles */

.header-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.header-dropdown a:hover {
    background: var(--bg-light);
    color: var(--theme-primary);
}

.header-dropdown a i {
    width: 16px;
    color: var(--theme-primary);
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

@media (max-width: 900px) {
    .brand-bar .logo {
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .brand-bar .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo {
        font-size: 18px !important;
        text-align: center;
        line-height: 1.3;
    }
    
    .auth-links {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    
    .auth-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
    }
}

/* Profile Dropdown Styles */
.user-profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 7000; 
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 12px 6px 8px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.profile-toggle:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.profile-circle {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--theme-secondary), var(--theme-primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    padding: 10px 0;
    display: none;
    flex-direction: column;
    z-index: 8000; 
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
    pointer-events: auto; 
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-menu.show {
    display: flex;
}

.menu-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;
}

.menu-header-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
    display: block;
}

.menu-header-email {
    font-size: 12px;
    color: var(--text-muted);
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: rgba(84, 158, 96, 0.08);
    color: var(--theme-primary);
}

.menu-item i {
    width: 18px;
    color: var(--theme-primary);
    font-size: 14px;
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.menu-item.logout-item {
    color: #e74c3c;
}

.menu-item.logout-item i {
    color: #e74c3c;
}


/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

[data-theme="dark"] .theme-toggle-btn i::before {
    content: "\f185"; 
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--theme-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--theme-primary-dark);
    transform: translateY(-5px);
}

/* Dark mode specific adjustments */
[data-theme="dark"] .main-nav {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] .article-card {
    background: #1e1e1e;
}

[data-theme="dark"] .sidebar-nav li a:hover,
[data-theme="dark"] .sidebar-nav li a.active {
    background-color: rgba(255,255,255,0.05);
}

/* Profile Page Styles */
.profile-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.profile-section {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.profile-section h2 {
    font-size: 22px;
    color: var(--theme-primary-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--theme-primary-light);
    padding-bottom: 10px;
}

/* ── CMS Content: Theme-styled Headings ────────────────────── */
#dynamicPageContent h1,
#dynamicPageContent h2,
#dynamicPageContent h3 {
    font-family: var(--font-main);
    line-height: 1.3;
    font-weight: 700;
}

#dynamicPageContent h1 {
    font-size: 26px;
    color: var(--theme-primary-dark);
    border-bottom: 2px solid var(--theme-primary-light);
    padding-bottom: 8px;
    margin: 28px 0 16px;
}

#dynamicPageContent h2 {
    font-size: 20px;
    color: var(--theme-primary);
    margin: 22px 0 10px;
}

#dynamicPageContent h3 {
    font-size: 16px;
    color: var(--theme-primary-dark);
    font-weight: 600;
    margin: 18px 0 8px;
}

#dynamicPageContent p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--text-main);
}

/* Quill toolbar: highlight H1/H2/H3 buttons green */
#quill-custom-toolbar .ql-header {
    font-weight: 700;
    font-family: var(--font-main);
    color: #549e60 !important;
    font-size: 13px;
    width: auto;
    padding: 0 6px;
}
#quill-custom-toolbar .ql-header:hover,
#quill-custom-toolbar .ql-header.ql-active {
    background: rgba(84, 158, 96, 0.12) !important;
    border-radius: 4px;
}

/* High-Fidelity Account Menu (Light Theme) */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-trigger i {
    font-size: 24px;
    color: white;
}

.profile-dropdown-content {
    display: none;
    position: absolute;
    right: -10px;
    top: calc(100% + 15px);
    background: white;
    width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border-radius: 12px;
    z-index: 2000;
    padding: 0;
    overflow: hidden;
    color: #444;
    animation: slideDownAccount 0.2s ease-out;
}

.profile-dropdown:hover .profile-dropdown-content {
    display: block;
}

/* Account Card Header */
.account-card-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.account-card-header .brand {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-card-header .sign-out-link {
    font-size: 13px;
    color: #0078d4;
    text-decoration: none;
    font-weight: 600;
}

.account-card-header .sign-out-link:hover {
    text-decoration: underline;
}

/* Identity Section */
.account-card-identity {
    padding: 25px 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.avatar-large {
    width: 68px;
    height: 68px;
    background: #f3f3f3;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.identity-info {
    flex: 1;
}

.identity-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #201f1e;
}

.identity-email {
    font-size: 13px;
    color: #605e5c;
    margin-bottom: 8px;
    word-break: break-all;
}

.manage-account-link {
    font-size: 13px;
    color: #0078d4;
    text-decoration: none;
    display: inline-block;
}

.manage-account-link:hover {
    text-decoration: underline;
}

/* Action Menu Items */
.account-card-actions {
    padding: 8px 0 15px 0;
    border-top: 1px solid #f0f0f0;
}

.account-card-actions a, .account-card-actions button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #323130;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
}

.account-card-actions a:hover {
    background: #f3f2f1;
}

.account-card-actions i {
    width: 18px;
    font-size: 16px;
    color: #605e5c;
}

@keyframes slideDownAccount {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.divider { height: 1px; background: #f0f0f0; margin: 8px 0; }

.reading-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.reading-item:hover {
    border-color: var(--theme-primary);
    background-color: var(--bg-light);
}

.reading-item-info h4 {
    font-size: 17px;
    margin-bottom: 5px;
}

.reading-item-info p {
    font-size: 14px;
    color: var(--text-muted);
}

.reading-item-actions {
    display: flex;
    gap: 15px;
}

.btn-remove {
    background: none;
    border: none;
    color: #f5222d;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-remove:hover {
    text-decoration: underline;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    padding: 15px;
    border-left: 4px solid var(--theme-primary);
    background: #f9fdf9;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
}

.notification-item.unread {
    border-left-color: var(--theme-primary-dark);
    background: #edf7ed;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* Main Navigation */
.main-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 0;
    position: relative;
    z-index: 9000;
    transition: box-shadow var(--transition-speed) ease;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 6px;
    position: relative;
    transition: all var(--transition-speed) ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12px;
    width: 0;
    height: 3px;
    background-color: var(--theme-primary);
    transition: width var(--transition-speed) ease;
}

.nav-links a:hover {
    background-color: rgba(84, 158, 96, 0.1);
    color: var(--theme-primary);
}

.nav-links a:hover::after {
    width: calc(100% - 24px);
}

/* Active nav link for current page */
.nav-links a.nav-active {
    color: var(--theme-primary);
    font-weight: 600;
}

.nav-links a.nav-active::after {
    width: calc(100% - 24px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-subscribe-btn, .nav-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--theme-primary);
    color: white !important;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(84, 158, 96, 0.2);
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1.2;
}

.nav-subscribe-btn:hover, .nav-search-btn:hover {
    background: var(--theme-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(84, 158, 96, 0.3);
}

.nav-subscribe-btn i, .nav-search-btn i {
    font-size: 13px;
}

.advanced-search {
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-muted);
}

/* Hero Section */
.hero-section {
    background: var(--theme-background);
    color: var(--text-light);
    padding: 30px 0 0 0; 
}

.hero-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.magazine-cover {
    flex-shrink: 0;
}

.cover-image {
    width: 150px; 
    height: 210px; 
    background: #EBE1F5;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    transform: translateY(20px);
}

.cover-title {
    color: #444;
    font-weight: 700;
    letter-spacing: 2px;
}

.issue-details h1 {
    font-size: 2.25rem; 
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.volume-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.volume-row h2 {
    font-size: 1.35rem; 
    font-weight: 500;
    opacity: 0.95;
    margin: 0;
}

.volume-info {
    font-size: 1.1rem;
    opacity: 0.8;
}

.editors {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    background: rgba(255,255,255,0.1);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    max-width: 800px;
    margin-bottom: 30px;
}

.hero-tabs {
    display: flex;
    gap: 30px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    position: relative;
    opacity: 0.7;
    transition: opacity var(--transition-speed);
}

.tab-btn:hover {
    opacity: 1;
}

.tab-btn.active {
    opacity: 1;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--text-light);
    border-radius: 2px 2px 0 0;
}

/* Volume Navigation Buttons */
.vol-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.vol-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.vol-nav-btn:active {
    transform: translateY(0);
}

.vol-nav-btn i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.vol-nav-btn:hover .fa-chevron-left {
    transform: translateX(-3px);
}

.vol-nav-btn:hover .fa-chevron-right {
    transform: translateX(3px);
}

.vol-nav-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

/* Main Content Layout */
.page-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 80px;
}

/* Sidebar Left */
.sidebar-nav {
    list-style: none;
    position: sticky;
    top: 100px;
}

.sidebar-nav li a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    color: var(--text-muted);
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: all var(--transition-speed);
    pointer-events: auto;
}

.sidebar-nav li a:hover {
    background-color: var(--hover-effect);
    color: var(--theme-primary);
    pointer-events: auto;
}

.sidebar-nav li a.active {
    color: var(--theme-primary);
    font-weight: 600;
    border-left-color: var(--theme-primary);
    background-color: var(--hover-effect);
    pointer-events: auto;
}

/* Main Content Area */
.article-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.action-buttons button {
    background: none;
    border: none;
    color: var(--theme-primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-speed);
}

.action-buttons button:hover {
    color: var(--theme-primary-light);
}

.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--theme-primary);
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--theme-primary);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Article List */
.group-title {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 600;
}

.article-card {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: var(--theme-primary);
}

.article-info h4 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-info h4 a {
    color: var(--theme-primary);
}

.authors {
    color: var(--text-muted);
    font-size: 15px;
}

.quick-action-btn:hover {
    color: var(--theme-primary) !important;
    background-color: var(--hover-effect) !important;
    border-radius: 4px;
}

.quick-action-btn i {
    font-size: 14px;
}

/* Share Menu Styles */
.share-container {
    position: relative;
    display: inline-block;
}

.share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 8px;
    z-index: 100;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 10px;
    animation: slideUpShare 0.2s ease-out;
    pointer-events: auto;
}

.share-menu.show {
    display: flex;
}

@keyframes slideUpShare {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.email { background: #EA4335; }

/* Sidebar Right - Newsletter Card */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.newsletter-card {
    background: #fdfdfd;
    padding: 30px 25px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.newsletter-card h3 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 12px;
    font-weight: 700;
}

.newsletter-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.5;
}

.vertical-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vertical-form input {
    padding: 12px 18px;
    border: 1.5px solid #e9ecef;
    border-radius: 30px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vertical-form input:focus {
    border-color: var(--theme-primary);
}

.subscribe-btn {
    background: var(--theme-primary);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.subscribe-btn:hover {
    background: var(--theme-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(68, 186, 186, 0.25);
}

.ad-panel {
    border: 1px solid var(--border-color);
    padding: 25px;
    text-align: center;
    position: relative;
    background: #fdfdfd;
    border-radius: 12px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-nav {
        display: none !important;
    }
    
    .brand-bar .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .auth-links {
        justify-content: center;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        padding-bottom: 40px;
    }



    .hero-tabs {
        justify-content: center;
    }
    
    .magazine-cover {
        margin-bottom: 20px;
    }

    .issue-details {
        width: 100%;
        min-width: 0 !important;
    }

    .issue-details h1 {
        min-width: 0 !important;
        font-size: 28px !important;
        height: auto !important;
    }

    .fab-wrapper {
        display: flex;
    }

    /* Page container grid collapse */
    .page-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .sidebar-nav {
        position: static;
        margin-bottom: 30px;
        min-width: 0 !important;
        width: 100% !important;
    }

    .search-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 0 0 20px 0;
        min-width: 0 !important;
        width: 100% !important;
    }

    .refinement-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .refinement-input-wrapper {
        width: 100% !important;
    }
}

/* FAB wrapper visible on all screen sizes */

/* Auth Section Styles */
.auth-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    background-color: var(--bg-light);
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-white);
    max-width: 700px;
    width: 100%;
    padding: 60px;


    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

/* Professional Modal & Dialogue Styles */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 650px; 
    border-radius: 24px; 
    box-shadow: 0 25px 70px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: translateY(20px);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 30px;
    top: 25px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: #f5f5f5;
    color: #333;
}

.modal h2 {
    font-size: 28px;
    color: var(--theme-primary);
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal p.subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 35px;
    line-height: 1.5;
}

/* Modal Form Premium Styles */
.modal input[type="text"],
.modal textarea,
.modal select {
    background: #fdfdfd;
    border: 1.5px solid #e2e8f0;
    padding: 14px 18px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.modal input[type="text"]:focus,
.modal textarea:focus,
.modal select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 4px rgba(68, 186, 186, 0.15);
    background: #fff;
    outline: none;
}

.modal label {
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px !important;
}

.modal .auth-btn {
    padding: 16px 24px;
    font-size: 16px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.modal .auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.modal .auth-btn.outline {
    border: 1.5px solid #e2e8f0;
    color: #4a5568;
}

.modal .auth-btn.outline:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.auth-card h2 {
    font-size: 24px;
    color: var(--theme-primary-dark);
    margin-bottom: 5px;
    text-align: center;
}

.auth-card p.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    margin-top: 25px;
}

#registrationFields {
    animation: fadeIn 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(84, 158, 96, 0.15);
}

.auth-btn-primary {
    background-color: var(--theme-primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.auth-btn-primary:hover {
    background-color: var(--theme-primary-dark);
}

.auth-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.auth-switch {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-switch span {
    color: var(--theme-primary);
    font-weight: 600;
    cursor: pointer;
}

.auth-switch span:hover {
    text-decoration: underline;
}

.auth-error {
    background-color: #fff1f0;
    color: #f5222d;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #ffa39e;
    margin-bottom: 20px;
    display: none;
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

/* Toast for non-nav triggers */
.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    font-size: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
    from {bottom: 0; opacity: 0;} 
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
    from {bottom: 30px; opacity: 1;} 
    to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* Skeleton Loader Animation */
@keyframes skeleton-loading {
    0% { background-color: rgba(255, 255, 255, 0.1); }
    50% { background-color: rgba(255, 255, 255, 0.2); }
    100% { background-color: rgba(255, 255, 255, 0.1); }
}

/* Skeleton Loading System */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation-duration: 1.2s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: shimmer;
    animation-timing-function: linear;
}

[data-theme="dark"] .skeleton {
    background: #2a2a2a;
    background-image: linear-gradient(to right, #2a2a2a 0%, #333333 20%, #2a2a2a 40%, #2a2a2a 100%);
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    width: 100%;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-rect {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.skeleton-circle {
    border-radius: 50%;
}

/* Specific Page Skeletons */
.issue-skeleton-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.issue-skeleton-card .skeleton-rect {
    width: 100%;
    aspect-ratio: 3/4;
    margin-bottom: 15px;
}

.future-skeleton-block {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border-left: 5px solid #eee;
    padding: 25px 30px;
    margin-bottom: 30px;
}

[data-theme="dark"] .future-skeleton-block {
    background: #1e1e1e;
    border-left-color: #333;
}

/* CORRECTED: Remove skeleton styles but show content */
.loaded .skeleton,
.loaded .skeleton-text,
.loaded .skeleton-title {
    animation: none !important;
    background: transparent !important;
    background-image: none !important;
    height: auto !important;
    width: auto !important;
    min-width: 0 !important;
}


/* --- Search Refactor (Clinics in Perinatology Style) --- */

.search-page-main {
    max-width: 1200px !important;
}

.search-results-summary {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 500;
}

.search-grid {
    display: block !important;
    gap: 40px;
    align-items: start;
}

/* Sidebar Filters - Enhanced Professional Look */
.search-sidebar {
    position: sticky;
    top: 20px;
    background: #fdfdfd;
    padding: 0 15px 20px 0;
    border-right: 1px solid #eee;
}

.filter-title {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    color: var(--text-main);
}

.filter-group {
    margin-bottom: 0;
    border-bottom: 1px dashed #ccc;
}

.filter-group-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    background: none;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-main);
}

.filter-group-content {
    padding-bottom: 15px;
}

.filter-item {
    display: block;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.filter-item:hover {
    color: var(--theme-primary);
}

.filter-item input {
    margin-right: 8px;
}

/* Main Search Area */
.search-refinement-bar {
    background: white;
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.refinement-form {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%; /* Ensure it fills the bar */
}

.refinement-input-wrapper {
    flex: 2; /* Increased priority */
    display: flex;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.refinement-input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
}

.refinement-submit-btn {
    background: #444;
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
}

.refinement-select {
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    min-width: 350px; /* Further widened as requested */
}

.advanced-search-link {
    font-size: 13px;
    color: #0056b3;
    text-decoration: none;
}

/* Tabs */
.search-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.search-tab {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    color: #555;
    font-weight: 500;
}

.search-tab.active {
    background: white;
    color: var(--theme-primary);
    border-bottom: 2px solid var(--theme-primary);
}

/* Batch Actions */
.batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #666;
    margin-bottom: 25px;
    padding: 0 5px;
}

.batch-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.batch-left label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.batch-left a {
    color: #0056b3;
    text-decoration: none;
}

.batch-right a {
    color: #444;
    font-weight: bold;
}

/* Result Cards - Professional Academic Style */
.academic-search-card {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
}

.academic-card-checkbox {
    margin-top: 5px;
}

.academic-card-content {
    flex: 1;
}

.article-type-label {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.academic-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.academic-card-title a {
    color: #800000; /* Deep Maroon */
    text-decoration: none;
}

.academic-card-title a:hover {
    text-decoration: underline;
}

.academic-citation {
    font-size: 13px;
    font-style: italic;
    color: #444;
    margin-bottom: 6px;
}

.academic-authors {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

.academic-card-actions {
    display: flex;
    gap: 20px;
    font-size: 12px;
}

.academic-action-link {
    color: #0056b3;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.academic-action-link i {
    font-size: 14px;
}

.academic-action-link.pdf i {
    color: #c00;
}

@media (max-width: 900px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
    .search-sidebar {
        display: none;
    }
}

/* Card Hover state for articles */
.article-card.clickable-card {
    cursor: pointer;
    transition: all 0.2s ease;
}
.article-card.clickable-card:hover {
    background-color: var(--hover-effect);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
}
[data-theme="dark"] .article-card.clickable-card:hover {
    background-color: #2a2a2a;
}
.article-card.clickable-card:active,
.article-card.clickable-card.active {
    transform: translateY(0) scale(0.99);
    background-color: rgba(84, 158, 96, 0.15);
    border-color: var(--theme-primary-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}
[data-theme="dark"] .article-card.clickable-card:active,
[data-theme="dark"] .article-card.clickable-card.active {
    background-color: #333333;
    border-color: var(--theme-primary);
}

/* Announcements Layout */
.announcement-card {
    flex: 0 0 calc(25% - 15px);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.announcement-card:hover {
    transform: translateY(-4px);
}
.announcement-card:hover img {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.announcement-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}
@media (max-width: 900px) {
    .announcements-carousel {
        flex-direction: column !important;
        overflow-x: visible !important;
    }
    .announcement-card {
        flex: 1 1 auto;
        width: 100%;
        margin-bottom: 20px;
    }
    .announcement-img-wrap {
        aspect-ratio: 16/9;
    }
}


/* Global Sticky Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    overflow: visible;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Subscription Modal Specific Formatting */
#subscribeModal .modal-content {
    max-width: 650px !important;
    padding: 35px 40px;
    border-radius: 32px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
}

#modalNewsletterForm {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    column-gap: 25px;
    align-items: start;
}

#modalNewsletterForm > div:nth-child(1),
#modalNewsletterForm > div:nth-child(2) {
    display: contents !important;
}

#modalNewsletterForm > div,
#modalNewsletterForm > div:nth-child(1) > div,
#modalNewsletterForm > div:nth-child(2) > div {
    margin-bottom: 0 !important;
}

#modalNewsletterForm > div:nth-child(5) {
    grid-column: 1 / -1;
}

#modalNewsletterForm > button {
    grid-column: 1 / -1;
    margin-top: 15px !important;
    padding: 14px;
    font-size: 16px;
}

#modalNewsletterForm > p {
    grid-column: 1 / -1;
    margin-top: 0 !important;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
}

/* Profile Page: Remove Button Styling */


/* Profile Page: Remove Button Styling */
.btn-remove {
    background: #fff1f0;
    border: 1px solid #ffa39e;
    color: #f5222d;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    width: fit-content;
}

.btn-remove:hover {
    background: #f5222d;
    color: white;
    border-color: #f5222d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 34, 45, 0.2);
}

.btn-remove i {
    font-size: 12px;
}

/* Modal and Dropdown Dark Mode fixes */
[data-theme="dark"] .dropdown-menu {
    background: #1e1e1e;
    border-color: #333;
}
[data-theme="dark"] .menu-header-name { color: #fff; }
[data-theme="dark"] .menu-item { color: #ccc; }
[data-theme="dark"] .btn-remove {
    background: rgba(245, 34, 45, 0.1);
}

/* --- Floating Quick-Nav System (New) --- */
.fab-wrapper {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    z-index: 5000;
    pointer-events: none;
}

.fab-options {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.fab-wrapper.active .fab-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-option-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.fab-label {
    background: #ffffff;
    color: #000000;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 2px solid #a855f7; /* Matching the purple theme */
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
    touch-action: manipulation;
    pointer-events: auto;
}

.fab-label:hover {
    background: #f3e8ff;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.2);
}

.sub-fab {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    background: #a855f7;
    touch-action: manipulation;
    pointer-events: auto;
}

.sub-fab.green {
    background: #549e60;
}

.sub-fab.blue {
    background: #2980b9;
}

.sub-fab:hover {
    transform: rotate(15deg) scale(1.1);
}

/* Master FAB menu toggle button */
.master-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5001;
    pointer-events: auto;
    touch-action: manipulation;
}

.master-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

/* FAB Backdrop overlay */
.fab-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 4999;
    display: none;
    pointer-events: auto;
}

/* Back to Top persists separately */
#backToTop.back-to-top {
    display: flex !important;
    position: relative;
    bottom: 0;
    right: 0;
    margin-top: 10px;
}

@media (max-width: 992px) {
    .fab-wrapper {
        left: 20px;
        bottom: 20px;
    }
    .fab-label {
        font-size: 12px;
        padding: 6px 14px;
    }
    .sub-fab {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .fab-wrapper {
        left: 14px;
        bottom: 14px;
    }

    .fab-option-item {
        gap: 10px;
    }

    .fab-label {
        max-width: min(68vw, 230px);
        white-space: normal;
        line-height: 1.2;
        text-align: left;
    }
}

/* =========================================
   FOOTER SECTION
   ========================================= */
.site-footer {
    background: #ffffff;
    padding: 60px 0 0 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
<<<<<<< Updated upstream
    padding-bottom: 40px;
    width: 100%;
}

.footer-col {
    text-align: left;
}

.footer-col h3 {
    color: var(--theme-primary);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-col p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    max-width: 100%;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--theme-primary);
}

.footer-bottom {
    border-top: 1px solid #f0f0f0;
    padding: 30px 0;
}

.bottom-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.bottom-flex p {
    font-size: 13px;
    color: #888;
    text-align: center;
}

.footer-logo-small {
    position: absolute;
    left: 20px;
    width: 32px;
    height: 32px;
    background: #333;
    color: white;
    font-family: serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    .footer-logo-small {
        display: none;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding-top: 30px;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 15px;
    }
    .footer-col h3 {
        margin-bottom: 10px;
        font-size: 13px;
    }
    .footer-col p, .footer-col a {
        font-size: 11px;
    }
}
