/* === CORE VARIABLES & DARK MODE === */
:root {
    --primary: #0E7B7F;  /* darker teal */
    --primary-light: rgba(14, 123, 127, 0.1);
    --primary-dark: #096669; /* darker teal */
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #0E7B7F;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --footer-bg: #111827;
    --news-bar-bg: #ff0000;
    --teal-color: #0E7B7F;  /* darker teal */
    --teal-dark: #096669;   /* darker teal */
    --teal-light: #0E8E92;  /* darker teal */
    --light-card: rgba(255,255,255,0.98);
    --dark-card: #0a0e1a;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --teal-bright: #12ABB0; /* new bright teal for dark mode accents */
}

.dark {
    --primary: #12ABB0; /* updated to bright teal */
    --primary-light: rgba(18, 171, 176, 0.15);
    --primary-dark: #0d8a8e;
    --bg-primary: #0a0f1d;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #07f2f2;
    --card-bg: #0f1522;
    --header-bg: #0f1522;
    --footer-bg: #0a0e1a;
    --news-bar-bg: #ff0000;
    --dark-card: #0a0e1a;
    --teal-bright: #12ABB0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--teal-color), var(--teal-dark), var(--teal-light)) !important;
    color: #1f2937 !important;
    line-height: 1.6;
    padding: 0;
    min-height: 100vh;
    margin-top: -0.7rem;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #030812, #071127, #0a1525) !important;
    color: #e6eef8 !important;
}

.mono-font {
    font-family: 'JetBrains Mono', monospace;
}

/* === BREADCRUMB - EXACT TOOLIVO STYLE, 5px from top === */
.breadcrumb {
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0 0 8px 8px;
    margin-bottom: 0.5rem;
    margin-top: 5px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

body.dark-mode .breadcrumb {
    background: rgba(255, 255, 255, 0.04);
}

.breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .breadcrumb ul {
        font-size: 0.7rem;
    }
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin: 0 0.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumb a:hover {
    color: white;
}

body.dark-mode .breadcrumb a {
    color: rgba(230, 238, 248, 0.85);
}

body.dark-mode .breadcrumb a:hover {
    color: #e6eef8;
}

/* === FIXED: BREADCRUMB LAST ITEM - SINGLE LINE WITH ELLIPSIS === */
.breadcrumb li[aria-current="page"] {
    color: #e6eef8;
    font-weight: 600;
    /* Webkit properties for single-line truncation */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    min-width: 0;
    flex-shrink: 1;
}

body.dark-mode .breadcrumb li[aria-current="page"] {
    color: #cbd5e1;
}

/* Mobile optimization - smaller max-width */
@media (max-width: 480px) {
    .breadcrumb li[aria-current="page"] {
        max-width: 120px;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .breadcrumb li[aria-current="page"] {
        max-width: 100px;
    }
}

/* Tablet optimization */
@media (min-width: 481px) and (max-width: 768px) {
    .breadcrumb li[aria-current="page"] {
        max-width: 150px;
    }
}

/* Desktop - larger max-width */
@media (min-width: 769px) {
    .breadcrumb li[aria-current="page"] {
        max-width: 250px;
    }
}

.breadcrumb i {
    font-size: 0.9em;
}

/* === HEADER WITH LOGO - BIGGER, 2-ROW STYLE === */
header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding: 0.8rem 0 0.4rem 0;
}

.logo-container {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.logo {
    max-width: 320px;
    height: auto;
}

@media (max-width: 640px) {
    .logo {
        max-width: 260px;
    }
}

.logo-tagline {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-top: 6px;
    font-weight: 400;
    text-transform: uppercase;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 6px;
}

.dark-mode .logo-tagline {
    color: #12ABB0 !important;  /* bright teal in dark mode */
    border-top-color: rgba(18, 171, 176, 0.3);
}

/* === GLOWING TEAL SHADOW ANIMATION FOR LOGO IN DARK MODE - RUNNING === */
@keyframes tealGlow {
    0% { filter: drop-shadow(0 0 2px rgba(18, 171, 176, 0.5)); }
    50% { filter: drop-shadow(0 0 12px rgba(18, 171, 176, 0.9)) drop-shadow(0 0 6px rgba(18, 171, 176, 0.6)); }
    100% { filter: drop-shadow(0 0 2px rgba(18, 171, 176, 0.5)); }
}

.dark-mode .logo {
    animation: tealGlow 3s ease-in-out infinite;
}

/* === ARTICLE TAG (BADGE) - EXACT TOOLIVO STYLE WITH CLICKABLE SVG === */
.article-tag {
    text-align: center;
    margin: 2rem auto 0.8rem auto;
    max-width: 900px;
}

.article-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.article-badge:hover {
    background: rgba(255,255,255,0.4) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}

.article-badge svg {
    transition: transform 0.3s ease;
}

.article-badge:hover svg {
    transform: rotate(5deg);
}

body.dark-mode .article-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #e6eef8;
}

/* === ARTICLE MAIN TITLE (H1) - EXACT TOOLIVO STYLE === */
.article-main-title {
    text-align: center;
    margin: 0.5rem auto 1rem auto;
    max-width: 900px;
    padding: 0 1.5rem;
}

.article-main-title h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: white;
    line-height: 1.3;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .article-main-title h1 {
    color: #e6eef8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .article-main-title h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .article-main-title h1 {
        font-size: 1.8rem;
    }
    .article-main-title {
        padding: 0 0.8rem;
    }
}

