@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
    /* 🎨 Light Theme Colors */
    --color-bg-light: #edf5fa;         /* Light background (main background) - light blue tint */
    --color-text-primary: #205781;     /* Main body text - deep blue */
    --color-heading: #1a7fac;          /* Headings / Titles / Nav - medium blue */
    --color-accent: #4db6e2;           /* Buttons, Highlights, Cards - vibrant blue */
    --color-border-light: #b8d8e8;     /* Borders, dividers, outlines - soft blue */
    
  
    /* 🌙 Dark Theme Colors */
    --color-bg-dark: #0a2c42;          /* Dark background - deep navy */
    --color-card-dark: #153e59;        /* Card background in dark mode - midnight blue */
    --color-text-light: #e8f4fc;       /* Main text in dark mode - icy blue white */
    --color-text-secondary: #a7c6db;   /* Lighter/secondary text in dark mode - pale blue */
    --color-cta-dark: #3d99c5;         /* CTA buttons / links in dark mode - mid blue */
    --color-accent-dark: #5dbfef;      /* Accent elements in dark mode - bright blue */
    --color-border-dark: #2a5574;      /* Borders and dividers in dark mode - muted blue */
    --color-hover-bg-dark: rgba(93, 191, 239, 0.15); /* Hover / Highlight background in dark - transparent blue */
  
    /* ❤️ Like Button */
    --color-heart: #ff5a76;            /* Heart icon color - coral pink */
  
    /* 🖋 Fonts (not CSS variables but just as a guide here) */
    /* Georgia - for body text (serif)
       Montserrat - for headings/nav (sans-serif) */
  }

html {
    font-size: 17px;
}

body {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    color: var(--color-text-primary);
    background-color: var(--color-bg-light);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
}

h1, h2, nav {
    font-family: 'Montserrat', sans-serif;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000; /* Ensure header is above page content and overlays */
    transition: all 0.3s ease;
}

/* Ensure header never creates its own scroll area */
.site-header,
.site-header .container,
.main-nav {
    overflow: visible !important;
}

/* Hide any accidental scrollbars within the fixed header on all browsers */
.site-header,
.site-header * {
    -ms-overflow-style: none; /* IE and old Edge */
    scrollbar-width: none;   /* Firefox */
}
.site-header::-webkit-scrollbar,
.site-header *::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Global portal container for header dropdowns to avoid clipping by overflow */
#dropdown-portal {
    position: fixed; /* anchored to viewport */
    inset: 0;        /* cover entire viewport for positioning math */
    z-index: 4500;   /* above header, search suggestions, and nav-list */
    pointer-events: none; /* allow clicks to pass unless on child */
}
#dropdown-portal > .dropdown-menu {
    pointer-events: auto; /* enable interaction with the menu */
}

body.dark-theme .site-header {
    background-color: var(--color-bg-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    max-height: 70px;
    overflow: hidden;
    flex-shrink: 0;
}

.logo {
    width: 150px;
    height: auto;
    object-fit: contain;
    margin-right: 15px;
}

.tagline {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-style: italic;
    font-size: 14px;
    color: var(--color-text-primary);
    margin: 0;
}

/* Navigation */
.main-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-grow: 1;
    width: auto;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 12px;
    display: block;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--accent-color, #ff4500);
    transform: translateY(-2px);
}

body.dark-theme .nav-link {
    color: var(--color-text-light);
}

body.dark-theme .nav-link:hover {
    color: var(--color-accent-dark);
    background-color: rgba(93, 191, 239, 0.1);
}

/* ========== Header Logo: subtle home hint & motion cues ========== */
.logo-link {
    position: relative;
    display: inline-block;
}

/* One-time gentle pulse on page load to hint it's clickable */
.logo-home-pulse-once .logo {
    animation: logoHomePulse 900ms ease-out 1;
}

/* Continuous gentle pulse (infinite loop) */
.logo-home-pulse .logo {
    animation: logoHomePulse 2200ms ease-in-out infinite;
}

/* Hover/focus: tiny lift + scale for smooth feedback */
.logo-link:hover .logo,
.logo-link:focus-visible .logo {
    transform: translateY(-1px) scale(1.03);
    transition: transform 220ms ease;
}

/* Accessible focus ring on the link wrapper */
.logo-link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 6px;
}

/* Small "Home" pill that fades in on hover/focus */
.logo-link::after {
    content: "Home";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 6px);
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 999px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 10;
}
.logo-link:hover::after,
.logo-link:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 2px);
}

@keyframes logoHomePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(79,172,254,0)); }
    50% { transform: scale(1.045); filter: drop-shadow(0 0 8px rgba(79,172,254,0.35)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(79,172,254,0)); }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .logo-home-pulse-once .logo,
    .logo-link:hover .logo,
    .logo-link:focus-visible .logo {
        animation: none !important;
        transform: none !important;
    }
    .logo-link::after { transition: none; }
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 0.6em;
    margin-left: 5px;
    vertical-align: middle;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 150px;
    width: auto;
    white-space: nowrap;
    padding: 8px 0;
    list-style: none;
    z-index: 3500; /* Render above main content under fixed header */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    min-width: 180px;
    width: auto;
}

.dropdown-menu a {
    color: var(--color-text-primary);
    text-decoration: none;
    padding: 8px 15px;
    display: block;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: rgba(152, 210, 192, 0.1);
    color: var(--color-text-primary);
}

body.dark-theme .dropdown-menu {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .dropdown-menu a {
    color: #ffffff !important;
}

body.dark-theme .dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #5dbfef !important;
}

/* Theme Toggle */
.theme-toggle {
    margin-left: 15px;
    order: 1;
    display: flex;
    align-items: center;
}

#theme-toggle-btn {
    background: linear-gradient(to right, var(--color-bg-light) 50%, var(--color-bg-dark) 50%);
    border: none;
    height: 28px;
    width: 60px;
    border-radius: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    position: relative;
    transition: all 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    order: 2;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: "";
    display: block;
    background-color: var(--color-heading);
    height: 3px;
    width: 25px;
    transition: all 0.3s ease;
}

.hamburger::before {
    transform: translateY(-8px);
}

.hamburger::after {
    transform: translateY(5px);
}

/* Left side border (always visible) */
#theme-toggle-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    border-top: 2px solid var(--color-border-light);
    border-bottom: 2px solid var(--color-border-light);
    border-left: 2px solid var(--color-border-light);
    border-radius: 28px 0 0 28px;
    box-sizing: border-box;
    z-index: 0;
}

/* Circle indicator */
#theme-toggle-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 25%;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background-color: white;
    transition: all 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    z-index: 2;
}

body.dark-theme #theme-toggle-btn::after {
    left: 73%;
    background-color: var(--color-card-dark);
}

body.dark-theme .hamburger,
body.dark-theme .hamburger::before,
body.dark-theme .hamburger::after {
    background-color: var(--color-text-light);
}

/* Right side border only in dark mode */
body.dark-theme #theme-toggle-btn .dark-icon::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    border-top: 2px solid var(--color-border-dark);
    border-bottom: 2px solid var(--color-border-dark);
    border-right: 2px solid var(--color-border-dark);
    border-radius: 0 34px 34px 0;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 0;
}

#theme-toggle-btn:hover {
    box-shadow: 0 0 8px var(--color-accent);
}

.toggle-icon {
    font-size: 16px;
    z-index: 1;
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-icon {
    color: var(--color-text-primary);
}

.dark-icon {
    color: var(--color-text-light);
}

/* Icon styles */
.nav-link i, 
.dropdown-menu a i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.dropdown-menu a i {
    color: var(--color-accent);
}

body.dark-theme .dropdown-menu a i {
    color: var(--color-accent-dark);
}

/* Responsive */
@media (min-width: 769px) and (max-width: 900px) {
    /* Container & Header */
    .site-header .container {
        justify-content: space-between;
        padding: 0 15px;
        flex-wrap: nowrap;
    }
    
    /* Logo */
    .logo-container {
        max-width: 25%;
        flex-shrink: 0;
    }
    
    .logo {
        width: 130px;
    }
    
    /* Navigation */
    .main-nav {
        flex-grow: 1;
        justify-content: flex-end;
    }
    
    .nav-list {
        gap: 5px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .nav-link i {
        margin-right: 4px;
        width: 14px;
        font-size: 12px;
    }
    
    /* Dropdown */
    .dropdown-menu {
        min-width: 160px;
    }
    
    .dropdown-menu a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    /* Theme toggle */
    .theme-toggle {
        margin-left: 8px;
    }
    
    #theme-toggle-btn {
        width: 60px;
        height: 28px;
    }
    
    #theme-toggle-btn::after {
        height: 22px;
        width: 22px;
    }
    
    .toggle-icon {
        width: 30px;
        height: 28px;
        font-size: 14px;
    }
    
    body.dark-theme #theme-toggle-btn::after {
        left: 73%;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 12px 0;
    }
    
    .site-header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
    }
    
    .logo-container {
        margin: 0;
        justify-content: flex-start;
        max-height: 50px;
    }
    
    .logo {
        width: 120px;
    }
    
    .main-nav {
        justify-content: flex-end;
        width: auto;
    }
    
    .nav-list {
        display: none;
        position: fixed; /* detach from header container to avoid clipping */
        top: var(--mobile-nav-top, 72px); /* computed via JS to match header height */
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        width: 100%;
        margin-top: 0;
        z-index: 3200; /* ensure menu overlays content and suggestions */
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 8px 8px;
        padding: 10px 0;
        max-height: calc(100vh - var(--mobile-nav-top, 72px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-list > li {
        width: 100%;
        text-align: left;
    }
    
    .search-container {
        margin: 0;
        width: 100%;
        padding: 0; /* allow dropdown to span full burger menu width */
    }
    
    .search-form {
        width: 100%;
        margin: 10px 0;
        padding: 5px 10px;
        position: relative;
        z-index: 1100; /* keep above nav-list background */
    }
    
    .search-input {
        width: 100%;
        padding: 8px 12px 8px 40px;
    }
    
    .search-button {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
    }
    
    .search-button > i {
        position: static;
        color: var(--color-text-secondary);
    }
    
    .search-input::placeholder {
        padding-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: relative;
        margin-right: 0;
        margin-left: 10px;
        top: auto;
        right: auto;
        z-index: 4200; /* above search form (1100) and any overlays */
        order: 2;
    }
    
    /* Mobile menu toggle active state */
    .mobile-menu-toggle.active .hamburger {
        background-color: transparent;
    }
    
    .mobile-menu-toggle.active .hamburger::before {
        transform: translateY(0) rotate(45deg);
    }
    
    .mobile-menu-toggle.active .hamburger::after {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Place in-header user dropdown next to theme toggle on mobile */
    .main-nav > .user-dropdown.in-header {
        order: 2; /* before the burger which is also order:2 but appears later in DOM */
        margin-left: 8px;
    }
    .main-nav > .user-dropdown.in-header .header-text-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    /* Header user dropdown menu styles for mobile */
    .main-nav > .user-dropdown.in-header .user-dropdown-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        width: 90% !important;
        max-width: 320px !important;
        z-index: 5000 !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translate(-50%, -60%) !important;
        transition: all 0.3s ease !important;
        pointer-events: auto !important;
    }
    
    .main-nav > .user-dropdown.in-header.active .user-dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .theme-toggle {
        position: relative;
        margin-left: 0;
        margin-right: 0;
        top: auto;
        right: auto;
        order: 1;
    }
    
    .nav-link {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: #f5f5f5;
        width: 100%;
        display: none;
        border-radius: 0;
        padding-left: 20px;
        margin: 0;
        border-left: 3px solid var(--color-accent);
        white-space: normal;
    }
    
    .dropdown-menu a {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-toggle::after {
        float: none;
        margin-left: 8px;
    }
    
    #theme-toggle-btn {
        height: 26px;
        width: 52px;
    }
    
    .toggle-icon {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    #theme-toggle-btn::after {
        height: 20px;
        width: 20px;
    }
    
    body.dark-theme #theme-toggle-btn::after {
        left: 72%;
    }
    
    body.dark-theme .nav-list {
        background-color: var(--color-card-dark);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    body.dark-theme .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.05);
        border-left: 3px solid var(--color-accent-dark);
    }
    
    .dropdown-menu a i {
        width: 20px;
        margin-right: 10px;
    }

    /* Add these rules INSIDE the existing @media (max-width: 768px) block */

    .post-actions-container {
        flex-direction: column; /* Stack actions on smaller screens */
        align-items: flex-start;
    }
    .post-actions-container .post-share {
        margin-top: 10px; /* Add space when stacked */
    }

    /* User dropdown menu mobile styles */
    .user-dropdown-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 300px !important;
        z-index: 5000 !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
        pointer-events: auto !important;
    }

    .user-dropdown.active .user-dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) !important;
    }

    /* Ensure user menu items are clickable on mobile */
    .user-dropdown-menu .user-menu li a,
    .user-dropdown-menu .user-menu li button {
        padding: 15px 20px !important;
        font-size: 16px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .user-dropdown-menu .user-menu li a:hover,
    .user-dropdown-menu .user-menu li button:hover {
        background-color: rgba(0, 0, 0, 0.05) !important;
    }

    body.dark-theme .user-dropdown-menu .user-menu li a:hover,
    body.dark-theme .user-dropdown-menu .user-menu li button:hover {
        background-color: rgba(255, 255, 255, 0.05) !important;
    }

    /* Overlay removed for better clickability */

    /* End of rules to add inside the media query */
}

