:root {
    --bg-color: #050505;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #6d28d9;
    --accent-light: #8b5cf6;
    --accent-hover: #a78bfa;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-text: #fca5a5;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --doc-text: #e4e4e7;
    --blob-1: rgba(109, 40, 217, 0.4);
    --blob-2: rgba(14, 165, 233, 0.4);
    --input-bg: rgba(255, 255, 255, 0.03);
    --nav-bg: rgba(255, 255, 255, 0.05);
    --newsletter-bg: rgba(10, 10, 10, 0.6);
    --tooltip-bg: rgba(13, 13, 15, 0.96);
    --bio-bg: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}

body.light-theme {
    --bg-color: #fbfbfb;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(0, 0, 0, 0.05);
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-hover: #818cf8;
    --danger-bg: rgba(239, 68, 68, 0.06);
    --danger-text: #dc2626;
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.025);
    --doc-text: #27272a;
    --blob-1: rgba(99, 102, 241, 0.12);
    --blob-2: rgba(14, 165, 233, 0.1);
    --input-bg: rgba(255, 255, 255, 0.6);
    --nav-bg: rgba(255, 255, 255, 0.5);
    --newsletter-bg: rgba(255, 255, 255, 0.4);
    --tooltip-bg: rgba(255, 255, 255, 0.95);
    --bio-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(255, 255, 255, 0.4) 100%);
}

body {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- HOME PAGE LOADER (Bouncing Balls) --- */
.main-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 6rem 0;
    grid-column: 1 / -1;
}

.main-loader div {
    width: 16px;
    height: 16px;
    background: var(--accent-light);
    border-radius: 50%;
    animation: bouncing-ball 0.6s infinite alternate;
}

.main-loader div:nth-child(2) { animation-delay: 0.2s; }
.main-loader div:nth-child(3) { animation-delay: 0.4s; }

@keyframes bouncing-ball {
    from {
        transform: translateY(0);
        opacity: 0.3;
        filter: blur(2px);
    }
    to {
        transform: translateY(-20px);
        opacity: 1;
        filter: blur(0);
        box-shadow: 0 10px 15px rgba(139, 92, 246, 0.3);
    }
}

/* Essential Reset & Base Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Dynamic Background Generation */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.blob.shape1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--blob-1) 0%, transparent 70%);
}

.blob.shape2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--blob-2) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(5%, 10%);
    }

    66% {
        transform: translate(-5%, 5%);
    }
}

/* Main App Container */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
}

/* View Switching Logic */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- LIST VIEW ----- */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.app-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-top: 0.5rem;
}

.notifications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 120px;
}

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

@media (min-width: 1920px) {
    .notifications-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 2160px) {
    .notifications-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-light);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
    z-index: 99999 !important;
}

/* High Priority Styling */
.card[data-priority="1"] {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.card[data-priority="1"] .category {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.category-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.55rem 1.1rem;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-light);
    border-radius: 30px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    transition: all 0.3s ease;
}

.category.clickable {
    cursor: pointer;
}

.category.clickable:hover,
.category.active-filter {
    background: var(--accent);
    color: #fff;
}

.date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ----- DETAIL VIEW ----- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--nav-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem 1.25rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateX(-4px);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

.detail-nav {
    display: flex;
    margin-bottom: 2rem;
}

.header-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.detail-header {
    text-align: left;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.detail-header .category {
    display: inline-block;
    margin-bottom: 0;
}

.detail-header h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-header .date {
    font-size: 1rem;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    gap: 1.5rem;
    color: var(--text-secondary);
}

.dots-loader {
    display: flex;
    gap: 8px;
}

.dots-loader div {
    width: 12px;
    height: 12px;
    background-color: var(--accent-light);
    border-radius: 50%;
    animation: bounce 0.5s alternate infinite;
}

.dots-loader div:nth-child(2) {
    animation-delay: 0.15s;
}

.dots-loader div:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    from {
        transform: translateY(0);
        opacity: 0.6;
    }

    to {
        transform: translateY(-12px);
        opacity: 1;
        box-shadow: 0 10px 20px rgba(139, 92, 246, 0.5);
    }
}