/* === ARTICLE SECTION CARD - EXACT TOOLIVO STYLE === */
.article-section {
    background: var(--light-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0.5rem;
    margin-bottom: 3rem;
    overflow: hidden;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.5rem;
}

body.dark-mode .article-section {
    background: var(--dark-card);
}

.article-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* === ARTICLE META - UPDATED: Date left, Author right, smaller === */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.article-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;  /* smaller */
    color: #4b5563;
    font-weight: 500;
    background: rgba(14, 123, 127, 0.08);  /* darker teal, lighter bg */
    padding: 0.25rem 0.6rem;  /* smaller padding */
    border-radius: 4px;  /* smaller radius */
}

.article-author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;  /* smaller */
    color: #4b5563;
    font-weight: 500;
    background: rgba(14, 123, 127, 0.08);  /* darker teal, lighter bg */
    padding: 0.25rem 0.6rem;  /* smaller padding */
    border-radius: 4px;  /* smaller radius */
}

body.dark-mode .article-date,
body.dark-mode .article-author {
    color: #cbd5e1;
    background: rgba(18, 171, 176, 0.15); /* bright teal tint in dark */
}

.meta-icon {
    font-size: 0.75rem;  /* smaller */
    color: var(--teal-color);
}

body.dark-mode .meta-icon {
    color: #12ABB0; /* bright teal */
}

.article-single-content {
    display: block;
    width: 100%;
}

@media (min-width: 768px) {
    .article-single-content {
        max-width: 980px;
        margin: 0 auto;
    }
}

.article-single-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-primary);
}

body.dark-mode .article-single-content p {
    color: #e6eef8;  /* fixed: now white in dark mode */
}

body.dark-mode .article-single-content h2,
body.dark-mode .article-single-content h3,
body.dark-mode .article-single-content h4,
body.dark-mode .article-single-content li,
body.dark-mode .article-single-content div:not(.keypoints-container) {
    color: #e6eef8;
}

@media (max-width: 768px) {
    .article-meta {
        gap: 1rem;
    }
    .article-section {
        padding: 0.8rem;
    }
}

/* === PRESERVE ORIGINAL ARTICLE CONTENT STYLES - WITH DARK MODE FIX === */
.article-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* === TEAL BACKGROUND FOR ALL H2s - SLIGHT ROUNDED CORNERS WITH 0.6rem PADDING GAP === */
.article-content h2,
.article-single-content h2 {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    padding: 0.85rem 1rem;
    border-radius: 15px;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2.2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 15px rgba(14, 123, 127, 0.2);
    display: block;
    word-break: break-word;
    transition: all 0.2s ease;
}