/* Medium screens (small laptops/large tablets) */
@media (min-width: 901px) and (max-width: 1178px) {
    .container {
        padding: 0 20px;
    }
    
    .logo {
        width: 160px;
    }
    
    .nav-list {
        gap: 8px;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .nav-link i {
        margin-right: 6px;
        width: 16px;
    }
    
    .dropdown-menu {
        min-width: 170px;
    }
    
    .dropdown-menu a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Theme toggle */
    .theme-toggle {
        margin-left: 10px;
    }
    
    #theme-toggle-btn {
        width: 64px;
        height: 30px;
    }
    
    #theme-toggle-btn::after {
        height: 24px;
        width: 24px;
    }
    
    .toggle-icon {
        width: 32px;
        height: 30px;
        font-size: 16px;
    }
    
    body.dark-theme #theme-toggle-btn::after {
        left: 73%;
    }
}

.search-container {
    margin-right: 10px;
    position: relative; /* ensure suggestions can anchor correctly */
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--color-bg-light);
    border-radius: 20px;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

body.dark-theme .search-form {
    background: var(--color-card-dark);
}

.search-input {
    border: none;
    background: transparent;
    padding: 5px 10px;
    width: 150px;
    color: var(--color-text-primary);
    font-size: 14px;
    outline: none;
}

body.dark-theme .search-input {
    color: var(--color-text-light);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

.search-button {
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme .search-button {
    color: var(--color-text-light);
}

.search-button:hover {
    color: var(--color-accent);
}

@media (max-width: 768px) {
    .search-form {
        width: calc(100% - 20px);
        margin: 15px 10px;
        padding: 5px 0;
        position: relative;
    }
    
    .search-input {
        width: 100%;
        padding: 8px 12px 8px 40px;
    }
    
    .search-button {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
    }
    
    .search-button > i {
        position: static;
        color: var(--color-text-secondary);
    }
    
    .search-input::placeholder {
        padding-left: 0;
    }
    
    .search-container {
        margin-right: 0;
        width: 100%;
    }
}

/* Scroll Down Button */
.scroll-down {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 100%;
    text-align: center;
}

.scroll-down-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: var(--color-accent);
    opacity: 0.9;
    transition: all 0.3s ease;
    animation: float 2s ease-in-out infinite;
    display: inline-block;
}

.scroll-down-btn i {
    font-size: 24px;
    color: inherit;
}

.scroll-down-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    color: var(--color-heading);
}

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

/* Dark theme adjustments */
body.dark-theme .scroll-down-btn {
    color: var(--color-accent-dark);
}

body.dark-theme .scroll-down-btn:hover {
    color: var(--color-cta-dark);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scroll-down {
        bottom: 15px;
    }
    
    .scroll-down-btn i {
        font-size: 20px;
    }
}

/* Hero Section Updated Styles */
.hero {
    padding: 100px 0 60px;
    background-color: var(--color-bg-light);
    overflow: hidden;
}

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

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0;
    font-size: 52px;
    font-weight: 600;
    margin-top: 25px;
    font-style: italic;
}

.view-all-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 16px;
}

.view-all-link:hover {
    color: var(--color-heading);
    text-decoration: underline;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: repeat(2, auto);
    gap: 30px;
    margin-bottom: 20px;
}

.hero-block {
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
    height: 100%;
    position: relative;
    transform: scale(1) translateY(0);
    transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 500ms cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hero-block:hover {
    transform: scale(1.03) translateY(5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
}

/* Remove unnecessary pseudo-element */
.hero-block::after {
    display: none;
}

.article-image img {
    width: 100%;
    height: 100%; /* Make image take full height of its container */
    display: block;
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
    transition: transform 0.3s ease;
}

.hero-block .article-image {
    height: 220px; /* Default height for smaller blocks or generic hero images */
}

.hero-block.main-feature .article-image {
    height: 380px; /* Specific height for the main feature image */
}

.hero-block.highlight-block .article-image {
    height: 280px; /* Specific height for the medium highlight image */
}

.hero-block.cta-block .article-image {
    height: 200px; /* Specific height for the small CTA image */
}

.article-box:hover .article-image img {
    transform: scale(1.05);
}

.main-feature {
    grid-row: span 2;
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 450px;
}

.highlight-block {
    grid-column: 2;
    grid-row: 1;
    background-size: cover;
    min-height: 220px;
}

.cta-block {
    grid-column: 2;
    grid-row: 2;
    background-size: cover;
    min-height: 210px;
}

/* Article Box Styles */
.article-box {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: opacity 0.5s ease;
}

.article-box.fading {
    opacity: 0.3;
}

.article-image {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1);
}

.article-box:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    color: #fff;
    z-index: 2;
}

.article-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.main-feature .article-title {
    font-size: 24px;
    -webkit-line-clamp: 3;
}