/* DOC CONTENT CONTAINER (Seamless Integration) */
.doc-content {
    padding: 1rem 0;
    font-size: 1.1rem;
    color: var(--doc-text);
    line-height: 1.65;
    text-align: justify;
    hyphens: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Typography Scale & Formats */
.doc-content p {
    margin-top: 0 !important;
    margin-bottom: 1.6rem !important;
}

.doc-content p:empty {
    display: none !important;
}

/* Force inherit layout rules */
.doc-content * {
    background-color: transparent !important;
    color: inherit !important;
    font-family: inherit !important;
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
    color: var(--text-primary);
    margin-top: 1.8rem;
    margin-bottom: 0.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.doc-content h1:first-child,
.doc-content h2:first-child {
    margin-top: 0;
}

.doc-content a {
    color: var(--accent-light);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.doc-content a:hover {
    color: var(--accent-hover);
    background: rgba(139, 92, 246, 0.05);
}

.doc-content img {
    display: block;
    width: 80%;
    height: auto;
    border-radius: 12px;
    margin: 2rem auto !important;
    box-shadow: var(--card-shadow);
}

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

.doc-content li {
    margin-bottom: 0.25rem;
}

.twitter-embed-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 2rem 0;
}

.twitter-embed-wrapper .twitter-tweet {
    width: 80% !important;
    margin: 0 !important;
}

/* Responsive Media Overrides */
@media (max-width: 768px) {

    .doc-content img,
    .embed-container {
        width: 95% !important;
        padding-bottom: 0 !important;
        /* 16:9 for 95% width */
    }

    .twitter-embed-wrapper .twitter-tweet {
        width: 95% !important;
    }
}

/* Table & Data Visualization Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 500px;
}

.doc-content th,
.doc-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.doc-content th {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.doc-content tr:last-child td {
    border-bottom: none;
}

.doc-content tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Ensure paragraph margins inside tables don't break vertical centering */
.doc-content td p {
    margin: 0 !important;
    padding: 0 !important;
}

/* --- ENHANCEMENTS & NEW COMPONENTS --- */

/* Search Bar */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

#search-input {
    width: 100%;
    padding: 1.1rem 1.5rem 1.1rem 3.5rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-light);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Scroll Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent-hover));
    z-index: 10000;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Share Button */
.detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 30px;
    color: var(--accent-light);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.55rem 1.1rem;
    min-height: 38px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Read Time Badge */