/* Dark mode optimization */
.dark-mode .article-content h2,
.dark-mode .article-single-content h2 {
    background: linear-gradient(135deg, #12ABB0, #0d8a8e);
    box-shadow: 0 4px 15px rgba(18, 171, 176, 0.3);
}

/* Tablet optimization */
@media (max-width: 768px) {
    .article-content h2,
    .article-single-content h2 {
        font-size: 1.5rem;
        padding: 0.75rem 1rem;
        border-radius: 15px;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
}

/* Mobile optimization */
@media (max-width: 480px) {
    .article-content h2,
    .article-single-content h2 {
        font-size: 1.4rem;
        padding: 0.65rem 0.6rem;
        border-radius: 15px;
        margin-top: 1.8rem;
        margin-bottom: 0.9rem;
        line-height: 1.4;
    }
}

/* Small mobile devices */
@media (max-width: 360px) {
    .article-content h2,
    .article-single-content h2 {
        font-size: 1.3rem;
        padding: 0.6rem 0.8rem;
        border-radius: 15px;
    }
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

body.dark-mode .article-content h3 {
    color: #e6eef8;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

body.dark-mode .article-content p {
    color: #e6eef8;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.7rem;
    color: var(--text-primary);
}

body.dark-mode .article-content li {
    color: #e6eef8;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 0.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--primary-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.article-content a:hover {
    border-bottom-color: var(--primary);
}

.highlight-box {
    background: var(--primary-light);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.8rem;
    margin: 2rem 0;
}

.highlight-box h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .highlight-box h4 {
    color: #12ABB0; /* bright teal */
}

.highlight-box h4 svg {
    width: 20px;
    height: 20px;
}

.highlight-box p {
    color: var(--text-primary);
}

body.dark-mode .highlight-box p {
    color: #e6eef8;
}

/* === FIXED CARD DARK MODE BG === */
.tech-application-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

@media (min-width: 768px) {
    .tech-application-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tech-card {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

body.dark-mode .tech-card {
    background: #1a1f2e !important; /* fixed dark mode background for cards */
    border-color: #2d3748;
}

.tech-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tech-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--primary);
}

body.dark-mode .tech-card h4 {
    color: #12ABB0; /* bright teal */
}

.tech-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

body.dark-mode .tech-card p {
    color: #cbd5e1;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

body.dark-mode .tech-tag {
    color: #12ABB0;
    border-color: #12ABB0;
}

/* === IMAGE + KEY INSIGHTS - DESKTOP SIDEBYSIDE, MOBILE STACKED === */
.square-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 15px;
    object-fit: cover;
    border: 1px solid rgba(14, 123, 127, 0.1);
}

.image-container {
    margin: 2rem 0;
}

/* === SLIGHT SHADOW AFTER IMAGE - FIXED === */
.square-image {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* ← Now BLACK/NEUTRAL */
    transition: box-shadow 0.3s ease;
}

@media (max-width: 1023px) {
    .image-container {
        max-width: 100%;
        margin: 1.5rem 0;
        padding: 0 0.05rem;
    }
    .image-keypoints-container {
        display: block;
        margin: 1.5rem 0;
    }
    .keypoints-container {
        display: none;
    }
}

@media (min-width: 1024px) {
    .image-keypoints-container {
        display: flex;
        flex-direction: row;
        gap: 1.75rem;
        margin: 2.5rem 0;
        align-items: stretch;
    }
    .image-container, .keypoints-container {
        flex: 1;
        width: 50%;
    }
    .image-container {
        margin: 0;
    }
    .keypoints-container {
        background-color: #f8fcfd;
        border-radius: 15px;
        padding: 1.25rem;
        border-left: 3px solid var(--primary);
        box-shadow: 0 3px 10px rgba(14, 123, 127, 0.07);
        display: flex;
        flex-direction: column;
    }
    .dark-mode .keypoints-container {
        background-color: #1a1f2e;
        border-left-color: #12ABB0; /* bright teal */
        box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    }
    .keypoints-title {
        color: #0d3c3e;
        font-size: 1.4rem;
        font-weight: 700;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid rgba(14, 123, 127, 0.15);
        position: relative;
        display: inline-block;
    }
    .dark .keypoints-title {
        color: #f1f5f9;
    }
    .keypoints-title::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 2px;
        background: var(--primary);
        border-radius: 1px;
    }
    .keypoints-list {
        list-style-type: none;
        flex-grow: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .keypoint-item {
        margin-bottom: 1.2rem;
        padding-left: 2.25rem;
        position: relative;
        transition: transform 0.2s ease;
    }
    .keypoint-item:hover {
        transform: translateX(3px);
    }
    .keypoint-item:last-child {
        margin-bottom: 0;
        padding-bottom: 0.5rem;
    }
    .keypoint-item::before {
        content: "✓";
        position: absolute;
        left: 0;
        top: 0.15rem;
        width: 1.6rem;
        height: 1.6rem;
        background-color: var(--primary);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        font-weight: bold;
        flex-shrink: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .keypoint-title {
        color: #0a2e2f;
        font-weight: 700;
        margin-bottom: 0.35rem;
        font-size: 1.1rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .dark .keypoint-title {
        color: #e2e8f0;
    }
    .keypoint-description {
        color: #4a6a6c;
        font-size: 0.95rem;
        line-height: 1.5;
        opacity: 0.95;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .dark .keypoint-description {
        color: #b9c7d9;
    }
}

/* === MENU TOGGLE BUTTON - ICON ALWAYS WHITE, SCROLL BEHAVIOR === */
.menu-toggle {
    position: absolute;
    top: 42px;
    left: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 22px;
    border-radius: 2px;
    background: white !important;  /* ALWAYS WHITE */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.dark-mode .menu-toggle span {
    background: white !important;  /* ALWAYS WHITE */
}

/* === THEME TOGGLE BUTTON - SCROLL BEHAVIOR === */
.theme-toggle {
    position: fixed;
    top: 42px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    backdrop-filter: blur(10px);
}

.theme-toggle.scrolled {
    top: 20px !important;
}

.dark-mode .theme-toggle {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.dark-mode .theme-toggle:hover {
    background: rgba(30, 41, 59, 0.9);
}

.theme-icon {
    position: absolute;
    width: 22px;
    height: 22px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    stroke: currentColor;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
    color: #f59e0b;
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
    color: #e2e8f0;
}

.dark-mode .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.dark-mode .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === MENU CARD - WITH TEAL LINE, DARK MODE FIXED === */
.menu-card {
    position: fixed;
    top: 20px;
    left: 10px;
    width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    transform: translateX(-105%) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 1000;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    /* Keep visibility visible always, use opacity for show/hide */
    visibility: visible;
}

.menu-card.open {
    transform: translateX(0) scale(1);
    opacity: 1;
}

/* Add this for closed state */
.menu-card:not(.open) {
    opacity: 0;
    pointer-events: none;
}

.dark-mode .menu-card {
    background: #0f1522 !important; /* dark menu card background */
    border: 1px solid #1d2c40;
    color: #e6eef8;
}

.menu-card.open {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0E7B7F;
}

.dark-mode .menu-header {
    border-bottom-color: #12ABB0; /* bright teal in dark mode */
}

.menu-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111;
}

.dark-mode .menu-header h3 {
    color: #e6eef8 !important;
}

/* === TEAL COLOR LINE IN MENU (border-left) - DARK MODE FIX === */
.menu-link {
    border-left: 3px solid transparent;
    transition: border-left 0.2s ease, background 0.2s;
}

.menu-link:hover {
    border-left: 3px solid var(--primary) !important;
    background: rgba(14, 123, 127, 0.05);
}

.dark-mode .menu-link:hover {
    border-left: 3px solid #12ABB0 !important;
    background: rgba(18, 171, 176, 0.15);
}

.dropdown-item {
    border-left: 2px solid transparent;
}

.dropdown-item:hover {
    border-left: 2px solid var(--primary) !important;
}

.dark-mode .dropdown-item:hover {
    border-left: 2px solid #12ABB0 !important;
}

.menu-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-close:hover {
    background: rgba(0,0,0,0.05);
}

.dark-mode .menu-close:hover {
    background: rgba(255,255,255,0.05);
}

.menu-close svg {
    width: 20px;
    height: 20px;
    stroke: #111;
    stroke-width: 2;
    fill: none;
}

.dark-mode .menu-close svg {
    stroke: #e6eef8 !important; /* white in dark mode */
}

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

.menu-item {
    margin-bottom: 0.01rem;
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem 0.75rem 0.5rem;
    color: #111;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}

.dark-mode .menu-link {
    color: #e6eef8 !important; /* white text in dark mode */
}

.dark-mode .menu-link:hover {
    color: #12ABB0; /* bright teal on hover */
}

.menu-link:hover {
    background: rgba(14, 123, 127, 0.1);
    transform: translateX(4px);
    color: var(--primary);
}

.menu-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    flex-shrink: 0;
}

.dark-mode .menu-icon {
    stroke: white; /* teal icons in dark mode */
}

.dropdown-parent {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 0.75rem !important;
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: auto;
}

.dropdown-parent.active .dropdown-arrow {
    transform: rotate(90deg);
}

.dropdown-menu {
    list-style: none;
    padding-left: 0;
    margin-top: 0.25rem;
    margin-left: 32px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.dropdown-parent.active .dropdown-menu {
    max-height: 300px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.5rem 0.6rem 0;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.65rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-bottom: 0.01rem;
    position: relative;
    min-height: 36px;
}

.dark-mode .dropdown-item {
    color: #cbd5e1 !important; /* lighter gray in dark mode */
}

.dark-mode .dropdown-item:hover {
    color: #12ABB0; /* bright teal on hover */
    background: rgba(18, 171, 176, 0.08);
}

.subcategory-arrow {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    opacity: 0.6;
    margin-left: 8px;
    flex-shrink: 0;
}

.dark-mode .subcategory-arrow {
    stroke: #12ABB0;
}

.subcategory-name {
    flex-grow: 1;
    text-align: right;
    margin-right: 8px;
    padding-right: 4px;
}

.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}

.dark-mode .backdrop {
    background: rgba(0, 0, 0, 0.6) !important;
}

.backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* === BACK TO TOP BUTTON - ORIGINAL === */
/* === BACK TO TOP BUTTON - UPDATED === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999; /* Increased z-index to ensure it's above everything */
    box-shadow: 0 8px 25px rgba(14, 123, 127, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    pointer-events: none; /* Prevent clicks when invisible */
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto; /* Allow clicks when visible */
}

.dark-mode .back-to-top {
    background: linear-gradient(135deg, #12ABB0, #0d8a8e);
    box-shadow: 0 8px 25px rgba(18, 171, 176, 0.4);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(14, 123, 127, 0.6);
}

.dark-mode .back-to-top:hover {
    box-shadow: 0 15px 35px rgba(18, 171, 176, 0.6);
}

/* ===== NEWSLETTER MODAL - DARK MODE FIX ===== */
.newsletter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.dark-mode .newsletter-modal {
    background: rgba(10, 14, 26, 0.85);
}

.newsletter-modal.active {
    opacity: 1;
    visibility: visible;
}

.newsletter-modal-content {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #0E7B7F;
    text-align: center;
    color: var(--text-primary);
}

.dark-mode .newsletter-modal-content {
    background: var(--dark-card);
    border: 1px solid #12ABB0;
}

.newsletter-modal.active .newsletter-modal-content {
    transform: translateY(0);
}

.newsletter-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.newsletter-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* CRITICAL FIX: Ensure title is white in dark mode */
.dark-mode .newsletter-modal-title {
    color: #ffffff !important;
}

/* TWO ADDITIONAL LINES FOR MORE WHITE TEXT IN DARK MODE */
.dark-mode .newsletter-modal-message {
    color: #ffffff !important;
}

.dark-mode .newsletter-modal-icon {
    color: #ffffff !important;
}

.newsletter-modal-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.newsletter-modal-close {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode .newsletter-modal-close {
    background: linear-gradient(135deg, #12ABB0, #0d8a8e);
}

.newsletter-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 123, 127, 0.3);
}

/* === FOOTER STYLES - NO BORDERS, FULL WIDTH === */
.footer-card {
    background: #0a0e1a !important;
    border-bottom: none !important;  /* REMOVED BORDERS */
    padding: 1.1rem 1rem !important;
    border-right: none !important;   /* REMOVED BORDERS */
}

.footer-card:last-child {
    border-bottom: none !important;
}

.footer-container {
    background: #0a0e1a !important;
    margin-top: 2rem;
    padding: 0 !important;
    width: 100%;
    max-width: 100% !important;  /* FULL WIDTH */
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (min-width: 768px) {
    .footer-top-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }
    .footer-top-row > .footer-card:first-child {
        border-right: none !important;  /* REMOVED BORDER */
    }
    .quick-links-card {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .footer-top-row {
        display: block;
    }
    .footer-card {
        padding: 1.5rem 0 !important;
        width: 100% !important;
    }
    .footer-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
}

.facebook-bg { background: #1877F2; }
.twitter-bg { background: #000000; }
.instagram-bg { background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D); }
.linkedin-bg { background: #0A66C2; }
.youtube-bg { background: #FF0000; }
.newsletter-input {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.newsletter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(14, 123, 127, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.newsletter-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 123, 127, 0.4);
}

.feature-badge {
    background: linear-gradient(135deg, rgba(14, 123, 127, 0.15), rgba(14, 123, 127, 0.05));
    border: 1px solid rgba(14, 123, 127, 0.3);
}

.quick-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .quick-links-grid a span.text-gray-300,
    .quick-links-grid a span.text-gray-400 {
        font-size: 0.75rem;
    }
    .quick-links-grid svg.w-3.h-3 {
        width: 1rem;
        height: 1rem;
    }
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

img {
    pointer-events: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* === 6 HASHTAGS - ROUNDED BG, LIKE AUTHOR BUT MORE ROUNDED === */
.hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.8rem 0 1.2rem 0;
    align-items: center;
    justify-content: center; /* center-align on all devices */
}

.hashtag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(14, 123, 127, 0.08);
    color: #0E7B7F;
    padding: 0.2rem 0.8rem;
    border-radius: 40px; /* more rounded */
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(14, 123, 127, 0.15);
}

.dark-mode .hashtag-item {
    background: rgba(18, 171, 176, 0.1);
    color: #12ABB0;
    border-color: rgba(18, 171, 176, 0.2);
}

.hashtag-item i {
    font-size: 0.65rem;
    opacity: 0.9;
}

/* === SCROLL INDICATOR - AT TOP EDGE (HORIZONTAL) === */
.scroll-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(14, 123, 127, 0.15);
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    opacity: 0;  /* Start hidden */
    transition: opacity 1s ease;  /* Smooth fade transition */
    pointer-events: none;  /* So it doesn't block clicks when invisible */
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--teal-color), var(--teal-dark));
    transition: width 0.1s ease;
    box-shadow: 0 0 15px rgba(14, 123, 127, 0.5);
    border-radius: 0 2px 2px 0;
}

.dark-mode .scroll-indicator {
    background: rgba(18, 171, 176, 0.2);
}

.dark-mode .scroll-progress {
    background: linear-gradient(90deg, #12ABB0, #0d8a8e);
    box-shadow: 0 0 20px #12ABB0;
}

/* Mobile optimization for scroll indicator */
@media (max-width: 768px) {
    .scroll-indicator {
        height: 4px;
    }
}

/* ===== TOOLBAR STYLES ===== */
.toolbar-container {
    max-width: 1000px;
    margin: 0.8rem auto 1rem auto;
    padding: 0;
    width: 100%;
}

.toolbar-collapsed {
    background: #0E7B7F;
    border-radius: 15px;
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    min-height: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .toolbar-collapsed { background: #12ABB0; }

.toolbar-expanded {
    background: #0E7B7F;
    border-radius: 15px;
    padding: 0.5rem 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.25);
    min-height: 56px;
    animation: expandToolbar 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.dark-mode .toolbar-expanded { background: #12ABB0; }

@keyframes expandToolbar {
    0% { opacity: 0; transform: scale(0.95) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.toolbar-collapsed .toolbar-icons { animation: fadeInIcons 0.3s ease-out; }

@keyframes fadeInIcons {
    0% { opacity: 0; transform: translateY(-5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Toolbar share panel - whitish background for all icons */
.toolbar-expanded .social-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

/* Keep the copy button consistent */
.toolbar-expanded .copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
}

.hidden-icon {
    opacity: 0; transform: scale(0.8); transition: all 0.2s ease;
    pointer-events: none; display: none !important;
}

.toolbar-icons {
    display: flex; align-items: center; justify-content: space-evenly;
    gap: 0.8rem; width: 100%; padding: 0 0.2rem;
}

@media (max-width: 480px) { .toolbar-icons { gap: 0.3rem; } }

.toolbar-icon {
    background: transparent; border: none; color: white; font-size: 1.3rem;
    padding: 0; border-radius: 50%; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.2s;
    width: 40px; height: 40px;
}

@media (max-width: 480px) { .toolbar-icon { width: 36px; height: 36px; font-size: 1.2rem; } }

.toolbar-icon:hover { background: rgba(255,255,255,0.2); transform: scale(1.05) rotate(5deg); }

.settings-panel {
    display: flex; align-items: center; gap: 1.2rem; color: white;
    font-weight: 500; flex-wrap: wrap; font-size: 0.85rem;
    animation: slideInSettings 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

@keyframes slideInSettings {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.settings-item { display: flex; align-items: center; gap: 0.5rem; }

/* reaction grid with moving animation on hover */
.reaction-grid { display: flex; align-items: center; gap: 0.8rem; }

.reaction-icon {
    background: rgba(255,255,255,0.2); border: none; width: 40px; height: 40px;
    border-radius: 5px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center; color: white;
    padding: 0; animation: bounceIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reaction-icon i { font-size: 16px !important; line-height: 1; display: block; }

.reaction-icon:hover {
    transform: translateY(-3px) scale(1.15) rotate(2deg);
    background: rgba(255,255,255,0.35);
    animation: wiggle 0.3s ease-in-out;
}

.reaction-icon:hover i { animation: pulse 0.3s ease-in-out; }

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

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) translateY(-10px); }
    50% { opacity: 0.9; transform: scale(1.1); }
    80% { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes wiggle {
    0%, 100% { transform: translateY(-3px) scale(1.15) rotate(2deg); }
    25% { transform: translateY(-5px) scale(1.15) rotate(-4deg); }
    75% { transform: translateY(-1px) scale(1.15) rotate(4deg); }
}

.settings-item button, .settings-item select {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
    color: white; padding: 0.25rem 0.8rem; border-radius: 30px; font-size: 0.8rem;
    cursor: pointer; transition: all 0.2s ease;
}

.settings-item button:hover, .settings-item select:hover {
    background: rgba(255,255,255,0.3); transform: translateY(-1px);
}

select option { background: #0E7B7F; color: white; }

.text-size-slider { display: flex; align-items: center; gap: 1rem; }

.text-size-slider input {
    width: 200px; height: 6px; background: rgba(255,255,255,0.3);
    border-radius: 10px; accent-color: white; transition: all 0.2s ease;
}

.text-size-slider input:hover { transform: scaleY(1.5); }

@media (max-width: 480px) { .text-size-slider input { width: 150px; } }

/* Updated share grid with fixed X logo */
.share-grid {
    display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
}

/* ===== SOCIAL MEDIA ICONS - FULL FIX ===== */
/* Remove the ash color overlay from the generic social-icon class */
.social-icon {
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: popIn 0.3s ease-out;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
}

/* Brand color backgrounds - MUST come after .social-icon */
.facebook-bg { background: #1877F2 !important; }
.twitter-bg { background: #000000 !important; }
.instagram-bg {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D) !important;
}
.linkedin-bg { background: #0A66C2 !important; }
.youtube-bg { background: #FF0000 !important; }

.x-logo-svg {
    width: 18px;
    height: 18px;
}

/* Staggered animation delays */
.social-icon:nth-child(1) { animation-delay: 0.05s; }
.social-icon:nth-child(2) { animation-delay: 0.1s; }
.social-icon:nth-child(3) { animation-delay: 0.15s; }
.social-icon:nth-child(4) { animation-delay: 0.2s; }
.social-icon:nth-child(5) { animation-delay: 0.25s; }
.social-icon:nth-child(6) { animation-delay: 0.3s; }

/* Pop-in animation */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
    70% { opacity: 0.8; transform: scale(1.1) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Hover effect - lift and scale with subtle ash overlay */
.social-icon:hover {
    transform: translateY(-3px) scale(1.15);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Click/Active state - ash color flash animation */
.social-icon:active {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(0.95);
    transition: all 0.15s ease;
}

/* Icon spin animation on hover */
.social-icon:hover i,
.social-icon:hover svg {
    animation: spinIcon 0.3s ease-out;
}

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

/* Ensure SVG icons stay white */
.social-icon svg path {
    fill: white !important;
}

.copy-btn {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
    color: white; width: 38px; height: 38px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 1rem; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); animation: popIn 0.3s ease-out 0.35s both;
}

.copy-btn:hover { transform: translateY(-3px) scale(1.15); background: rgba(255,255,255,0.35); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

.copy-btn i { transition: all 0.2s ease; }

.copy-btn:hover i { animation: bounce 0.3s ease-out; }

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

.cross-button {
    background: rgba(255,255,255,0.25); border: none; color: white; width: 34px; height: 34px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0; margin-left: 0.5rem; animation: rotateIn 0.3s ease-out;
}

@keyframes rotateIn {
    0% { opacity: 0; transform: rotate(-180deg) scale(0.5); }
    100% { opacity: 1; transform: rotate(0) scale(1); }
}

.cross-button:hover { background: rgba(255,255,255,0.4); transform: rotate(90deg) scale(1.1); }

.cross-button i { font-size: 1.2rem; transition: all 0.2s ease; }

/* ===== POST-ARTICLE SECTION STYLES ===== */
.post-article-section {
    max-width: 1000px;
    margin: 1rem auto;
    padding: 0.8rem;
    background: var(--light-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
}

.dark-mode .post-article-section {
    background: var(--dark-card);
}

/* === SECTION REVEAL ON SCROLL ANIMATION === */
.fade-up-section {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations inside sections */
.fade-up-section .section-title,
.fade-up-section .share-section,
.fade-up-section .quiz-container,
.fade-up-section .author-box,
.fade-up-section .you-may-like-container,
.fade-up-section .categories-grid,
.fade-up-section .faq-container,
.fade-up-section .comment-form,
.fade-up-section .comments-grid {
    animation: fadeInContent 0.8s ease-out forwards;
}

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

/* Stagger children with delays */
.fade-up-section .section-title { animation-delay: 0.1s; }
.fade-up-section .share-section { animation-delay: 0.2s; }
.fade-up-section .quiz-container { animation-delay: 0.25s; }
.fade-up-section .author-box { animation-delay: 0.3s; }
.fade-up-section .you-may-like-container { animation-delay: 0.35s; }
.fade-up-section .categories-grid { animation-delay: 0.4s; }
.fade-up-section .faq-container { animation-delay: 0.45s; }
.fade-up-section .comment-form { animation-delay: 0.5s; }
.fade-up-section .comments-grid { animation-delay: 0.55s; }

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--teal-color);
    position: relative;
    display: inline-block;
}

.dark-mode .section-title {
    color: var(--teal-bright);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--teal-color);
    border-radius: 2px;
}

.dark-mode .section-title::after {
    background: var(--teal-bright);
}

/* Section header with proper alignment */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.section-header .section-title {
    margin-bottom: 0;
    flex: 0 1 auto;
}

.section-header .view-all-btn {
    margin-left: auto;
    white-space: nowrap;
    flex: 0 0 auto;
}

.delete-all-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.dark-mode .delete-all-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: #f87171;
}

.delete-all-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Share Section - Centered */
.share-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dark-mode .share-label {
    color: var(--teal-bright);
}

.share-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.share-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--teal-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    cursor: pointer;
}

.dark-mode .share-icon-btn {
    background: rgba(18, 171, 176, 0.15);
    color: var(--teal-bright);
}

.share-icon-btn:hover {
    transform: translateY(-3px) scale(1.1);
    background: var(--teal-color);
    color: white;
    border-color: var(--teal-color);
    box-shadow: 0 5px 15px rgba(14, 123, 127, 0.3);
}

.dark-mode .share-icon-btn:hover {
    background: var(--teal-bright);
    color: white;
}

/* FAQ - single expand */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.faq-item {
    border: 1px solid var(--teal-color);
    border-radius: 10px;
    overflow: hidden;
}

.dark-mode .faq-item {
    border-color: var(--teal-bright);
}

.faq-question {
    padding: 1rem;
    background: rgba(14, 123, 127, 0.05);
    font-weight: 600;
    color: #000;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.dark-mode .faq-question {
    background: rgba(18, 171, 176, 0.1);
    color: #fff;
}

.faq-question:hover {
    background: rgba(14, 123, 127, 0.1);
}

.dark-mode .faq-question:hover {
    background: rgba(18, 171, 176, 0.15);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 1rem;
    background: var(--light-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.dark-mode .faq-answer {
    background: var(--dark-card);
    color: #fff;
}

.faq-answer.show {
    max-height: 500px;
    padding: 1rem;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* === VIEW TRANSITION ANIMATION === */
@supports (view-transition-name: none) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
        mix-blend-mode: normal;
    }
    ::view-transition-old(root) {
        z-index: 1;
    }
    ::view-transition-new(root) {
        z-index: 9999;
    }
    .dark-mode::view-transition-old(root) {
        z-index: 9999;
    }
    .dark-mode::view-transition-new(root) {
        z-index: 1;
    }
}

/* Image lazy loading blur effect */
img[loading="lazy"] {
    filter: blur(10px);
    transition: filter 0.5s ease-out;
}

img[loading="lazy"].loaded {
    filter: blur(0);
}

/* Ensure all images have lazy loading class */
img:not([loading]) {
    loading: lazy;
}

/* === DYNAMIC INTERNAL LINK BOX === */
.dynamic-link-box {
    background: rgba(14, 123, 127, 0.05);
    border-left: 4px solid var(--primary);
    padding: 0.3rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: fadeInLink 0.5s ease-out;
    display: flex;
    align-items: flex-start;
    /* Required for the shimmer effect to stay inside the box */
    position: relative;
    overflow: hidden;
}

/* Shimmer Effect (Pseudo-element) */
.dynamic-link-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(14, 123, 127, 0.1) 50%,  /* Increased from 0.15 to 0.4 for better visibility */
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shimmerMove 3s infinite;  /* Slowed from 3s to 6s */
    pointer-events: none; /* Ensures clickability isn't blocked */
    z-index: 1;
}

/* Dark Mode Shimmer Adjustment */
.dark-mode .dynamic-link-box::before {
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(18, 171, 176, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

.dark-mode .dynamic-link-box {
    background: rgba(18, 171, 176, 0.1);
    border-left-color: var(--teal-bright);
}

.dynamic-link-text {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 0.2rem;
    font-size: 1.05rem;
    line-height: 1.4;
    transition: opacity 0.2s ease;
    flex: 1;
    min-width: 0;
    position: relative; /* Ensures text stays above shimmer */
    z-index: 2;
}

.dark-mode .dynamic-link-text {
    color: var(--teal-bright);
}

.dynamic-link-text:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.dynamic-link-text svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
}

.link-text-span {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Mobile: 2 lines with dots */
@media (max-width: 768px) {
    .link-text-span {
        -webkit-line-clamp: 2;
    }
}

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

/* Shimmer Animation Keyframes */
@keyframes shimmerMove {
    0% {
        left: -100%;
    }
    20% {
        left: 200%; /* Moves quickly across */
    }
    100% {
        left: 200%; /* Waits before repeating */
    }
}

/* ===== RELATED ARTICLES SECTION ===== */
.related-articles-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-article-card {
    display: flex;
    gap: 0.5rem;
    padding: 0.3rem;
    background: rgba(14, 123, 127, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.dark-mode .related-article-card {
    background: rgba(18, 171, 176, 0.1);
}

.related-article-card:hover {
    transform: translateX(5px);
    background: var(--teal-color);
}

.dark-mode .related-article-card:hover {
    background: var(--teal-bright);
}

.related-article-card:hover .related-article-title,
.related-article-card:hover .related-article-description,
.related-article-card:hover .related-timestamp {
    color: white;
}

.related-article-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .related-article-image {
        width: 120px;
        height: 120px;
    }
}

.related-article-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-article-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.dark-mode .related-article-title {
    color: #fff;
}

.related-article-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.dark-mode .related-article-description {
    color: #b0c4de;
}

.related-article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3rem;
}

.related-timestamp {
    font-size: 0.7rem;
    color: var(--text-secondary);  /* Matches description color */
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* === DARK MODE: MATCH DESCRIPTION COLOR === */
.dark-mode .related-timestamp {
    color: #b0c4de !important;  /* Same as .related-article-description */
}

.dark-mode .related-timestamp i {
    color: #12ABB0 !important;  /* Keep icon teal for contrast */
}
/* === FIX: Dark mode hover timestamp color === */
.dark-mode .related-article-card:hover .related-timestamp {
color: white !important;
}
.dark-mode .related-article-card:hover .related-timestamp i {
color: white !important;
}

.related-timestamp i {
    font-size: 0.65rem;
    color: inherit;
}

.related-read-btn {
    background: #0E7B7F;
    color: white;
    border: none;
    padding: 0.2rem 0.8rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    z-index: 10;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.dark-mode .related-read-btn {
    background: #12ABB0;
}

.related-read-btn:hover {
    background: var(--teal-dark);
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.related-article-card:hover .related-read-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dark-mode .related-article-card:hover .related-read-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* === VIEW ALL BUTTON STYLE === */
.view-all-btn {
    background: linear-gradient(135deg, var(--teal-color), var(--teal-dark));
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    width: fit-content;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(14, 123, 127, 0.3);
    white-space: nowrap;
}

.dark-mode .view-all-btn {
    background: linear-gradient(135deg, var(--teal-bright), var(--primary-dark));
    box-shadow: 0 2px 8px rgba(18, 171, 176, 0.3);
}

.view-all-btn:hover {
    background: linear-gradient(135deg, var(--teal-dark), var(--teal-light));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 123, 127, 0.4);
}

.dark-mode .view-all-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--teal-bright));
    box-shadow: 0 4px 12px rgba(18, 171, 176, 0.4);
}

.view-all-btn i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.view-all-btn:hover i {
    transform: translateX(3px);
}

/* === SECTION HEADER WITH VIEW ALL BUTTON === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.section-header .section-title {
    margin-bottom: 0;
    flex: 0 1 auto;
}

.section-header .view-all-btn {
    margin-left: auto;
    white-space: nowrap;
    flex: 0 0 auto;
}