.hero-article-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.hero-article-link:hover {
    color: #ff4500;
    text-decoration: none;
    background-color: rgba(255, 69, 0, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

body.dark-theme .hero-article-link {
    color: inherit;
}

body.dark-theme .hero-article-link:hover {
    color: #ff6b35;
}

.article-meta {
    font-size: 13px;
    margin: 0;
    opacity: 0.8;
}

.explore-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
    padding-right: 20px;
}

.explore-link {
    display: inline-block;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    padding: 10px 20px;
    border: 2px solid var(--color-accent);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.explore-link:hover {
    background-color: var(--color-accent);
    color: white;
}

/* Dark Theme Adjustments */
body.dark-theme .hero {
    background-color: var(--color-bg-dark);
}

body.dark-theme .hero-block {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .section-title,
body.dark-theme .view-all-link {
    /* color: var(--color-text-light); */
}

body.dark-theme .view-all-link:hover {
    color: var(--color-accent-dark);
}

body.dark-theme .explore-link {
    color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

body.dark-theme .explore-link:hover {
    background-color: var(--color-accent-dark);
    color: var(--color-bg-dark);
}

/* Media Queries */
@media (max-width: 1024px) {
    .hero-grid {
        height: 500px;
    }
    
    .main-feature .title-container {
        max-width: 90%;
        padding: 20px 25px;
    }
    
    .feature-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        height: auto;
        gap: 15px;
    }
    
    .main-feature {
        grid-column: span 2;
        grid-row: auto;
        height: 400px;
    }
    
    .highlight-block {
        grid-column: 1;
        grid-row: auto;
        min-height: 180px;
    }
    
    .cta-block {
        grid-column: 2;
        grid-row: auto;
        min-height: 180px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .main-feature .block-content {
        bottom: 30px;
        left: 30px;
        right: 30px;
    }
    
    .main-feature .title-container {
        max-width: 100%;
        padding: 20px;
    }
    
    .feature-title {
        font-size: 1.8rem;
    }
    
    .main-feature .title-container {
        max-width: 100%;
        padding: 20px;
    }
    
    .feature-title {
        font-size: 1.8rem;
    }
    
    .highlight-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0 30px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .main-feature {
        grid-column: 1;
        height: 300px;
    }
    
    .highlight-block, 
    .cta-block {
        grid-column: 1;
        min-height: 160px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .main-feature .block-content {
        bottom: 20px;
        left: 20px;
        right: 20px;
    }
    
    .main-feature .title-container {
        padding: 15px;
    }
    
    .feature-title {
        font-size: 1.5rem;
    }
    
    .feature-meta {
        font-size: 0.9rem;
        margin-top: 10px;
    }
    
    .cta-button {
        padding: 10px 25px;
        font-size: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .trend-title {
        font-size: 1.5rem;
    }
    
    .title-emoji {
        font-size: 1.6rem;
    }
    
    .trend-subtitle {
        font-size: 0.9rem;
        padding: 0 10px;
    }
}

/* Popular Articles Section */
.popular-section {
    padding: 80px 0;
    background-color: #f7fbff;
    transition: background-color 0.3s ease;
}

body.dark-theme .popular-section {
    background-color: #0d324b;
}

.popular-section .section-title {
    font-size: 2.8rem;
    margin-bottom: 40px;
    color: var(--color-heading);
}

body.dark-theme .popular-section .section-title {
    color: var(--color-text-light);
}

.popular-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 500ms cubic-bezier(0.165, 0.84, 0.44, 1);
}

.popular-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .popular-article {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.popular-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.popular-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    margin: 0 0 20px;
}

.popular-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-title a:hover {
    color: var(--color-accent);
}

body.dark-theme .popular-title a {
    color: var(--color-text-light);
}

body.dark-theme .popular-title a:hover {
    color: var(--color-accent-dark);
}

.popular-excerpt {
    color: var(--color-text-primary);
    margin: 0 0 25px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-theme .popular-excerpt {
    color: var(--color-text-secondary);
}

.popular-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.like-btn, .share-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.like-btn {
    color: var(--color-text-primary);
    background-color: rgba(77, 182, 226, 0.1);
}

.like-btn:hover {
    background-color: rgba(77, 182, 226, 0.2);
}

.like-btn.liked {
    color: var(--color-heart);
    position: relative;
}

.like-btn.liked i {
    color: var(--color-heart);
    animation: heartBounce 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.49) forwards;
    transform-origin: center;
    filter: drop-shadow(0 0 2px rgba(255, 90, 118, 0.4));
}

/* Style for like counter in popular articles */
.like-btn .like-count {
    color: var(--color-accent);
    font-weight: 600;
    transition: color 0.3s ease;
}

body.dark-theme .like-btn .like-count {
    color: var(--color-accent-dark);
}

/* Add burst effect with pseudo-element */
.like-btn.liked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 35px;
    height: 35px;
    background: radial-gradient(circle, rgba(255, 90, 118, 0.8) 0%, rgba(255, 90, 118, 0) 70%);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    z-index: -1;
    animation: heartBurst 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* Sparkles effect using multiple pseudo-elements */
.like-btn.liked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%),
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 4%);
    transform: translate(-50%, -50%) scale(0);
    z-index: -1;
    animation: sparkle 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    opacity: 0;
}

.like-btn:active i {
    transform: scale(0.8);
}

@keyframes heartBounce {
    0% { 
        transform: scale(0.2); 
    }
    40% { 
        transform: scale(1.5);
    }
    60% { 
        transform: scale(0.9);
    }
    80% { 
        transform: scale(1.2);
    }
    100% { 
        transform: scale(1);
    }
}

@keyframes heartBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

@keyframes sparkle {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.share-btn {
    color: white;
    background-color: var(--color-accent);
}

.share-btn:hover {
    background-color: var(--color-heading);
}

body.dark-theme .like-btn {
    color: var(--color-text-light);
    background-color: rgba(93, 191, 239, 0.15);
}

body.dark-theme .like-btn:hover {
    background-color: rgba(93, 191, 239, 0.25);
}

body.dark-theme .share-btn {
    background-color: var(--color-accent-dark);
}

body.dark-theme .share-btn:hover {
    background-color: var(--color-cta-dark);
}

/* Make the Share button in "Our Popular Articles" stand out in dark theme */
body.dark-theme .popular-section .popular-actions .share-btn {
    background-color: #ff9800; /* bright amber for strong contrast */
    color: #111111;            /* dark text for readability */
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

body.dark-theme .popular-section .popular-actions .share-btn:hover {
    background-color: #ffa726; /* lighter on hover */
    box-shadow: 0 6px 16px rgba(255, 167, 38, 0.4);
}

.popular-image {
    height: 100%;
    overflow: hidden;
}

.popular-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1);
}

.popular-article:hover .popular-image img {
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .popular-article {
        grid-template-columns: 1fr;
    }
    
    .popular-image {
        height: 300px;
        order: -1;
    }
    
    .popular-content {
        padding: 30px;
    }
    
    .popular-section .section-title {
        font-size: 2.2rem;
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    .popular-section {
        padding: 60px 0;
    }
    
    .popular-article {
        margin-bottom: 30px;
    }
    
    .popular-image {
        height: 200px;
    }
    
    .popular-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .popular-excerpt {
        margin-bottom: 20px;
        -webkit-line-clamp: 2;
    }
}

/* More Button Styles */
.more-container {
    display: flex;
    justify-content: center;
    padding: 20px 0 60px;
    /* background-color: #f7fbff; */
    transition: background-color 0.3s ease;
}

body.dark-theme .more-container {
    background-color: transparent;
}

.more-btn {
    position: relative;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    padding: 12px 40px;
    background-color: white;
    color: var(--color-heading);
    border: 2px solid var(--color-accent);
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.more-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--color-accent);
    color: white;
}

.more-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.more-btn.loading .more-text {
    opacity: 0;
}

.more-btn.loading .loading-spinner {
    opacity: 1;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Dark theme adjustments */
body.dark-theme .more-btn {
    background-color: var(--color-card-dark);
    color: var(--color-text-light);
    border-color: var(--color-accent-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-theme .more-btn:hover {
    background-color: var(--color-accent-dark);
    color: white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

body.dark-theme .loading-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: white;
}

@media (max-width: 600px) {
    .more-container {
        padding: 10px 0 40px;
    }
    
    .more-btn {
        font-size: 14px;
        padding: 10px 30px;
    }
}

/* Trending Articles Section */
.trending-section {
    padding: 60px 0;
    background-color: white;
    transition: background-color 0.3s ease;
}

body.dark-theme .trending-section {
    background-color: var(--color-bg-dark);
}

.trending-section .section-title {
    font-size: 2.5rem;
    margin-bottom: 35px;
    color: var(--color-heading);
}

body.dark-theme .trending-section .section-title {
    color: var(--color-text-light);
}

.trending-list {
    max-width: 900px;
    margin: 0 auto;
}

.trending-item {
    display: flex;
    align-items: flex-start;
    padding: 25px 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: all 0.3s ease;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    transform: translateX(5px);
}

body.dark-theme .trending-item {
    border-bottom-color: var(--color-border-dark);
}

.trending-rank {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-accent);
    opacity: 0.8;
    min-width: 70px;
    margin-right: 20px;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-accent), var(--color-heading));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

body.dark-theme .trending-rank {
    background: linear-gradient(135deg, var(--color-accent-dark), var(--color-cta-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    opacity: 0.9;
}

.trending-content {
    flex: 1;
}

.trending-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--color-heading);
    transition: color 0.3s ease;
    line-height: 1.3;
}

.trending-item:hover .trending-title {
    color: var(--color-accent);
}

body.dark-theme .trending-title {
    color: var(--color-text-light);
}

body.dark-theme .trending-item:hover .trending-title {
    color: var(--color-accent-dark);
}

.trending-snippet {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    margin: 0 0 12px;
}

body.dark-theme .trending-snippet {
    color: var(--color-text-secondary);
}

.trending-meta {
    display: flex;
    align-items: center;
}

.trending-meta .like-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.trending-meta .like-count i {
    color: #ff7043;
    font-size: 1rem;
}

body.dark-theme .trending-meta .like-count {
    color: var(--color-text-secondary);
}

body.dark-theme .trending-meta .like-count i {
    color: #ff7043;
}

@media (max-width: 768px) {
    .trending-section {
        padding: 40px 0;
    }
    
    .trending-section .section-title {
        font-size: 2rem;
        margin-bottom: 25px;
    }
    
    .trending-item {
        padding: 20px 0;
    }
    
    .trending-rank {
        font-size: 2.2rem;
        min-width: 50px;
        margin-right: 15px;
    }
    
    .trending-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .trending-snippet {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .trending-section {
        padding: 30px 0;
    }
    
    .trending-section .section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .trending-item {
        padding: 15px 0;
        align-items: center;
    }
    
    .trending-rank {
        font-size: 1.8rem;
        min-width: 40px;
        margin-right: 10px;
    }
    
    .trending-title {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .trending-snippet {
        font-size: 0.85rem;
        margin-bottom: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Ad Section */
.ad-section {
    padding: 40px 0;
    margin: 20px 0;
}

.ad-label {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.ad-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

.ad-banner {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

body.dark-theme .ad-container {
    background-color: var(--color-card-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-theme .ad-label {
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .ad-section {
        padding: 30px 0;
    }
    
    .ad-container {
        max-width: 95%;
    }
}

/* Blog Grid Section */
.blog-grid-section {
    padding: 60px 0;
    background-color: #f7fbff;
    transition: background-color 0.3s ease;
}

body.dark-theme .blog-grid-section {
    background-color: #0d324b;
}

.blog-grid-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.filter-btn {
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--color-accent);
    background-color: rgba(77, 182, 226, 0.1);
}

.filter-btn.active {
    color: white;
    background-color: var(--color-accent);
}

body.dark-theme .filter-btn {
    color: var(--color-text-light);
}

body.dark-theme .filter-btn:hover {
    color: var(--color-accent-dark);
    background-color: rgba(93, 191, 239, 0.15);
}

body.dark-theme .filter-btn.active {
    color: white;
    background-color: var(--color-accent-dark);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.blog-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .blog-card {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-image {
    height: 200px;
    overflow: hidden;
}

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

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

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px;
    line-height: 1.4;
}

.card-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: var(--color-accent);
}

body.dark-theme .card-title a {
    color: var(--color-text-light);
}

body.dark-theme .card-title a:hover {
    color: var(--color-accent-dark);
}

.card-description {
    color: var(--color-text-primary);
    margin: 0 0 20px;
    line-height: 1.6;
    font-size: 15px;
    flex-grow: 1;
}

body.dark-theme .card-description {
    color: var(--color-text-secondary);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-primary);
    opacity: 0.7;
    margin: 5px 0 15px;
    font-style: italic;
}

.card-author {
    font-weight: 500;
}

.card-read-time {
    color: var(--color-accent);
}

body.dark-theme .card-meta {
    color: var(--color-text-secondary);
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.card-actions .like-btn {
    color: var(--color-text-primary);
    background-color: rgba(77, 182, 226, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-actions .like-btn:hover {
    background-color: rgba(77, 182, 226, 0.2);
}

.card-actions .share-btn {
    color: white;
    background-color: var(--color-accent);
    padding: 8px 15px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.card-actions .share-btn:hover {
    background-color: var(--color-heading);
}

body.dark-theme .card-actions .like-btn {
    color: var(--color-text-light);
    background-color: rgba(93, 191, 239, 0.15);
}

body.dark-theme .card-actions .like-btn:hover {
    background-color: rgba(93, 191, 239, 0.25);
}

body.dark-theme .card-actions .share-btn {
    background-color: var(--color-accent-dark);
}

body.dark-theme .card-actions .share-btn:hover {
    background-color: var(--color-cta-dark);
}

.load-more-container {
    text-align: center;
    margin-top: 20px;
}

/* Responsive adjustments for blog grid */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .blog-grid-section {
        padding: 40px 0;
    }
    
    .blog-grid-section .section-header {
        margin-bottom: 30px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 30px;
    }
    
    .section-controls {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .card-description {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .card-meta {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .card-actions .like-btn,
    .card-actions .share-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .blog-grid-section {
        padding: 30px 0;
    }
    
    .blog-grid-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .section-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-buttons {
        gap: 5px;
    }
    
    .filter-btn {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .card-content {
        padding: 15px;
    }
}

/* Trend Page Styles */
.trend-hero {
    position: relative;
    padding: 140px 0 60px; /* Increased top padding to account for fixed header */
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    text-align: center;
    z-index: 1; /* Ensure it's properly stacked */
}

body.dark-theme .trend-hero {
    background: linear-gradient(135deg, #1a1f25 0%, #121418 100%);
}

.trend-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 80px;
}

.title-emoji {
    display: inline-block;
    margin-right: 10px;
}

.title-text {
    display: inline-block;
}

.trend-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease-out;
}

body.dark-theme .trend-subtitle {
    color: #a0a9b8;
}

/* Floating Background Shapes */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(40px);
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #3498db;
    top: -100px;
    left: 10%;
    animation: float 15s infinite ease-in-out;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: #e74c3c;
    bottom: -80px;
    right: 20%;
    animation: float 18s infinite ease-in-out reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: #2ecc71;
    top: 30%;
    right: 10%;
    animation: float 12s infinite ease-in-out;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: #f39c12;
    bottom: 10%;
    left: 5%;
    animation: float 20s infinite ease-in-out reverse;
}

body.dark-theme .shape-1 {
    background: #2980b9;
}

body.dark-theme .shape-2 {
    background: #c0392b;
}

body.dark-theme .shape-3 {
    background: #27ae60;
}

body.dark-theme .shape-4 {
    background: #d35400;
}

/* Trend Ticker */
.trend-ticker-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    height: 50px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 1.2s ease-out;
}

body.dark-theme .trend-ticker-container {
    background: rgba(30, 38, 50, 0.5);
}

.trend-ticker {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.ticker-items {
    position: absolute;
    white-space: nowrap;
    will-change: transform;
    animation: tickerScroll 30s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 20px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 50px;
}

body.dark-theme .ticker-item {
    color: #e0e0e0;
}

.ticker-item i {
    margin-right: 5px;
    color: #ff5722;
}

body.dark-theme .ticker-item i {
    color: #ff7043;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Filter Strip */
.trend-filter {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

body.dark-theme .trend-filter {
    background: rgba(25, 30, 40, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.filter-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-label {
    font-weight: 600;
    margin-right: 15px;
    color: #555;
}

body.dark-theme .filter-label {
    color: #ccc;
}

.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pill {
    background: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.filter-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-pill.active {
    background: #3498db;
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

body.dark-theme .filter-pill {
    background: #2c3447;
    color: #e0e0e0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

body.dark-theme .filter-pill:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .filter-pill.active {
    background: #3498db;
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

/* Trend Grid Section */
.trend-grid-section {
    padding: 40px 0 80px;
}

body.dark-theme .trend-grid-section {
    background-color: #121418;
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

/* The styles below are a duplicate of those above and will be removed */

/* Card Sizes */
.trend-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.trend-card.small,
.trend-card.medium,
.trend-card.tall {
    /* Reset all special size classes */
    height: 100%;
}

.trend-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .trend-card {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .trend-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

/* Card Image */
.trend-card .card-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.trend-card.tall .card-image {
    height: 250px; /* Slightly taller image for tall cards */
}

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

.trend-card:hover .card-image img {
    transform: scale(1.05);
}

/* Trend Category Tag */
.trend-category {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2;
}

.trend-category.tech {
    background: rgba(52, 152, 219, 0.9);
}

.trend-category.business {
    background: rgba(155, 89, 182, 0.9);
}

.trend-category.health {
    background: rgba(46, 204, 113, 0.9);
}

.trend-category.crypto {
    background: rgba(230, 126, 34, 0.9);
}

.trend-category.science {
    background: rgba(41, 128, 185, 0.9);
}

.trend-category.lifestyle {
    background: rgba(231, 76, 60, 0.9);
}

.trend-category.environment {
    background: rgba(39, 174, 96, 0.9);
}

.trend-category.food {
    background: rgba(211, 84, 0, 0.9);
}

/* Card Content */
.trend-card .card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trend-card .card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
}

.trend-card .card-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color 0.3s ease;
}

.trend-card .card-title a:hover {
    color: var(--color-accent);
}

.trend-card .card-excerpt {
    color: var(--color-text-primary);
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

body.dark-theme .trend-card .card-title a {
    color: var(--color-text-light);
}

body.dark-theme .trend-card .card-title a:hover {
    color: var(--color-accent-dark);
}

body.dark-theme .trend-card .card-excerpt {
    color: var(--color-text-secondary);
}

/* Trend Icon (fire) */
.trend-icon {
    color: #ff5722;
    margin-right: 8px;
    font-size: 0.9em;
}

.trend-icon.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Card Meta */
.trend-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.85rem;
    color: #888;
}

body.dark-theme .trend-card .card-meta {
    color: var(--color-text-secondary);
}

.trend-score {
    display: flex;
    align-items: center;
    color: #4CAF50;
    font-weight: 600;
}

.trend-score i {
    margin-right: 5px;
}

.read-time {
    color: #666;
}

body.dark-theme .trend-score {
    color: #8BC34A;
}

body.dark-theme .read-time {
    color: #aaa;
}

/* Existing read-time styles removed to avoid duplication */

/* Mini Trend Insights Section */
.trend-insights {
    padding: 60px 0;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-theme .trend-insights {
    background: #1a1f26;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.insights-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: #2c3e50;
}

body.dark-theme .insights-title {
    color: #e0e0e0;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 30px;
}

.insight-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    transition: all 0.3s ease;
}

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

body.dark-theme .insight-card {
    background: #1f2635;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

body.dark-theme .insight-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.insight-icon {
    font-size: 2.5rem;
    color: #3498db;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.insight-content {
    flex: 1;
}

.insight-title {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 600;
}

.insight-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

body.dark-theme .insight-title {
    color: #a0a9b8;
}

body.dark-theme .insight-value {
    color: #e0e0e0;
}

/* Insight Charts and Visualizations */
.insight-chart {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2ecc71);
    border-radius: 4px;
    width: 0;
    animation: growBar 1.5s ease-out forwards;
}

body.dark-theme .insight-chart {
    background: #2c3447;
}

@keyframes growBar {
    to {
        width: var(--width, 75%);
    }
}

.insight-stat {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e74c3c;
}

.insight-stat i {
    margin-right: 5px;
}

.insight-gauge {
    position: relative;
    width: 80px;
    height: 40px;
    overflow: hidden;
    margin: 0 auto;
}

.gauge-progress {
    position: absolute;
    width: 80px;
    height: 80px;
    bottom: 0;
    border: 6px solid #3498db;
    border-top-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
    transform-origin: center top;
    transform: rotate(0deg);
    animation: fillGauge 1.5s ease-out forwards;
}

@keyframes fillGauge {
    to {
        transform: rotate(var(--rotation, 145deg));
    }
}

/* Keyword Cloud */
.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword {
    padding: 5px 12px;
    border-radius: 15px;
    background: #f0f0f0;
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

.keyword.large {
    font-size: 1rem;
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.keyword.medium {
    font-size: 0.9rem;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.keyword.small {
    font-size: 0.8rem;
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

body.dark-theme .keyword {
    background: #2c3447;
    color: #e0e0e0;
}

body.dark-theme .keyword.large {
    background: rgba(52, 152, 219, 0.3);
    color: #5dade2;
}

body.dark-theme .keyword.medium {
    background: rgba(46, 204, 113, 0.3);
    color: #58d68d;
}

body.dark-theme .keyword.small {
    background: rgba(230, 126, 34, 0.3);
    color: #f39c12;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .trend-grid {
        grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    }
    
    .trend-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .trend-hero {
        padding: 130px 0 40px; /* Adjusted for mobile header height */
    }
    
    .trend-title {
        font-size: 2.2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .trend-subtitle {
        font-size: 1rem;
    }
    
    .trend-grid {
        grid-template-columns: 1fr;
    }
    
    .trend-card .card-image {
        height: 200px;
    }
    
    .trend-card .card-content {
        padding: 15px;
    }
    
    .trend-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .trend-card .card-excerpt {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-label {
        margin-bottom: 10px;
    }
    
    .filter-pills {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start;
        margin-top: 20px;
    }
    
    .insight-card {
        padding: 15px;
    }
    
    .insight-icon {
        font-size: 2rem;
        margin-right: 15px;
    }
}

@media (max-width: 480px) {
    .trend-hero {
        padding: 120px 0 30px; /* Adjusted padding for header on small screens */
    }
    
    .trend-title {
        font-size: 1.8rem;
        padding: 0 5px; /* Reset padding, we're handling space with the section padding */
        margin-bottom: 15px;
        /* Ensure emoji and text stay together nicely */
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        word-break: break-word;
    }
    
    .trend-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .trend-card .card-image {
        height: 180px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .trend-ticker-container {
        height: 40px;
    }
    
    .ticker-item {
        line-height: 40px;
        font-size: 0.8rem;
    }
}

/* Active navigation link styles */
.nav-link.active {
    color: var(--accent-color, #ff4500);
    font-weight: 600;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: var(--accent-color, #ff4500);
    border-radius: 3px;
}

body.dark-theme .nav-link.active {
    color: #4facfe;
}

body.dark-theme .nav-link.active::after {
    background-color: #4facfe;
}

body.dark-theme .nav-link {
    color: var(--color-text-light);
}

/* Random Page Styles */
.random-page {
    background-color: #f9f9f9;
    min-height: 100vh;
    padding-top: 70px; /* Add padding to prevent header overlap */
}

body.dark-theme .random-page {
    background-color: #1a1a1a;
}

.random-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    position: relative;
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f0ff 100%);
    margin-top: 20px; /* Add margin to prevent overlap with header */
}

body.dark-theme .random-hero {
    background: linear-gradient(135deg, #2a3242 0%, #1c2333 100%);
}

.random-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

body.dark-theme .random-title {
    color: #ffffff;
}

.dice-icon {
    font-size: 2rem;
    animation: gentle-bounce 3s ease-in-out infinite;
    display: inline-block;
}

.refresh-btn {
    background: none;
    border: none;
    color: #5a6acf;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background-color: rgba(90, 106, 207, 0.1);
    transform: rotate(15deg);
}

.refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

body.dark-theme .refresh-btn {
    color: #7c8cf7;
}

body.dark-theme .refresh-btn:hover {
    background-color: rgba(124, 140, 247, 0.2);
}

.random-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

body.dark-theme .random-subtitle {
    color: #b0b0b0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-top: 2rem;
    margin-bottom: 2rem; /* Add margin to bottom of content wrapper */
}

/* Masonry Grid */
.random-grid-container {
    width: 100%;
    overflow: visible;
    padding-bottom: 30px;
    display: flex;
    justify-content: center; /* Center the grid container */
    margin-top: 20px;
}

/* Masonry Grid */
.random-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 10px;
    grid-gap: 40px; /* Further increased gap between cards */
    margin-bottom: 40px; /* Add margin to bottom of grid */
    position: relative;
    width: 100%;
    margin: 0 auto; /* Center the grid */
}

.random-card {
    grid-row-end: span 45; /* Increased default height */
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    height: auto;
    transition: all 0.3s ease;
    padding: 0;
    background-color: transparent;
}

.random-card.tall {
    grid-row-end: span 55; /* Adjusted height for tall cards */
}

.random-card.small {
    grid-row-end: span 35; /* Slightly increased height for small cards */
}

.random-card.wide {
    grid-column-end: span 2;
    grid-row-end: span 40; /* Increased height for wide cards */
}

.random-card.featured {
    grid-column-end: span 2;
    grid-row-end: span 45; /* Adjusted height for featured cards */
}

/* Add styles for card container to match "Best of the week" look */
.random-card .card-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.random-card .card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.random-card:hover .card-image::after {
    opacity: 1;
}

.random-card:hover {
    transform: translateY(-5px);
    /* Remove box shadow on hover */
}

body.dark-theme .random-card {
    /* Remove background-color and box-shadow */
}

body.dark-theme .random-card:hover {
    /* Remove box-shadow on hover in dark mode */
}

.card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 15px;
}

.card-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
    object-fit: cover;
    display: block;
    aspect-ratio: 16/9;
}

.random-card:hover .card-image img {
    transform: scale(1.05);
}

/* Add styles for links in card title */
.card-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
    font-weight: 700;
}

.card-title a:hover {
    color: var(--color-accent);
}

body.dark-theme .card-title a {
    color: var(--color-text-light);
}

body.dark-theme .card-title a:hover {
    color: var(--color-accent-dark);
}

.random-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10; /* Ensure tag appears above image */
}

.random-tag.tech {
    background-color: rgba(90, 106, 207, 0.85);
}

.random-tag.science {
    background-color: rgba(50, 170, 100, 0.85);
}

.random-tag.health {
    background-color: rgba(220, 90, 90, 0.85);
}

.random-tag.lifestyle {
    background-color: rgba(240, 180, 60, 0.85);
}

.random-tag.culture {
    background-color: rgba(160, 90, 190, 0.85);
}

.random-tag.art {
    background-color: rgba(90, 180, 200, 0.85);
}

.card-content {
    padding: 15px 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

body.dark-theme .card-title {
    color: #fff;
}

.card-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
    opacity: 0.85;
    position: relative;
    z-index: 2;
}

body.dark-theme .card-excerpt {
    color: #b0b0b0;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: auto;
}

.save-btn,
.like-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.save-btn:hover {
    color: #5a6acf;
    transform: scale(1.1);
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.like-btn.liked {
    color: #e74c3c;
}

.like-btn .like-count {
    font-size: 0.9rem;
    margin-left: 4px;
}

.save-btn.saved {
    color: #5a6acf;
}

body.dark-theme .save-btn,
body.dark-theme .like-btn {
    color: #aaa;
}

body.dark-theme .save-btn:hover {
    color: #7c8cf7;
}

body.dark-theme .like-btn:hover,
body.dark-theme .like-btn.liked {
    color: #ff6b6b;
}

body.dark-theme .save-btn.saved {
    color: #7c8cf7;
}

/* Card Sparkle Effect */
.card-sparkle {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80"><path d="M40 8l4.7 12.7L56 25l-11.3 4.3L40 42l-4.7-12.7L24 25l11.3-4.3z" fill="none" stroke="rgba(255,255,255,0.5)" stroke-width="2"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
}

.random-card:hover .card-sparkle {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
    animation: sparkle 2s linear infinite;
}

/* Glowing Effect for Featured Card */
.random-card.glow {
    box-shadow: 0 0 20px rgba(90, 106, 207, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

body.dark-theme .random-card.glow {
    box-shadow: 0 0 20px rgba(124, 140, 247, 0.3);
}

/* Sidebar Styles */
.random-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

.sidebar-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark-theme .sidebar-section {
    background-color: #252525;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .sidebar-title {
    color: #fff;
}

.sidebar-title i {
    color: #5a6acf;
}

body.dark-theme .sidebar-title i {
    color: #7c8cf7;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
}

.sidebar-item:before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #5a6acf;
}

.sidebar-item a {
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.sidebar-item a:hover {
    color: #5a6acf;
}

body.dark-theme .sidebar-item:before {
    background-color: #7c8cf7;
}

body.dark-theme .sidebar-item a {
    color: #ccc;
}

body.dark-theme .sidebar-item a:hover {
    color: #7c8cf7;
}

.lucky-btn {
    width: 100%;
    padding: 15px 20px;
    background-color: #5a6acf;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(90, 106, 207, 0.2);
}

.lucky-btn:hover {
    background-color: #4350b2;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(90, 106, 207, 0.3);
}

.lucky-btn:active {
    transform: translateY(0);
}

body.dark-theme .lucky-btn {
    background-color: #7c8cf7;
    box-shadow: 0 4px 12px rgba(124, 140, 247, 0.3);
}

body.dark-theme .lucky-btn:hover {
    background-color: #6170e3;
    box-shadow: 0 8px 15px rgba(124, 140, 247, 0.4);
}

/* Shuffle Button Styles */
.shuffle-container {
    text-align: center;
    padding: 2rem 0;
}

.shuffle-btn {
    padding: 12px 25px;
    background-color: #5a6acf;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(90, 106, 207, 0.2);
}

.shuffle-btn i {
    font-size: 1.2rem;
}

.shuffle-btn:hover {
    background-color: #4350b2;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(90, 106, 207, 0.3);
}

.shuffle-btn:active {
    transform: translateY(0);
}

body.dark-theme .shuffle-btn {
    background-color: #7c8cf7;
    box-shadow: 0 4px 12px rgba(124, 140, 247, 0.3);
}

body.dark-theme .shuffle-btn:hover {
    background-color: #6170e3;
    box-shadow: 0 8px 15px rgba(124, 140, 247, 0.4);
}

/* Animations */
@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2) rotate(45deg);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(90, 106, 207, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(90, 106, 207, 0.5);
    }
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 1fr 280px;
        gap: 25px;
    }
    
    .random-title {
        font-size: 2.2rem;
    }
    
    .random-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .random-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        position: static;
    }
    
    .sidebar-section {
        margin-bottom: 0;
    }
    
    .random-card.wide,
    .random-card.featured {
        grid-column-end: span 1;
    }
    
    .random-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .random-page {
        padding-top: 60px;
    }
    
    .random-hero {
        padding: 2rem 0 1.5rem;
        margin-top: 0;
    }
    
    .random-title {
        font-size: 1.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dice-icon {
        font-size: 1.6rem;
    }
    
    .refresh-btn {
        margin-left: 5px;
        font-size: 1rem;
        padding: 6px;
    }
    
    .random-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .random-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        grid-gap: 15px;
    }
    
    .random-grid-container {
        padding-bottom: 10px;
    }
    
    .random-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar-section {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-excerpt {
        font-size: 0.9rem;
    }
    
    .card-actions {
        gap: 10px;
    }
    
    .content-wrapper {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .random-card {
        grid-row-end: span 30;
    }
    
    .random-card.tall {
        grid-row-end: span 40;
    }
    
    .random-card.small {
        grid-row-end: span 28;
    }
}

@media (max-width: 576px) {
    .random-grid {
        grid-template-columns: 1fr 1fr;
        grid-gap: 12px;
        width: 95%; /* Control width on small screens */
        margin: 0 auto; /* Center the grid */
    }
    
    .random-title {
        font-size: 1.6rem;
    }
    
    .dice-icon {
        font-size: 1.4rem;
    }
    
    .refresh-btn {
        padding: 5px;
    }
    
    .random-card.wide,
    .random-card.featured {
        grid-column: span 2;
    }
    
    .sidebar-title {
        font-size: 1.1rem;
    }
    
    .sidebar-item a {
        font-size: 0.9rem;
    }
    
    .shuffle-btn, 
    .lucky-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .random-grid {
        grid-template-columns: 1fr;
        max-width: 400px; /* Limit width for better centering */
        width: 90%; /* Control width for better centering */
        margin: 0 auto; /* Center the grid */
    }
    
    .random-hero {
        padding: 1.5rem 0 1rem;
    }
    
    .random-title {
        font-size: 1.5rem;
    }
    
    .dice-icon {
        font-size: 1.3rem;
    }
    
    .refresh-btn {
        font-size: 0.9rem;
        padding: 5px;
    }
    
    .random-subtitle {
        font-size: 0.85rem;
    }
    
    .random-grid-container {
        padding: 0;
    }
    
    .random-card.wide,
    .random-card.featured,
    .random-card.tall,
    .random-card.small {
        grid-column: span 1;
        grid-row-end: auto;
        min-height: auto;
    }
    
    .random-card {
        margin-bottom: 15px;
    }
    
    .sidebar-title {
        font-size: 1rem;
    }
    
    .sidebar-item {
        margin-bottom: 8px;
    }
    
    .sidebar-item a {
        font-size: 0.85rem;
    }
    
    .shuffle-btn, 
    .lucky-btn {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
    
    .shuffle-container {
        padding: 1.5rem 0;
    }
    
    .card-image {
        max-height: 200px;
        overflow: hidden;
    }
    
    /* Fix for card spacing on mobile */
    .random-grid-container {
        /* padding: 0 10px; */
    }
    
    /* Make cards take full width on mobile */
    .random-card {
        width: 100%;
        max-width: 100%;
        border-radius: 8px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Simplify card content layout on smallest screens */
    .card-content {
        padding: 10px;
    }
    
    .card-actions {
        margin-top: 8px;
    }
    
    /* Fix toast positioning on mobile */
    #toast-notification {
        max-width: 80%;
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .random-title {
        font-size: 1.3rem;
        padding: 0 5px;
    }
    
    .random-subtitle {
        font-size: 0.8rem;
        padding: 0 10px;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-excerpt {
        font-size: 0.8rem;
    }
    
    .random-card {
        grid-row-end: auto !important;
        margin-bottom: 12px;
    }
    
    .card-image {
        max-height: 180px;
    }
    
    .sidebar-section {
        padding: 12px;
    }
    
    .random-grid {
        width: 85%; /* More compact for very small screens */
    }
}

/* Footer Styles */
.site-footer {
    background-color: #f8f9fa;
    padding: 40px 0;
    margin-top: 60px;
}

body.dark-theme .site-footer {
    background-color: #1a1a1a;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-logo {
    flex: 0 0 250px;
}

.footer-logo-img {
    max-width: 180px;
    margin-bottom: 15px;
}

.footer-tagline {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
}

body.dark-theme .footer-tagline {
    color: #adb5bd;
}

.footer-section {
    flex: 1 1 200px;
}

.footer-heading {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #343a40;
}

body.dark-theme .footer-heading {
    color: #f8f9fa;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #007bff;
}

body.dark-theme .footer-links a {
    color: #adb5bd;
}

body.dark-theme .footer-links a:hover {
    color: #0d6efd;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #343a40;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-3px);
}

body.dark-theme .social-link {
    background-color: #333;
    color: #f8f9fa;
}

body.dark-theme .social-link:hover {
    background-color: #0d6efd;
}

.copyright {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

body.dark-theme .copyright {
    color: #adb5bd;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-logo, .footer-section {
        flex: 0 0 100%;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-heading {
        text-align: center;
    }
    
    .footer-links {
        text-align: center;
    }
}

/* Saved Articles Page Styles */
.saved-page {
    background-color: var(--color-bg-light);
    padding-top: 70px; /* Account for fixed header */
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

body.dark-theme .saved-page {
    background-color: var(--color-bg-dark);
}

/* Saved Hero Section */
.saved-hero {
    padding: 60px 0 30px;
    text-align: center;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 40px;
}

body.dark-theme .saved-hero {
    background-color: var(--color-card-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.saved-header {
    margin-bottom: 25px;
}

.saved-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-icon {
    color: var(--color-accent);
    font-size: 0.9em;
}

body.dark-theme .saved-title {
    color: var(--color-text-light);
}

body.dark-theme .title-icon {
    color: var(--color-accent-dark);
}

.saved-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-primary);
    max-width: 600px;
    margin: 0 auto;
}

body.dark-theme .saved-subtitle {
    color: var(--color-text-secondary);
}

/* Sort Controls */
.saved-controls {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

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

.sort-dropdown label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

body.dark-theme .sort-dropdown label {
    color: var(--color-text-secondary);
}

.sort-select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--color-border-light);
    background-color: white;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    min-width: 120px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.sort-select:hover, .sort-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(77, 182, 226, 0.1);
}

body.dark-theme .sort-select {
    background-color: var(--color-card-dark);
    border-color: var(--color-border-dark);
    color: var(--color-text-light);
}

body.dark-theme .sort-select:hover, 
body.dark-theme .sort-select:focus {
    border-color: var(--color-accent-dark);
    box-shadow: 0 0 0 2px rgba(93, 191, 239, 0.2);
}

/* Saved Grid Section */
.saved-grid-section {
    padding: 0 0 80px;
}

.saved-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    min-height: 200px;
}

/* Saved Article Card */
.saved-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.saved-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .saved-card {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .saved-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.saved-card .card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

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

.saved-card:hover .card-image img {
    transform: scale(1.05);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: var(--color-accent);
    z-index: 2;
}

.category-badge.tech {
    background-color: #3498db;
}

.category-badge.science {
    background-color: #2ecc71;
}

.category-badge.business {
    background-color: #9b59b6;
}

.category-badge.health {
    background-color: #e74c3c;
}

.category-badge.lifestyle {
    background-color: #f39c12;
}

/* Card Content */
.saved-card .card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.saved-card .card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px;
    line-height: 1.4;
}

.saved-card .card-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color 0.3s ease;
}

.saved-card .card-title a:hover {
    color: var(--color-accent);
}

body.dark-theme .saved-card .card-title a {
    color: var(--color-text-light);
}

body.dark-theme .saved-card .card-title a:hover {
    color: var(--color-accent-dark);
}

.saved-card .card-excerpt {
    color: var(--color-text-primary);
    margin: 0 0 20px;
    line-height: 1.6;
    font-size: 0.9rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-theme .saved-card .card-excerpt {
    color: var(--color-text-secondary);
}

.saved-card .card-meta {
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--color-text-primary);
    opacity: 0.7;
}

body.dark-theme .saved-card .card-meta {
    color: var(--color-text-secondary);
}

.date-saved {
    font-style: italic;
}

/* Card Actions */
.saved-card .card-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

.unsave-btn,
.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.unsave-btn {
    color: var(--color-accent);
    font-size: 1.1rem;
}

.unsave-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.share-btn {
    color: var(--color-text-primary);
    font-size: 1rem;
}

.share-btn:hover {
    color: var(--color-accent);
    transform: scale(1.1);
}

body.dark-theme .unsave-btn {
    color: var(--color-accent-dark);
}

body.dark-theme .unsave-btn:hover {
    color: #ff6b6b;
}

body.dark-theme .share-btn {
    color: var(--color-text-secondary);
}

body.dark-theme .share-btn:hover {
    color: var(--color-accent-dark);
}

/* Empty State */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--color-accent);
    margin-bottom: 20px;
    opacity: 0.5;
}

body.dark-theme .empty-state-icon {
    color: var(--color-accent-dark);
}

.empty-state-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0 0 10px;
}

body.dark-theme .empty-state-title {
    color: var(--color-text-light);
}

.empty-state-message {
    color: var(--color-text-primary);
    margin: 0 0 25px;
    font-size: 1rem;
}

body.dark-theme .empty-state-message {
    color: var(--color-text-secondary);
}

.browse-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--color-accent);
    color: white;
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(77, 182, 226, 0.2);
}

.browse-btn:hover {
    background-color: var(--color-heading);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(77, 182, 226, 0.3);
}

body.dark-theme .browse-btn {
    background-color: var(--color-accent-dark);
    box-shadow: 0 4px 12px rgba(93, 191, 239, 0.3);
}

body.dark-theme .browse-btn:hover {
    background-color: var(--color-cta-dark);
    box-shadow: 0 6px 15px rgba(93, 191, 239, 0.4);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 20px;
}

.load-more-btn {
    position: relative;
    padding: 12px 30px;
    background-color: white;
    color: var(--color-heading);
    border: 2px solid var(--color-accent);
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.load-more-btn:hover {
    background-color: var(--color-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.load-more-btn.loading {
    color: transparent;
}

.load-more-btn.loading .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(77, 182, 226, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-accent);
    animation: spin 0.8s linear infinite;
}

.load-more-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark-theme .load-more-btn {
    background-color: var(--color-card-dark);
    color: var(--color-text-light);
    border-color: var(--color-accent-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-theme .load-more-btn:hover {
    background-color: var(--color-accent-dark);
    color: white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

body.dark-theme .load-more-btn.loading .loading-spinner {
    border-color: rgba(93, 191, 239, 0.3);
    border-top-color: var(--color-accent-dark);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .saved-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .saved-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .saved-hero {
        padding: 40px 0 25px;
        margin-bottom: 30px;
    }
    
    .saved-grid-section {
        padding: 0 0 60px;
    }
    
    .saved-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .saved-title {
        font-size: 1.8rem;
    }
    
    .saved-subtitle {
        font-size: 1rem;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .empty-state-title {
        font-size: 1.3rem;
    }
    
    .load-more-btn {
        font-size: 0.9rem;
        padding: 10px 25px;
    }
}

@media (max-width: 480px) {
    .saved-hero {
        padding: 30px 0 20px;
    }
    
    .saved-title {
        font-size: 1.5rem;
        gap: 8px;
    }
    
    .saved-subtitle {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    .saved-controls {
        margin-top: 15px;
    }
    
    .sort-dropdown {
        flex-direction: column;
        gap: 5px;
    }
    
    .sort-select {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .empty-state {
        padding: 30px 15px;
    }
    
    .empty-state-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .empty-state-title {
        font-size: 1.2rem;
    }
    
    .empty-state-message {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .browse-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .saved-card .card-image {
        height: 160px;
    }
    
    .saved-card .card-content {
        padding: 15px;
    }
    
    .saved-card .card-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .saved-card .card-excerpt {
        font-size: 0.85rem;
        margin-bottom: 15px;
        -webkit-line-clamp: 2;
    }
}

/* Blog Single Page Styles */
.blog-post-page {
    padding-top: 100px; /* Adjust based on fixed header height */
    padding-bottom: 40px;
}

body.dark-theme .blog-post-page {
    background-color: var(--color-bg-dark); /* Or a slightly different shade for content area */
}

.blog-post {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    margin-bottom: 40px;
}

body.dark-theme .blog-post {
    background-color: var(--color-card-dark);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.post-header .post-title {
    font-size: 2.8rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--color-heading);
    margin-bottom: 15px;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    margin-bottom: 25px;
    opacity: 0.8;
}

.post-meta span {
    display: flex;
    align-items: center;
}

.post-meta i {
    margin-right: 6px;
    color: var(--color-accent);
}

body.dark-theme .post-header .post-title {
    color: var(--color-text-light);
}

body.dark-theme .post-meta {
    color: var(--color-text-secondary);
}

body.dark-theme .post-meta i {
    color: var(--color-accent-dark);
}

.post-featured-image {
    margin: 0 0 30px;
    border-radius: 8px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    line-height: 1.7;
    font-size: 1.1rem; /* Slightly larger for readability */
    color: var(--color-text-primary);
}

body.dark-theme .post-content {
    color: var(--color-text-light);
}

.post-content h2, .post-content h3, .post-content h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-heading);
    margin-top: 2.5em;
    margin-bottom: 1em;
}

body.dark-theme .post-content h2, 
body.dark-theme .post-content h3, 
body.dark-theme .post-content h4 {
    color: var(--color-text-light);
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: var(--color-heading);
    text-decoration: underline;
}

body.dark-theme .post-content a {
    color: var(--color-accent-dark);
}

body.dark-theme .post-content a:hover {
    color: var(--color-cta-dark);
}

.post-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--color-text-primary);
    opacity: 0.9;
}

body.dark-theme .post-content blockquote {
    border-left-color: var(--color-accent-dark);
    color: var(--color-text-secondary);
}

.post-content pre {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
    margin: 30px 0;
    border: 1px solid var(--color-border-light);
}

body.dark-theme .post-content pre {
    background-color: #222b33; /* Darker code block */
    color: #e0e0e0;
    border-color: var(--color-border-dark);
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5em;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 0.5em;
}

.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

body.dark-theme .post-footer {
    border-top-color: var(--color-border-dark);
}

.post-tags {
    margin-bottom: 20px;
}

.post-tags .tag-label {
    font-weight: bold;
    margin-right: 10px;
    color: var(--color-text-primary);
}

body.dark-theme .post-tags .tag-label {
    color: var(--color-text-secondary);
}

.post-tags .tag-link {
    display: inline-block;
    background-color: var(--color-bg-light);
    color: var(--color-accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.post-tags .tag-link:hover {
    background-color: var(--color-accent);
    color: #fff;
}

body.dark-theme .post-tags .tag-link {
    background-color: var(--color-card-dark); /* A bit lighter than main dark BG */
    color: var(--color-accent-dark);
    border: 1px solid var(--color-border-dark);
}

body.dark-theme .post-tags .tag-link:hover {
    background-color: var(--color-accent-dark);
    color: var(--color-bg-dark);
}

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

.post-share .share-label {
    font-weight: bold;
    color: var(--color-text-primary);
}

body.dark-theme .post-share .share-label {
    color: var(--color-text-secondary);
}

.post-share .social-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
}

.post-share .social-icon:hover {
    color: var(--color-heading);
    transform: scale(1.1);
}

body.dark-theme .post-share .social-icon {
    color: var(--color-accent-dark);
}

body.dark-theme .post-share .social-icon:hover {
    color: var(--color-cta-dark);
}


/* Author Bio Section */
.author-bio {
    background-color: var(--color-bg-light);
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border: 1px solid var(--color-border-light);
}

body.dark-theme .author-bio {
    background-color: var(--color-card-dark); /* Slightly different from post background */
    border-color: var(--color-border-dark);
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details .author-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--color-heading);
    margin: 0 0 5px;
}

.author-details .author-description {
    font-size: 0.95rem;
    color: var(--color-text-primary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.author-details .author-social-links a {
    color: var(--color-accent);
    margin-right: 10px;
    font-size: 1.2rem;
}

body.dark-theme .author-details .author-name {
    color: var(--color-text-light);
}
body.dark-theme .author-details .author-description {
    color: var(--color-text-secondary);
}
body.dark-theme .author-details .author-social-links a {
    color: var(--color-accent-dark);
}

/* Related Posts Section */
.related-posts {
    margin-top: 50px;
}

.related-posts-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    color: var(--color-heading);
    margin-bottom: 30px;
    text-align: center;
}
body.dark-theme .related-posts-title {
    color: var(--color-text-light);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}
/* Re-use .blog-card styles for related posts, or create specific ones if needed */

/* Related posts card adjustments to match main article cards */
.related-posts .blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.related-posts .blog-card .card-image {
    height: 200px; /* match main page card height */
    overflow: hidden;
}

.related-posts .blog-card .card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* ensure image fills the area */
    display: block;
}

.related-posts .blog-card .card-content {
    padding: 20px; /* consistent padding for title/desc/date */
    display: flex;
    flex-direction: column;
}

.related-posts .blog-card .card-title { margin: 0 0 12px; }
.related-posts .blog-card .card-description { margin: 0 0 15px; }

@media (max-width: 576px) {
    .related-posts .blog-card .card-image { height: 180px; }
}


/* Comments Section */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border-light);
}
body.dark-theme .comments-section {
    border-top-color: var(--color-border-dark);
}

.comments-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    color: var(--color-heading);
    margin-bottom: 30px;
}
body.dark-theme .comments-title {
    color: var(--color-text-light);
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--color-border-light);
    margin-bottom: 15px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 1rem;
    min-height: 120px; /* Fixed height */
    height: 120px; /* Fixed height */
    resize: vertical;
    box-sizing: border-box; /* Ensure padding and border are included in width/height */
}

.comment-form input[type="text"], .comment-form input[type="email"] {
    width: 100%; /* Full width */
    padding: 15px; /* Match textarea padding for consistent height appearance */
    border-radius: 5px;
    border: 1px solid var(--color-border-light);
    margin-bottom: 15px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 1rem;
    height: 50px; /* Explicit height, adjust as needed or use padding to control */
    box-sizing: border-box; /* Ensure padding and border are included in width/height */
}

/* Remove outline and add custom focus indicator */
.comment-form textarea:focus,
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(77, 182, 226, 0.2);
}

body.dark-theme .comment-form textarea:focus,
body.dark-theme .comment-form input[type="text"]:focus,
body.dark-theme .comment-form input[type="email"]:focus {
    border-color: var(--color-accent-dark);
    box-shadow: 0 0 0 2px rgba(93, 191, 239, 0.3);
}

/* Remove margin-right from the name input as it's now full width */
.comment-form input[type="text"] { 
    margin-right: 0;
}

.comment-form button {
    background-color: var(--color-accent);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto; /* Adjust width to content */
    margin-top: 10px; /* Add some space above the button */
    box-sizing: border-box;
    display: inline-block; /* Allows left alignment and width:auto */
}
.comment-form button:hover {
    background-color: var(--color-heading);
}

body.dark-theme .comment-form textarea,
body.dark-theme .comment-form input[type="text"],
body.dark-theme .comment-form input[type="email"] {
    background-color: var(--color-card-dark);
    border-color: var(--color-border-dark);
    color: var(--color-text-light);
    /* Ensure height consistency in dark mode if needed, though box-sizing should handle it */
}
body.dark-theme .comment-form button {
    background-color: var(--color-accent-dark);
}
body.dark-theme .comment-form button:hover {
    background-color: var(--color-cta-dark);
}

.comment-list .comment {
    padding: 20px;
    border: 1px solid var(--color-border-light);
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: var(--color-bg-light);
}
.comment-list .comment-author {
    font-weight: bold;
    color: var(--color-heading);
    margin-bottom: 5px;
}
.comment-list .comment-date {
    font-size: 0.85rem;
    color: var(--color-text-primary);
    opacity: 0.7;
    margin-bottom: 10px;
}
.comment-list .comment-text {
    color: var(--color-text-primary);
}

body.dark-theme .comment-list .comment {
    background-color: var(--color-card-dark); /* A bit lighter than main BG */
    border-color: var(--color-border-dark);
}
body.dark-theme .comment-list .comment-author {
    color: var(--color-text-light);
}
body.dark-theme .comment-list .comment-date {
    color: var(--color-text-secondary);
}
body.dark-theme .comment-list .comment-text {
    color: var(--color-text-secondary);
}

/* Responsive adjustments for blog post page */
@media (max-width: 768px) {
    .blog-post-page {
        padding-top: 80px; /* Adjust if header height changes on mobile */
    }
    .post-header .post-title {
        font-size: 2rem;
    }
    .post-content {
        font-size: 1rem;
    }
    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-avatar img {
        margin-bottom: 15px;
    }
    .comment-form input[type="text"], .comment-form input[type="email"] {
        width: 100%;
        margin-right: 0;
    }
    /* Ensure button is NOT full width on mobile too, if desired */
    .comment-form button {
        width: auto; /* Or specify a mobile-friendly width like 100% if preferred */
    }
}

body.dark-theme .post-share .social-icon:hover {
    color: var(--color-cta-dark);
}

.post-actions-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distributes space between items */
    flex-wrap: wrap;
    gap: 15px; /* Gap between items/groups */
    margin-top: 20px;
}

.post-action-btn {
    background-color: transparent;
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-action-btn i {
    font-size: 1.1em;
}

.post-action-btn:hover {
    background-color: var(--color-bg-light); /* Subtle hover */
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Liked state */
.post-action-btn.like-btn.liked i {
    font-family: "Font Awesome 6 Free"; /* Ensure correct font family */
    font-weight: 900; /* Solid icon weight */
    /* content: "\f004"; */ /* Unicode for solid heart - better to toggle classes on the icon itself */
    color: var(--color-heart);
}
.post-action-btn.like-btn.liked .fa-heart:before {
    content: "\f004"; /* Solid heart for liked state */
    font-weight: 900;
}

.post-action-btn.like-btn.liked {
    color: var(--color-heart);
    border-color: var(--color-heart);
}

.like-count-display {
    font-weight: 600;
}

/* Saved state */
.post-action-btn.save-btn.saved i {
    font-family: "Font Awesome 6 Free";
    font-weight: 900; /* Solid icon weight */
    /* content: "\f02e"; */ /* Unicode for solid bookmark - better to toggle classes on the icon itself */
    color: var(--color-accent);
}
.post-action-btn.save-btn.saved .fa-bookmark:before {
    content: "\f02e"; /* Solid bookmark for saved state */
    font-weight: 900;
}

.post-action-btn.save-btn.saved {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

body.dark-theme .post-action-btn {
    border-color: var(--color-border-dark);
    color: var(--color-text-secondary);
}

body.dark-theme .post-action-btn:hover {
    background-color: var(--color-hover-bg-dark);
    border-color: var(--color-accent-dark);
    color: var(--color-accent-dark);
}

body.dark-theme .post-action-btn.like-btn.liked {
    color: var(--color-heart);
    border-color: var(--color-heart); /* Keep heart color consistent */
}

body.dark-theme .post-action-btn.save-btn.saved {
    color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

/* Adjustments for share icons within the new container */
.post-actions-container .post-share {
    gap: 8px; /* Slightly reduced gap for tighter grouping */
}

/* Author Bio Section - Styles remain for other pages if this section is used elsewhere */
.author-bio {
    background-color: var(--color-bg-light);
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border: 1px solid var(--color-border-light);
}

body.dark-theme .author-bio {
    background-color: var(--color-card-dark); /* Slightly different from post background */
    border-color: var(--color-border-dark);
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details .author-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--color-heading);
    margin: 0 0 5px;
}

.author-details .author-description {
    font-size: 0.95rem;
    color: var(--color-text-primary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.author-details .author-social-links a {
    color: var(--color-accent);
    margin-right: 10px;
    font-size: 1.2rem;
}

body.dark-theme .author-details .author-name {
    color: var(--color-text-light);
}
body.dark-theme .author-details .author-description {
    color: var(--color-text-secondary);
}
body.dark-theme .author-details .author-social-links a {
    color: var(--color-accent-dark);
}

/* Related Posts Section */
.related-posts {
    margin-top: 50px;
}

.related-posts-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    color: var(--color-heading);
    margin-bottom: 30px;
    text-align: center;
}
body.dark-theme .related-posts-title {
    color: var(--color-text-light);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}
/* Re-use .blog-card styles for related posts, or create specific ones if needed */


/* Comments Section */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border-light);
}
body.dark-theme .comments-section {
    border-top-color: var(--color-border-dark);
}

.comments-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    color: var(--color-heading);
    margin-bottom: 30px;
}
body.dark-theme .comments-title {
    color: var(--color-text-light);
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--color-border-light);
    margin-bottom: 15px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 1rem;
    min-height: 120px; /* Fixed height */
    height: 120px; /* Fixed height */
    resize: vertical;
    box-sizing: border-box; /* Ensure padding and border are included in width/height */
}

.comment-form input[type="text"], .comment-form input[type="email"] {
    width: 100%; /* Full width */
    padding: 15px; /* Match textarea padding for consistent height appearance */
    border-radius: 5px;
    border: 1px solid var(--color-border-light);
    margin-bottom: 15px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 1rem;
    height: 50px; /* Explicit height, adjust as needed or use padding to control */
    box-sizing: border-box; /* Ensure padding and border are included in width/height */
}

/* Remove outline and add custom focus indicator */
.comment-form textarea:focus,
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(77, 182, 226, 0.2);
}

body.dark-theme .comment-form textarea:focus,
body.dark-theme .comment-form input[type="text"]:focus,
body.dark-theme .comment-form input[type="email"]:focus {
    border-color: var(--color-accent-dark);
    box-shadow: 0 0 0 2px rgba(93, 191, 239, 0.3);
}

/* Remove margin-right from the name input as it's now full width */
.comment-form input[type="text"] { 
    margin-right: 0;
}

.comment-form button {
    background-color: var(--color-accent);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto; /* Adjust width to content */
    margin-top: 10px; /* Add some space above the button */
    box-sizing: border-box;
    display: inline-block; /* Allows left alignment and width:auto */
}
.comment-form button:hover {
    background-color: var(--color-heading);
}

body.dark-theme .comment-form textarea,
body.dark-theme .comment-form input[type="text"],
body.dark-theme .comment-form input[type="email"] {
    background-color: var(--color-card-dark);
    border-color: var(--color-border-dark);
    color: var(--color-text-light);
    /* Ensure height consistency in dark mode if needed, though box-sizing should handle it */
}
body.dark-theme .comment-form button {
    background-color: var(--color-accent-dark);
}
body.dark-theme .comment-form button:hover {
    background-color: var(--color-cta-dark);
}

.comment-list .comment {
    padding: 20px;
    border: 1px solid var(--color-border-light);
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: var(--color-bg-light);
}
.comment-list .comment-author {
    font-weight: bold;
    color: var(--color-heading);
    margin-bottom: 5px;
}
.comment-list .comment-date {
    font-size: 0.85rem;
    color: var(--color-text-primary);
    opacity: 0.7;
    margin-bottom: 10px;
}
.comment-list .comment-text {
    color: var(--color-text-primary);
}

body.dark-theme .comment-list .comment {
    background-color: var(--color-card-dark); /* A bit lighter than main BG */
    border-color: var(--color-border-dark);
}
body.dark-theme .comment-list .comment-author {
    color: var(--color-text-light);
}
body.dark-theme .comment-list .comment-date {
    color: var(--color-text-secondary);
}
body.dark-theme .comment-list .comment-text {
    color: var(--color-text-secondary);
}

/* Responsive adjustments for blog post page */
@media (max-width: 768px) {
    .blog-post-page {
        padding-top: 80px; /* Adjust if header height changes on mobile */
    }
    .post-header .post-title {
        font-size: 2rem;
    }
    .post-content {
        font-size: 1rem;
    }
    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-avatar img {
        margin-bottom: 15px;
    }
    .comment-form input[type="text"], .comment-form input[type="email"] {
        width: 100%;
        margin-right: 0;
    }
    /* Ensure button is NOT full width on mobile too, if desired */
    .comment-form button {
        width: auto; /* Or specify a mobile-friendly width like 100% if preferred */
    }
}

body.dark-theme .post-share .social-icon:hover {
    color: var(--color-cta-dark);
}

.post-actions-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distributes space between items */
    flex-wrap: wrap;
    gap: 15px; /* Gap between items/groups */
    margin-top: 20px;
}

.post-action-btn {
    background-color: transparent;
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-action-btn i {
    font-size: 1.1em;
}

.post-action-btn:hover {
    background-color: var(--color-bg-light); 
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Liked state: Assumes JS toggles .liked class on button and potentially .fas on icon */
.post-action-btn.like-btn.liked i.fa-heart {
    color: var(--color-heart);
    font-weight: 900; /* Makes FontAwesome icon solid */
}
.post-action-btn.like-btn.liked {
    color: var(--color-heart);
    border-color: var(--color-heart);
}

.like-count-display {
    font-weight: 600;
}

/* Saved state: Assumes JS toggles .saved class on button and potentially .fas on icon */
.post-action-btn.save-btn.saved i.fa-bookmark {
    color: var(--color-accent);
    font-weight: 900; /* Makes FontAwesome icon solid */
}
.post-action-btn.save-btn.saved {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Dark Theme Adjustments for Action Buttons */
body.dark-theme .post-action-btn {
    border-color: var(--color-border-dark);
    color: var(--color-text-secondary);
}

body.dark-theme .post-action-btn:hover {
    background-color: var(--color-hover-bg-dark);
    border-color: var(--color-accent-dark);
    color: var(--color-accent-dark);
}

body.dark-theme .post-action-btn.like-btn.liked i.fa-heart {
    color: var(--color-heart); 
}
body.dark-theme .post-action-btn.like-btn.liked {
    color: var(--color-heart);
    border-color: var(--color-heart);
}

body.dark-theme .post-action-btn.save-btn.saved i.fa-bookmark {
    color: var(--color-accent-dark);
}
body.dark-theme .post-action-btn.save-btn.saved {
    color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

/* Share icons within the new container */
.post-actions-container .post-share {
    gap: 8px; 
}
/* End of Styles for Post Action Buttons */

/* Trend Grid Styles */
.trend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 40px;
}

/* Card Sizes */
.trend-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.trend-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .trend-card {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Card Image */
.trend-card .card-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

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

.trend-card:hover .card-image img {
    transform: scale(1.05);
}

/* Trend Category Tag */
.trend-category {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Content */
.trend-card .card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trend-card .card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
}

.trend-card .card-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color 0.3s ease;
}

.trend-card .card-title a:hover {
    color: var(--color-accent);
}

.trend-card .card-excerpt {
    color: var(--color-text-primary);
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

body.dark-theme .trend-card .card-title a {
    color: var(--color-text-light);
}

body.dark-theme .trend-card .card-title a:hover {
    color: var(--color-accent-dark);
}

body.dark-theme .trend-card .card-excerpt {
    color: var(--color-text-secondary);
}

/* Trend Icon (fire) */
.trend-icon {
    color: #FF5722;
    margin-right: 8px;
    font-size: 0.9em;
    margin-top: 4px;
}

.trend-icon.pulse {
    animation: pulse 1.5s infinite;
}

/* Card Meta */
.trend-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 0.85rem;
    margin-top: auto;
}

body.dark-theme .trend-card .card-meta {
    color: var(--color-text-secondary);
}

.trend-score {
    display: flex;
    align-items: center;
    color: #4CAF50;
    font-weight: 600;
}

.trend-score i {
    margin-right: 5px;
}

.read-time {
    color: #666;
}

body.dark-theme .trend-score {
    color: #8BC34A;
}

body.dark-theme .read-time {
    color: #aaa;
}

/* Make trend cards consistent at different screen sizes */
@media (max-width: 1200px) {
    .trend-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .trend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

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

    .trend-card .card-image {
        height: 200px;
    }
    
    .trend-card .card-content {
        padding: 15px;
    }
    
    .trend-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .trend-card .card-excerpt {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .trend-card .card-image {
        height: 180px;
    }
}

/* Add user dropdown styles at the end of the file */

/* User Avatar and Dropdown */
.user-dropdown {
    position: relative;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-accent);
}

.fa-user-circle {
    font-size: 28px;
    color: var(--color-accent);
}

body.dark-theme .fa-user-circle {
    color: var(--color-accent-dark);
}

.user-dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background-color: var(--color-bg-light);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

body.dark-theme .user-dropdown-menu {
    background-color: var(--color-bg-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 15px;
    border-bottom: 1px solid var(--color-border-light);
    text-align: center;
}

body.dark-theme .user-info {
    border-bottom-color: var(--color-border-dark);
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: var(--color-heading);
    margin-bottom: 5px;
}

.user-email {
    display: block;
    font-size: 14px;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-theme .user-name {
    color: var(--color-heading-dark);
}

body.dark-theme .user-email {
    color: var(--color-text-secondary-dark);
}

.user-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-menu li {
    padding: 0;
    margin: 0;
}

.user-menu li a,
.user-menu li button {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.user-menu li a i,
.user-menu li button i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: var(--color-accent);
}

.user-menu li:last-child a,
.user-menu li:last-child button {
    border-radius: 0 0 8px 8px;
}

.user-menu li a:hover,
.user-menu li button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-theme .user-menu li a,
body.dark-theme .user-menu li button {
    color: var(--color-text-light);
}

body.dark-theme .user-menu li a i,
body.dark-theme .user-menu li button i {
    color: var(--color-accent-dark);
}

body.dark-theme .user-menu li a:hover,
body.dark-theme .user-menu li button:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Profile Page - File Upload Button */
.change-photo-input {
    display: none;
}

.profile-photo-preview {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.profile-form-feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.profile-form-feedback.success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: block;
}

.profile-form-feedback.error {
    background-color: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(244, 67, 54, 0.3);
    display: block;
}

body.dark-theme .profile-form-feedback.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

body.dark-theme .profile-form-feedback.error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent, #1a7fac);
    transition: all 0.3s ease;
}

.fa-user-circle {
    font-size: 32px;
    color: var(--accent, #1a7fac);
}

body.dark-theme .fa-user-circle {
    color: var(--accent-dark, #5dbfef);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

body.dark-theme .user-dropdown-menu {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

body.dark-theme .user-info {
    border-bottom-color: #333;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--heading, #1a7fac);
    margin-bottom: 4px;
}

.user-email {
    display: block;
    font-size: 12px;
    color: var(--text-secondary, #666);
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-theme .user-name {
    color: var(--accent-dark, #5dbfef);
}

body.dark-theme .user-email {
    color: var(--text-secondary-dark, #a7c6db);
}

.user-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-menu li {
    margin-bottom: 5px;
}

.user-menu li a,
.user-menu li button {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--text-primary, #333);
    text-decoration: none;
    transition: all 0.2s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.user-menu li a i,
.user-menu li button i {
    margin-right: 8px;
    width: 16px;
    color: var(--accent, #1a7fac);
}

.user-menu li:last-child a,
.user-menu li:last-child button {
    color: #e53935;
}

.user-menu li a:hover,
.user-menu li button:hover {
    background-color: #f5f5f5;
}

body.dark-theme .user-menu li a,
body.dark-theme .user-menu li button {
    color: var(--text-light, #eee);
}

body.dark-theme .user-menu li a i,
body.dark-theme .user-menu li button i {
    color: var(--accent-dark, #5dbfef);
}

body.dark-theme .user-menu li a:hover,
body.dark-theme .user-menu li button:hover {
    background-color: #333;
}

body.dark-theme .user-menu li:last-child a,
body.dark-theme .user-menu li:last-child button {
    color: #ff5252;
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-text-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(79, 172, 254, 0.3);
}

body.dark-theme .header-text-avatar {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent, #1a7fac);
    transition: all 0.3s ease;
}

/* Blog Post Page Styles */
.blog-post {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.post-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.article-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    padding: 0;
}

.article-content p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

.post-featured-image {
    max-width: 100%;
    margin-bottom: 2rem;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

/* User dropdown styles - Consolidated and fixed */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar-link:hover {
    transform: scale(1.05);
}

.header-text-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(79, 172, 254, 0.3);
    transition: all 0.3s ease;
}

body.dark-theme .header-text-avatar {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.user-dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 5000; /* Higher z-index to ensure it appears above other elements */
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

body.dark-theme .user-dropdown-menu {
    background-color: var(--color-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: var(--color-border-dark);
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* Ensure dropdown is visible when active */
.user-dropdown.active .user-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* Mobile positioning for user dropdown */
@media (max-width: 768px) {
    .main-nav > .user-dropdown.in-header .user-dropdown-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        width: 90% !important;
        max-width: 320px !important;
        z-index: 5000 !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translate(-50%, -60%) !important;
        transition: all 0.3s ease !important;
        pointer-events: auto !important;
    }
    
    .main-nav > .user-dropdown.in-header.active .user-dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) !important;
    }
}