.read-time-badge {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Media Embeds */
.embed-container {
    position: relative;
    padding-bottom: 45%;
    /* Adjusted for 80% width */
    height: 0;
    overflow: hidden;
    width: 80%;
    margin: 2.5rem auto;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
}

.toast {
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scroll Sentinel */
#scroll-sentinel {
    grid-column: 1 / -1;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 2.25rem;
    }

    .doc-content {
        padding: 0;
        font-size: 1rem;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .detail-header h1 {
        font-size: 1.85rem;
    }

    .app-container {
        padding: 1.25rem 1rem;
    }

    .detail-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .search-container {
        margin-bottom: 1.5rem;
    }

    /* Ensure media doesn't push width */
    .doc-content img,
    .embed-container,
    .twitter-embed-wrapper .twitter-tweet {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .embed-container {
        padding-bottom: 56.25% !important;
        /* Perfect 16:9 for full width */
    }
}

/* Permanent Footer */
.app-footer {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-primary);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Home Page Mode: Docked */
.list-mode .app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

/* Detail Page Mode: At the End */
.detail-mode .app-footer {
    position: relative;
    margin-top: 0rem;
    background: transparent;
    backdrop-filter: none;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.app-footer a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.app-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- NEWSLETTER SECTION (PREMIUM REFINEMENT) --- */
.newsletter-section {
    padding: 0.75rem 2rem;
    background: var(--newsletter-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.newsletter-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.newsletter-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.newsletter-header h3 {
    font-size: 0.9rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
}

.newsletter-header h3::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent-light);
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

.newsletter-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.newsletter-form {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.input-group {
    display: flex;
    gap: 8px;
    background: var(--input-bg);
    padding: 5px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.input-group:focus-within {
    border-color: var(--accent-light);
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

#newsletter-email {
    flex: 1;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
}

#newsletter-email::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

#newsletter-submit {
    padding: 0 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#newsletter-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.4);
    filter: brightness(1.1);
}

.newsletter-message {
    position: absolute;
    top: -1.8rem;
    right: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.newsletter-message.success {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.newsletter-message.error {
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

/* --- DYNAMIC VISIBILITY LOGIC --- */

.list-mode .newsletter-section {
    position: fixed;
    bottom: 70px;
    /* Shifted upward as requested */
    left: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle glow to separate from content */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.list-mode .notifications-grid {
    margin-bottom: 120px;
}

.detail-mode .newsletter-section {
    position: relative;
    margin: 0rem auto 3rem auto;
    background: var(--nav-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 750px;
    padding: 2rem 3rem;
}

@media (max-width: 768px) {
    .newsletter-container {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }

    .newsletter-header h3 {
        justify-content: center;
    }

    .newsletter-form {
        max-width: 100%;
    }

    .list-mode .newsletter-section {
        bottom: 74px;
        padding: 1.25rem;
    }

    .detail-mode .newsletter-section {
        padding: 2rem;
        margin-top: 3rem;
    }
}

/* Toast System Support */
/* Page context tag */
.page-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-light);
    margin-bottom: 1rem;
    display: block;
}

/* Detail view author alignment */
.detail-header .author-section {
    margin-top: 0;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

/* ===== BLOG / AUTHOR SYSTEM ===== */

/* Blog badge on card */
.blog-badge {
    font-size: 0.75rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(109, 40, 217, 0.2));
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 30px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
}

/* Author Section */
.author-section {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.85rem;
    position: relative;
    flex-wrap: wrap;
}

.authored-by {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Stacked Circular Avatars */
.author-avatars {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(10, 10, 10, 0.8);
    object-fit: cover;
    margin-left: -8px;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease;
}

.author-avatars .author-avatar:first-child {
    margin-left: 0;
}

.author-avatar:hover {
    transform: scale(1.15);
    z-index: 10 !important;
}

/* Author Names */
.author-names {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: wrap;
}

.author-name {
    color: var(--accent-light);
    font-weight: 500;
    cursor: pointer;
}

.author-name:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.author-extra {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.78rem;
}

/* Hover Tooltip - Premium Compact Flyout (Moved Below) */
.author-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: -8px;
    background: var(--tooltip-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 12px;
    padding: 0.25rem;
    z-index: 100000;
    min-width: 220px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--glass-border);
    flex-direction: column;
    gap: 0.3rem;
    animation: tooltipFlyIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top left;
}

/* Hover Bridge - Prevents tooltip from disappearing during cursor transit */
.author-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 15px;
}

.author-section:hover .author-tooltip {
    display: flex;
}

.tooltip-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tooltip-author:hover {
    background: var(--accent-light);
    color: #fff !important;
    border-color: var(--accent);
}

.tooltip-author:hover span {
    color: #fff !important;
}

.tooltip-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #000;
}

.tooltip-author span {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Author Profile Detail View Redesign */
.bio-header {
    background: var(--bio-bg) !important;
    padding: 2.5rem !important;
    border-radius: 24px !important;
    border: 1px solid var(--accent-light) !important; box-shadow: var(--card-shadow);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Phone View Restructuring for Bio Header */
@media (max-width: 768px) {
    .bio-header {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem !important;
        gap: 1.5rem;
    }

    .author-profile-info h2 {
        font-size: 1.5rem !important;
    }

    .author-profile-info p {
        font-size: 0.85rem !important;
        line-height: 1.6;
    }
}

.author-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-light);
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.author-profile-info h2 {
    font-size: 1.4rem;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.author-profile-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Blog card indicator */
.card.is-blog .card-title-area {
    border-left: 3px solid var(--accent-light);
    padding-left: 0.85rem;
    margin-top: 0.5rem;
}
/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent-light);
    color: var(--accent-light);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

/* Toggle States */
body.light-theme .theme-toggle .sun { opacity: 0; transform: scale(0) rotate(90deg); }
body.light-theme .theme-toggle .moon { opacity: 1; transform: scale(1) rotate(0); }

body:not(.light-theme) .theme-toggle .sun { opacity: 1; transform: scale(1) rotate(0); }
body:not(.light-theme) .theme-toggle .moon { opacity: 0; transform: scale(0) rotate(-90deg); }

@media (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 38px;
        height: 38px;
    }
}
/* --- ADMIN AUTH MODAL (Glassmorphism) --- */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
}

.admin-modal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.admin-modal h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.admin-modal p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.admin-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.admin-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
    transition: 0.3s all;
}

.admin-input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.admin-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s all;
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.3);
}

.admin-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(109, 40, 217, 0.5);
}

.admin-error {
    color: #fca5a5;
    font-size: 0.85rem;
    margin-top: 1rem;
    display: none;
}

/* Light Mode Overrides for Modal */
body.light-theme .admin-modal-overlay {
    background: rgba(255, 255, 255, 0.7);
}

body.light-theme .admin-modal {
    background: #fff;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

body.light-theme .admin-input {
    background: #f4f4f5;
    color: #18181b;
}
