:root {
    --bg-color: #0a0e1a;
    --text-color: #e0e0e0;
    --card-bg: #1a1f2e;
    --border-color: #2a3441;
    --accent-color: #00bfff; /* Electric Blue */
    --accent-hover: #0099ff;
    --accent-purple: #9d4edd; /* Purple accent */
    --accent-purple-hover: #7b2cbf;
    --success-bg: #1a3a2a;
    --success-border: #2a5a3a;
    --success-text: #90ff90;
    --error-bg: #3a1a1a;
    --error-border: #5a2a2a;
    --error-text: #ff9090;
    --input-bg: #1a1f2e;
    --input-border: #2a3441;
    --button-bg: var(--accent-color);
    --button-hover-bg: var(--accent-hover);
    --link-color: var(--accent-color);
    --heading-color: #ffffff;
}

/* Keyframe Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 191, 255, 0.3), 0 0 10px rgba(0, 191, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(0, 191, 255, 0.5), 0 0 20px rgba(0, 191, 255, 0.3), 0 0 30px rgba(157, 78, 221, 0.2);
    }
}

@keyframes glow-purple {
    0%, 100% {
        box-shadow: 0 0 5px rgba(157, 78, 221, 0.3), 0 0 10px rgba(157, 78, 221, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(157, 78, 221, 0.5), 0 0 20px rgba(157, 78, 221, 0.3);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}
/* Float animation disabled - containers should not float */

html {
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    max-width: 100vw; /* Ensure html doesn't exceed viewport width */
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color); /* Fallback background */
    color: var(--text-color);
    position: relative; /* Needed for z-index context */
    min-height: 100vh; /* Ensure body takes at least full viewport height */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    max-width: 100vw; /* Ensure body doesn't exceed viewport width */
}

/* Background Video Styles */
.video-background-container {
    position: fixed; /* Fix position relative to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Place behind all content */
    overflow: hidden; /* Hide parts of video outside container */
}

#background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%); /* Center the video */
    object-fit: cover; /* Cover the area, cropping if needed */
    z-index: -2;
    opacity: 0.5; /* 50% opacity as requested */
}

/* Overlay to darken video for text readability - REMOVED */
/*
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65); 
    z-index: -1; 
}
*/

/* Ensure content stays above video */
.main-nav, .container {
     position: relative; /* Create stacking context */
     z-index: 1; /* Ensure content is above overlay/video */
}

/* Navigation Bar */
.main-nav {
    /* background-color: var(--card-bg); */ /* Remove or make transparent? */
    background-color: rgba(42, 42, 42, 0.8); /* Semi-transparent background */
    border-bottom: 1px solid var(--border-color);
    padding: 0.5em 1em;
    margin-bottom: 0;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}

.nav-container {
    max-width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between; /* Space between brand and links */
    align-items: center;
    position: relative;
    padding: 0 1em; /* Reduced padding */
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .nav-container {
        max-width: 100%;
        /* Hamburger sits on the far left, logo right next to it. */
        justify-content: flex-start;
        gap: 0.6em;
        padding: 0 0.5em;
    }
}

.nav-brand {
    color: var(--heading-color);
    text-decoration: none;
    font-size: 1.3em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.nav-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}
.nav-brand-text {
    color: var(--heading-color);
    font-size: 1.3em;
    font-weight: bold;
}
.nav-logo {
    height: 90px;
    width: auto;
}

@media (max-width: 768px) {
    .nav-logo-img {
        height: 32px;
    }
    .nav-logo {
        height: 60px;
    }
    .nav-brand-text {
        font-size: 1.1em;
    }
}

/* Hamburger Menu Button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.nav-hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
    .nav-hamburger {
        display: flex;
        order: -1; /* Force the hamburger to the far left of the nav bar */
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5em;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        /* Drawer slides in from the LEFT to match the left-side hamburger. */
        left: -100%;
        right: auto;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(26, 31, 46, 0.98), rgba(20, 25, 38, 0.98));
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 1.5em 2em 1.5em;
        gap: 0;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        border-right: 1px solid rgba(0, 191, 255, 0.3);
        overflow-y: auto;
    }
    
    .nav-links.mobile-open {
        left: 0;
        right: auto;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Close menu overlay */
    .nav-links.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100vw;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

.nav-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 1em;
    transition: color 0.2s ease;
    padding: 0.5em 0;
}

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

/* Notification Badge */
.nav-notification-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em;
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.2s ease;
    margin-right: 0.5em;
}

.nav-notification-badge:hover {
    transform: scale(1.1);
    color: var(--accent-color);
}

.notification-icon {
    font-size: 1.5em;
    position: relative;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
    border: 2px solid var(--bg-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

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

.nav-notification-badge-mobile {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 1em 0;
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 191, 255, 0.1);
    width: 100%;
    position: relative;
}

.nav-notification-badge-mobile:hover {
    color: var(--accent-hover);
}

.nav-notification-badge-mobile .notification-count {
    position: static;
    margin-left: auto;
}

@media (max-width: 768px) {
    .nav-links a {
        width: 100%;
        padding: 1em 0;
        border-bottom: 1px solid rgba(0, 191, 255, 0.1);
        font-size: 1.1em;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
}

.nav-user {
    margin-right: 1.5em;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .nav-user {
        margin-right: 0;
        margin-bottom: 0.5em;
    }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 1400px; /* Increased max width for desktop */
    margin: 0 auto; /* Center container */
    /* Top padding clears the fixed nav (~57px) so page content (Profile,
       Pricing, etc.) isn't tucked under the header. The dashboard's container
       is overridden to padding:0 via the :has(.main-layout-container) rule
       below, so this only affects normal content pages. */
    padding: 78px 2em 2em 2em;
    box-sizing: border-box;
    background-color: transparent; /* Ensure container isn't opaque */
}

/* Remove padding when container contains main-layout-container */
.container:has(.main-layout-container) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
}

/* Remove padding when container is inside main-layout-container */
.main-layout-container .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Main layout container should be full width but allow flex children */
.main-layout-container {
    max-width: 100vw !important;
    width: 100vw !important;
    margin-top: 60px !important; /* Account for fixed header */
}

/* Responsive container padding */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        width: 100%;
        /* Clear the fixed nav on mobile normal pages too. */
        padding: 66px 0.5em 2em 0.5em;
        box-sizing: border-box;
        overflow-x: hidden; /* Prevent horizontal overflow */
    }
    
    .main-layout-container .container,
    .main-layout-container {
        padding: 0;
    }
}

h1, h2, h3 {
    color: var(--heading-color);
    margin-bottom: 0.75em;
}

/* Desktop: left-align headings, Mobile: center-align */
h1, h2, h3 {
    text-align: left;
}

@media (max-width: 768px) {
    h1, h2, h3 {
        text-align: center;
    }
}

h1 {
    margin-bottom: 1em;
    font-size: 2.2em;
}

h2 {
    font-size: 1.8em;
}

h3 {
    font-size: 1.4em;
}

/* Mobile: Reduce heading sizes to prevent wrapping */
@media (max-width: 768px) {
    h1 {
        font-size: 1.6em;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.4em;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.2em;
        line-height: 1.3;
    }
}

.section {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.9));
    padding: 2em; /* Increased padding */
    margin-bottom: 2em;
    border-radius: 12px; /* More rounded corners */
    border: 1px solid rgba(0, 191, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 191, 255, 0.1);
    transition: all 0.3s ease;
    /* animation: float 6s ease-in-out infinite; */ /* Disabled floating effect */
}

/* ===== Per-tab header bar =====
   Gives every left-side tab a consistent HUD-style header that matches the
   Command Center header (neon gradient bar + glowing title). Rendered via the
   tab_header() macro in index.html. */
.tab-header {
    padding: 0.95em 1.5em;
    margin-bottom: 1.25em;
    scroll-margin-top: 75px; /* keep clear of the fixed site header when scrolled to */
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.15), rgba(157, 78, 221, 0.1));
    border: 2px solid rgba(0, 191, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.2), 0 0 40px rgba(157, 78, 221, 0.15);
}
/* The compact tabs (Notifications, Web Pulse, Share of Voice, AI Assistant)
   strip their section padding to remove old empty-space bugs, which left their
   header tucked right under the fixed nav. Give the header a little top gap so
   it sits clearly below the header bar. */
#notifications-search-tab .tab-header,
#webmood-search-tab .tab-header,
#share-of-voice-search-tab .tab-header,
#ai-assistant-search-tab .tab-header {
    margin-top: 1.1em;
}
.tab-header .tab-header-text {
    min-width: 0;
}
.tab-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.05;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 191, 255, 0.6), 0 0 30px rgba(157, 78, 221, 0.4);
}
/* Per-character neon flicker. JS wraps each title letter in a .flick span and
   randomizes the duration/delay so letters flicker independently. */
.tab-header h2 .flick {
    display: inline-block;
    animation: tab-title-flicker var(--flk-dur, 5s) ease-in-out var(--flk-delay, 0s) infinite;
}
@keyframes tab-title-flicker {
    0%, 90%, 100% { opacity: 1; }
    92% { opacity: 0.45; }
    94% { opacity: 0.95; }
    96% { opacity: 0.55; }
    98% { opacity: 1; }
}
.tab-header .tab-header-subtitle {
    margin: 0.02em 0 0 0;
    font-size: 0.9em;
    font-weight: 400;
    line-height: 1.45;
    color: #b8c3d6;
    letter-spacing: 0.2px;
    text-transform: none;
    text-shadow: none;
    max-width: 70ch;
    /* Reserve a single line so the typewriter effect doesn't fully collapse
       the line as it types, without adding visible empty space. */
    min-height: 1.45em;
}
@media (prefers-reduced-motion: reduce) {
    .tab-header h2 .flick {
        animation: none;
    }
}
/* Blinking terminal-style caret to make the header feel "alive" */
.tab-header .tab-header-subtitle::after {
    content: '';
    display: inline-block;
    width: 0.5em;
    height: 1em;
    margin-left: 3px;
    vertical-align: -0.12em;
    background: #4fc3f7;
    box-shadow: 0 0 8px rgba(0, 191, 255, 0.9);
    animation: tab-caret-blink 1s steps(1) infinite;
}
@keyframes tab-caret-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .tab-header .tab-header-subtitle::after {
        animation: none;
        opacity: 0;
    }
}
@media (max-width: 768px) {
    .tab-header {
        padding: 0.75em 1em;
        margin-bottom: 0.9em;
    }
    .tab-header h2 {
        font-size: 1.15em;
        letter-spacing: 1px;
    }
    .tab-header .tab-header-subtitle {
        font-size: 0.82em;
    }
}

/* Remove border and box-shadow on mobile for search-section to eliminate visual space */
@media (max-width: 768px) {
    .section.search-section.no-padding-mobile,
    .search-section.section.no-padding-mobile {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        background: transparent !important;
        min-height: 0 !important;
        height: auto !important;
    }
}

.section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 191, 255, 0.2), 0 0 40px rgba(157, 78, 221, 0.1);
    border-color: rgba(0, 191, 255, 0.4);
    /* animation: float 4s ease-in-out infinite; */ /* Disabled floating effect */
}

@media (max-width: 768px) {
    .section {
        padding: 1.2em;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Remove ALL padding/margin from .section.search-section on mobile - override everything */
    .section.search-section,
    .search-section.section {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
    }
    
    /* For no-padding-mobile, also remove background and border completely */
    .section.search-section.no-padding-mobile,
    .search-section.section.no-padding-mobile {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    /* But allow small padding for tabs that aren't the problematic ones */
    .section.search-section:not(.no-padding-mobile):not(:has(#webmood-search-tab.active)):not(:has(#notifications-search-tab.active)):not(:has(#ai-assistant-search-tab.active)):not(:has(#share-of-voice-search-tab.active)) {
        padding: 0.5em !important;
    }
    
    /* Remove section padding on mobile when specific tabs are active - using class added by JavaScript */
    .search-section.section.no-padding-mobile,
    .section.search-section.no-padding-mobile {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Fallback using :has() for browsers that support it */
    .search-section.section:has(#webmood-search-tab.active),
    .search-section.section:has(#notifications-search-tab.active),
    .search-section.section:has(#ai-assistant-search-tab.active),
    .search-section.section:has(#share-of-voice-search-tab.active),
    .section:has(#webmood-search-tab.active),
    .section:has(#notifications-search-tab.active),
    .section:has(#ai-assistant-search-tab.active),
    .section:has(#share-of-voice-search-tab.active) {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
}

/* Form Layout - Desktop uses more space */
/* Search Section - Centered Layout */
.search-section {
    text-align: center;
}

.search-section h2 {
    text-align: center !important;
    margin-bottom: 1.5em;
}

.search-section form,
.subscription-section form,
.rss-subscription-section form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.search-section form label {
    text-align: center !important;
    display: block;
    width: 100%;
}

.search-section form select {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border: 2px solid rgba(0, 191, 255, 0.4);
    border-radius: 8px;
    color: var(--text-color);
    padding: 0.85em 1em;
    font-size: 16px;
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300bfff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1em center;
    background-size: 12px;
    padding-right: 2.5em;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.2), inset 0 0 10px rgba(157, 78, 221, 0.1);
    animation: glow 3s ease-in-out infinite;
    margin-bottom: 0.5em;
}

.search-section form select:hover {
    border-color: rgba(0, 191, 255, 0.7);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.4), 0 0 25px rgba(157, 78, 221, 0.2), inset 0 0 15px rgba(157, 78, 221, 0.15);
    animation: glow 1.5s ease-in-out infinite;
    transform: translateY(-1px);
}

.search-section form select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5), 0 0 30px rgba(157, 78, 221, 0.3), inset 0 0 20px rgba(157, 78, 221, 0.2);
    animation: glow 1s ease-in-out infinite;
}

.search-section form input[type="url"],
.search-section form input[type="text"] {
    width: 100%;
    text-align: center;
}

.search-section form button {
    justify-self: center;
    margin-top: 0.5em;
}

/* Compact form layout for Website Crawler and RSS Feeds tabs.
 * The .search-section form input rule above forces width: 100% on URL
 * and text inputs, so without a form-level max-width these fields stretch
 * across the entire content area on desktop. The existing @media
 * (min-width: 1024px) block below caps .search-section form at 600px, but
 * that leaves a "stretching" zone between ~768px and 1024px (tablets and
 * narrow desktop windows). Cap both tabs' forms at all widths so they
 * stay readable and visually compact on every screen size. On mobile the
 * cap is wider than the viewport, so the form remains full-width.
 *
 * Targets both the primary search form and the "Add Subscription" form
 * inside each tab (any nested form, since these tabs only contain
 * full-width input forms -- filter rows are styled separately).
 */
#website-search-tab form,
#rss-search-tab form {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Tighter input/select padding inside the compact forms so the smaller
 * width doesn't make labels feel cramped against the field edges. */
#website-search-tab form input[type="url"],
#website-search-tab form input[type="text"],
#website-search-tab form select,
#rss-search-tab form input[type="url"],
#rss-search-tab form input[type="text"],
#rss-search-tab form select {
    padding: 0.7em 0.9em !important;
    font-size: 0.95em !important;
}

#website-search-tab form button[type="submit"],
#website-search-tab form .clear-search-btn,
#rss-search-tab form button[type="submit"],
#rss-search-tab form .clear-search-btn {
    max-width: 220px;
}

/* Override the 1024px+ rule (max-width: 600px) so the narrower 480px
 * cap holds on wide desktop monitors too. The selector specificity is
 * higher than `.search-section form` so the rule below also wins inside
 * the @media (min-width: 1024px) block above, but make the intent
 * explicit at the desktop breakpoint where the issue is most visible.
 */
@media (min-width: 1024px) {
    #website-search-tab form,
    #rss-search-tab form {
        max-width: 480px;
    }
}

.search-section #search-results {
    text-align: center;
    margin-top: 2em;
}

.search-section #search-results h3 {
    text-align: center !important;
    margin-bottom: 1em;
}

.search-section #results-list {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .search-section form {
        grid-template-columns: 1fr;
        gap: 1.5em;
        max-width: 600px;
    }
    
    .search-section form label {
        grid-column: 1 / -1;
        text-align: center !important;
    }
    
    .search-section form input[type="url"],
    .search-section form input[type="text"] {
        grid-column: 1 / -1;
        text-align: center;
    }
    
    .search-section form button {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 200px;
    }
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600; /* Slightly bolder */
    font-size: 0.95em;
}

/* General Select/Dropdown Styling - Electric Theme */
select {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border: 2px solid rgba(0, 191, 255, 0.4);
    border-radius: 8px;
    color: var(--text-color);
    padding: 0.85em 1em;
    font-size: 16px;
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300bfff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1em center;
    background-size: 12px;
    padding-right: 2.5em;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.2), inset 0 0 10px rgba(157, 78, 221, 0.1);
    animation: glow 3s ease-in-out infinite;
    margin-bottom: 1em;
}

select:hover {
    border-color: rgba(0, 191, 255, 0.7);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.4), 0 0 25px rgba(157, 78, 221, 0.2), inset 0 0 15px rgba(157, 78, 221, 0.15);
    animation: glow 1.5s ease-in-out infinite;
    transform: translateY(-1px);
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5), 0 0 30px rgba(157, 78, 221, 0.3), inset 0 0 20px rgba(157, 78, 221, 0.2);
    animation: glow 1s ease-in-out infinite;
}

select option {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 0.75em 1em;
    border: none;
}

select option:hover,
select option:checked {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(157, 78, 221, 0.15));
    color: var(--accent-color);
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.85em 1em; /* Better padding */
    margin-bottom: 1em;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    border-radius: 6px; /* More rounded */
    box-sizing: border-box;
    font-size: 16px; /* Prevent iOS zoom - must be 16px or larger */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-tap-highlight-color: rgba(0, 191, 255, 0.3);
    /* Allow context menu for paste on mobile - don't use manipulation */
    -webkit-touch-callout: default;
    -webkit-user-callout: default;
    /* Only use manipulation for non-input elements, not for text inputs */
}

@media (max-width: 768px) {
    input[type="text"],
    input[type="url"],
    input[type="email"],
    input[type="password"],
    input[type="number"] {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 1em;
        margin-bottom: 1.2em;
        /* Better touch targets */
        min-height: 44px;
        /* Enhanced mobile paste support */
        -webkit-user-select: text !important;
        user-select: text !important;
        -webkit-tap-highlight-color: rgba(0, 191, 255, 0.4) !important;
        /* Prevent input from losing focus during paste */
        pointer-events: auto;
        -webkit-touch-callout: default;
        /* Allow context menu - don't use touch-action: manipulation */
        touch-action: auto !important;
    }
    
    /* Ensure paste menu stays visible on iOS */
    input[type="text"]:focus,
    input[type="url"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus,
    input[type="number"]:focus {
        -webkit-user-select: text !important;
        user-select: text !important;
        -webkit-touch-callout: default;
    }
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.2), 0 0 15px rgba(0, 191, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

button[type="submit"] {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    padding: 0.9em 2em; /* Better padding */
    border: none;
    border-radius: 6px; /* More rounded */
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.4);
    animation: glow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.6), 0 0 30px rgba(157, 78, 221, 0.3);
    animation: glow 1.5s ease-in-out infinite;
}

button[type="submit"]:active {
    transform: translateY(0);
    animation: none;
}

/* Clear Search Button */
.clear-search-btn {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.3), rgba(70, 70, 70, 0.25));
    border: 1px solid rgba(150, 150, 150, 0.5);
    color: #ccc;
    padding: 0.9em 2em;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.clear-search-btn:hover {
    background: linear-gradient(135deg, rgba(150, 150, 150, 0.4), rgba(100, 100, 100, 0.35));
    border-color: rgba(200, 200, 200, 0.7);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Paste Button Styling */
.paste-button {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.8), rgba(0, 191, 255, 0.8));
    color: white;
    border: 2px solid rgba(0, 191, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(157, 78, 221, 0.4);
    animation: glow-purple 3s ease-in-out infinite;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    line-height: 1.5;
    margin: 0;
    vertical-align: middle;
}

/* Ensure YouTube URL input matches paste button height */
#youtube_url {
    height: 48px !important;
    border: 2px solid var(--input-border) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.paste-button:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.9), rgba(157, 78, 221, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.6), 0 0 25px rgba(0, 191, 255, 0.4);
    animation: glow-purple 1.5s ease-in-out infinite;
}

.paste-button:active {
    transform: translateY(0);
    animation: none;
}

@media (max-width: 768px) {
    .paste-button {
        font-size: 0.85em;
        padding: 0.9em 1em !important;
        min-height: 44px; /* Better touch target */
    }
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5em 0;
}

/* Main Layout Container - Full Screen */
.main-layout-container {
    display: flex;
    gap: 0;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Ensure no padding on any child elements */
.main-layout-container * {
    box-sizing: border-box;
}


/* Sidebar Section - Minimizable - About 1/4 of screen */
.sidebar-section {
    flex-shrink: 0;
    width: 25%;
    min-width: 200px;
    max-width: 300px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border-right: 1px solid rgba(0, 191, 255, 0.2);
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    position: fixed !important;
    top: 60px !important; /* Position below header */
    left: 0 !important;
    bottom: 0 !important;
    align-self: flex-start !important;
    transition: width 0.3s ease;
    height: calc(100vh - 60px) !important; /* Account for header height */
    max-height: calc(100vh - 60px) !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    z-index: 1 !important; /* Below header (z-index: 100) and below search-section */
}

.sidebar-section.minimized {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

/* Adjust search-section margin when sidebar is minimized */
.sidebar-section.minimized ~ .search-section,
.main-layout-container:has(.sidebar-section.minimized) .search-section {
    margin-left: 60px !important;
    width: calc(100% - 60px) !important;
}

/* Ensure search-section adjusts when sidebar is expanded (not minimized) */
.sidebar-section:not(.minimized) ~ .search-section,
.main-layout-container:has(.sidebar-section:not(.minimized)) .search-section {
    margin-left: 300px !important; /* Match sidebar max-width */
    width: calc(100% - 300px) !important;
}

/* Override sidebar margin rules on mobile */
@media (max-width: 768px) {
    .sidebar-section.minimized ~ .search-section,
    .main-layout-container:has(.sidebar-section.minimized) .search-section,
    .sidebar-section:not(.minimized) ~ .search-section,
    .main-layout-container:has(.sidebar-section:not(.minimized)) .search-section {
        margin-left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* ------------------------------------------------------------------
 * Footer placement
 *
 * The dashboard sidebar is position:fixed (top:60px;left:0;bottom:0),
 * so as you scroll down it overlays the left portion of any normal-flow
 * element underneath it — including the footer. The fix is to make sure
 * the footer either:
 *   - Sits next to the sidebar (desktop, sidebar present), OR
 *   - Spans the full viewport width (every other case).
 *
 * `body:has(.sidebar-section)` lets us scope the offset to ONLY the pages
 * that actually have a sidebar (currently just the dashboard) so login,
 * about, contact, etc. stay full-width. `:has()` is supported in all
 * modern browsers (Chrome 105+, Safari 15.4+, Firefox 121+).
 * ------------------------------------------------------------------ */
.main-footer {
    position: relative;
    z-index: 2;                  /* sit above the fixed sidebar (z-index: 1) */
    box-sizing: border-box;
    width: 100%;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Sidebar expanded: footer starts where the sidebar ends. */
body:has(.sidebar-section:not(.minimized)) .main-footer {
    margin-left: 300px;
    width: calc(100% - 300px);
}

/* Sidebar minimized: footer starts after the slim rail. */
body:has(.sidebar-section.minimized) .main-footer {
    margin-left: 60px;
    width: calc(100% - 60px);
}

/* On mobile the sidebar collapses into a hamburger overlay, so the
   footer should always be full-width regardless of sidebar state. */
@media (max-width: 768px) {
    body:has(.sidebar-section) .main-footer,
    body:has(.sidebar-section.minimized) .main-footer,
    body:has(.sidebar-section:not(.minimized)) .main-footer {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Fallback for browsers without :has() — make the footer always full-width.
   Modern browsers honor the more specific rules above. */
@supports not selector(:has(*)) {
    .main-footer { margin-left: 0 !important; width: 100% !important; }
}

.sidebar-toggle-btn {
    position: absolute;
    top: 1em;
    right: 0.5em;
    background: rgba(0, 191, 255, 0.2);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 4px;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.5em;
    font-size: 0.9em;
    transition: all 0.3s ease;
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    background: rgba(0, 191, 255, 0.3);
    border-color: rgba(0, 191, 255, 0.5);
}

.sidebar-section.minimized .sidebar-toggle-btn {
    right: 0.5em;
    left: auto;
}

.sidebar-nav-content {
    padding: 3em 0.5em 1em 0.5em;
    transition: padding 0.3s ease;
    overflow: hidden !important;
    overflow-y: auto !important; /* Allow scrolling within sidebar */
    overflow-x: hidden !important;
    height: 100% !important;
    max-height: 100% !important;
    position: relative !important;
}

.sidebar-section.minimized .sidebar-nav-content {
    padding: 3em 0.25em 1em 0.25em;
}

/* Sidebar Content Area - Takes remaining 3/4 of screen */
.search-section {
    flex: 1 !important;
    flex-shrink: 1 !important;
    flex-grow: 1 !important;
    flex-basis: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 2em !important;
    margin: 0 !important;
    margin-left: 300px !important; /* Match sidebar max-width to prevent overlap */
    margin-top: 0 !important; /* No margin-top needed - main-layout-container handles it */
    width: calc(100% - 300px) !important; /* Match sidebar max-width */
    background-color: var(--bg-color);
    border-radius: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: calc(100vh - 60px) !important; /* Account for header */
    height: auto !important;
    max-height: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    contain: layout style !important;
    align-self: stretch !important;
    z-index: 2 !important; /* Above sidebar (z-index: 1) but below header (z-index: 100) */
    transition: margin-left 0.3s ease, width 0.3s ease; /* Smooth transition when sidebar expands/collapses */
}

/* Ensure all direct children of search-section are block-level and don't create columns */
/* Apply to direct children except search-tab-content which has its own rules */
.search-section > *:not(.search-tab-content) {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: none !important;
    box-sizing: border-box !important;
}

/* Ensure search-tab-content is a direct child and stays in flow */
.search-section > .search-tab-content,
.search-section .search-tab-content {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    order: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: none !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.search-section > .search-tab-content.active,
.search-section .search-tab-content.active {
    display: block !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    order: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Set explicit flex order for each tab to ensure proper stacking */
#command-center-search-tab,
#command-center-search-tab.active {
    order: 0 !important;
}

#webmood-search-tab,
#webmood-search-tab.active {
    order: 1 !important;
}

#notifications-search-tab,
#notifications-search-tab.active {
    order: 2 !important;
}

/* Force notifications and webpulse tabs to stay in column */
#notifications-search-tab,
#webmood-search-tab {
    width: 100% !important;
    max-width: 100% !important;
    display: none !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
}

#notifications-search-tab.active,
#webmood-search-tab.active {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
}

/* Ensure search-section contains all tab content */
.search-section {
    contain: layout style !important;
    isolation: isolate !important;
}

/* Prevent any child from breaking out of search-section */
.search-section * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Make command center logo smaller */
#command-center-search-tab img[src*="pulseindex-logo"] {
    max-width: 120px !important;
    width: 120px !important;
    height: auto !important;
    display: block !important;
}

/* Ensure webmood and notifications tabs are properly contained */
.search-section #webmood-search-tab,
.search-section #notifications-search-tab {
    width: 100% !important;
    max-width: 100% !important;
    display: none !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
    order: 0 !important;
}

.search-section #webmood-search-tab.active,
.search-section #notifications-search-tab.active {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
    order: 0 !important;
}

/* Force notifications tab to stay within search-section - override any absolute positioning */
.main-layout-container .search-section #notifications-search-tab {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    clear: none !important;
    display: none !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: 0 !important;
}

.main-layout-container .search-section #notifications-search-tab.active {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    clear: none !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: 0 !important;
}

/* Ensure notification-section doesn't break out */
.main-layout-container .search-section #notifications-search-tab .notification-section {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    position: relative !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    min-width: 0 !important;
}

/* Prevent premium-features-section from affecting notifications tab layout */
.main-layout-container .search-section .premium-features-section {
    order: 3 !important; /* Place after notifications tab */
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    margin-top: 3em !important;
}

/* Ensure search-section itself doesn't break out of main-layout-container */
.main-layout-container > .search-section {
    flex: 1 !important;
    flex-shrink: 1 !important;
    flex-grow: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
}

/* Critical: Ensure notifications tab stays in flex flow and doesn't break out */
.main-layout-container .search-section #notifications-search-tab {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: 2 !important; /* Place after command-center (0) and webmood (1) */
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clear: none !important;
    float: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: 1 !important;
    transform: none !important;
    will-change: auto !important;
}

.main-layout-container .search-section #notifications-search-tab.active {
    display: block !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: 2 !important;
    align-self: stretch !important;
    position: relative !important;
    transform: none !important;
}

/* Ensure notifications tab never breaks out of search-section */
.main-layout-container .search-section {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    contain: layout style !important;
}

.main-layout-container .search-section #notifications-search-tab,
.main-layout-container .search-section #notifications-search-tab.active {
    contain: layout style paint !important;
    isolation: isolate !important;
    position: relative !important;
    display: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: auto !important;
    float: none !important;
    clear: none !important;
}

.main-layout-container .search-section #notifications-search-tab.active {
    display: block !important;
}

/* ULTIMATE FIX: Force notifications tab to stay within search-section using all possible selectors */
#notifications-search-tab,
#notifications-search-tab.active,
.search-section #notifications-search-tab,
.search-section #notifications-search-tab.active,
.main-layout-container #notifications-search-tab,
.main-layout-container #notifications-search-tab.active,
.main-layout-container .search-section #notifications-search-tab,
.main-layout-container .search-section #notifications-search-tab.active {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    float: none !important;
    clear: none !important;
    display: none !important;
    contain: layout style paint !important;
    isolation: isolate !important;
}

#notifications-search-tab.active,
.search-section #notifications-search-tab.active,
.main-layout-container #notifications-search-tab.active,
.main-layout-container .search-section #notifications-search-tab.active {
    display: block !important;
    contain: layout style paint !important;
    isolation: isolate !important;
}

/* Ensure search-section contains its children and doesn't allow overflow */
.main-layout-container .search-section {
    contain: layout style !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
}

/* Prevent notifications tab from breaking containment */
.main-layout-container .search-section #notifications-search-tab {
    contain: layout style paint !important;
    will-change: auto !important;
}

/* Override section styles for search-section to prevent column creation */
.section.search-section {
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    max-width: none !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 2em !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--bg-color) !important;
    border: none !important;
}

/* Ensure webmood and notification sections don't create columns */
.webmood-section,
.notification-section {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Override any section styles that might be applied */
.search-section .webmood-section,
.search-section .notification-section,
.search-tab-content .webmood-section,
.search-tab-content .notification-section,
.search-tab-content.active .webmood-section,
.search-tab-content.active .notification-section,
#notifications-search-tab .notification-section,
#webmood-search-tab .webmood-section {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative !important;
    box-sizing: border-box !important;
    contain: layout style !important;
}

/* Ensure all children of webmood-section stay within the container */
.webmood-section *,
.notification-section * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Critical fix: Ensure #notifications-search-tab > div stays within search-section and doesn't overlap */
#notifications-search-tab > div,
#notifications-search-tab > .notification-section {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: auto !important;
    transform: none !important;
    contain: layout style !important;
    isolation: auto !important;
    height: auto !important;
    max-height: none !important;
}

/* Ensure it stays within the search-section container */
.search-section #notifications-search-tab > div,
.search-section #notifications-search-tab > .notification-section,
.main-layout-container .search-section #notifications-search-tab > div,
.main-layout-container .search-section #notifications-search-tab > .notification-section {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: auto !important;
    transform: none !important;
    contain: layout style !important;
    isolation: auto !important;
    height: auto !important;
    max-height: none !important;
}

/* Prevent notification-section from being fixed or absolute positioned */
#notifications-search-tab > div[style*="position"],
#notifications-search-tab > .notification-section[style*="position"] {
    position: relative !important;
}

/* Override any inline styles that might cause full-screen overlap */
#notifications-search-tab > div[style*="width: 100vw"],
#notifications-search-tab > div[style*="width:100vw"],
#notifications-search-tab > .notification-section[style*="width: 100vw"],
#notifications-search-tab > .notification-section[style*="width:100vw"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ultimate fix: Ensure notification-section div never breaks out of search-section */
.main-layout-container .search-section #notifications-search-tab > div,
.main-layout-container .search-section #notifications-search-tab > .notification-section {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: 1 !important;
    transform: none !important;
    contain: layout style paint !important;
    isolation: isolate !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
}

/* Critical: Ensure #notifications div inside notification-section stays contained */
#notifications-search-tab #notifications,
#notifications-search-tab .notification-section #notifications,
.main-layout-container .search-section #notifications-search-tab #notifications,
.main-layout-container .search-section #notifications-search-tab .notification-section #notifications {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: auto !important;
    transform: none !important;
    contain: layout style !important;
    height: auto !important;
    max-height: none !important;
}

/* Prevent fixed or absolute positioning on notifications container and children */
#notifications-search-tab[style*="position: fixed"],
#notifications-search-tab[style*="position:fixed"],
#notifications-search-tab[style*="position: absolute"],
#notifications-search-tab[style*="position:absolute"],
#notifications-search-tab > div[style*="position: fixed"],
#notifications-search-tab > div[style*="position:fixed"],
#notifications-search-tab > div[style*="position: absolute"],
#notifications-search-tab > div[style*="position:absolute"],
#notifications-search-tab .notification-section[style*="position: fixed"],
#notifications-search-tab .notification-section[style*="position:fixed"],
#notifications-search-tab .notification-section[style*="position: absolute"],
#notifications-search-tab .notification-section[style*="position:absolute"],
#notifications-search-tab #notifications[style*="position: fixed"],
#notifications-search-tab #notifications[style*="position:fixed"],
#notifications-search-tab #notifications[style*="position: absolute"],
#notifications-search-tab #notifications[style*="position:absolute"] {
    position: relative !important;
}

/* Prevent any grid or flex layouts from creating columns in webmood content */
#webmood-content,
#webmood-loading,
#webmood-error {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: none !important;
}

/* Search Tabs - Vertical Sidebar Style */
.sidebar-section .search-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding: 0;
    overflow: hidden !important;
    overflow-y: hidden !important;
    max-height: 100% !important;
}

.search-tab-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75em;
    overflow: hidden;
}

/* Expanded sidebar: hide icons, show only text labels */
.tab-icon {
    flex-shrink: 0;
    font-size: 1.3em;
    width: 28px;
    text-align: center;
    transition: opacity 0.3s ease, width 0.3s ease;
    display: none;
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.tab-label {
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
    opacity: 1;
    width: auto;
}

.notification-badge {
    background: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7em;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Small pulsing unread-notification dot. Replaces the old header bell + count;
   shown on the Notifications tab and next to the username when unread > 0. */
.notif-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 6px rgba(255, 68, 68, 0.9);
    vertical-align: middle;
    margin-left: 6px;
    flex-shrink: 0;
    animation: notif-dot-pulse 1.6s ease-in-out infinite;
}
.search-tab-button .notif-dot {
    margin-left: auto; /* push the dot to the right edge of the sidebar tab */
}
@keyframes notif-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.82); }
}
@media (prefers-reduced-motion: reduce) {
    .notif-dot { animation: none; }
}
/* Minimized sidebar: pin the dot to the icon's top-right corner */
.sidebar-section.minimized .search-tab-button .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
}

/* Minimized sidebar: show icons only, hide text labels */
.sidebar-section.minimized .tab-icon {
    display: inline-block;
    opacity: 1;
    width: 28px;
}

.sidebar-section.minimized .tab-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-section.minimized .search-tab-button {
    justify-content: center;
    padding-left: 0.75em;
    padding-right: 0.75em;
}

.sidebar-section.minimized .notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin: 0;
    font-size: 0.65em;
    padding: 1px 4px;
    min-width: 14px;
}

.search-tab-button {
    padding: 1em 1.25em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    position: relative;
    top: 0;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}

.search-tab-button:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.9));
    border-color: rgba(0, 191, 255, 0.5);
    border-left-color: rgba(0, 191, 255, 0.6);
    color: var(--accent-color);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.2);
}

.search-tab-button.active {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(157, 78, 221, 0.1));
    border-color: var(--accent-color);
    border-left-color: var(--accent-color);
    border-left-width: 4px;
    color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.2), 0 0 20px rgba(0, 191, 255, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

/* Premium Tab - Magical Sparkle Effect */
.search-tab-button-premium {
    position: relative;
    overflow: visible;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.3), rgba(0, 191, 255, 0.2)) !important;
    border-color: rgba(157, 78, 221, 0.5) !important;
    color: #fff !important;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8), 0 0 20px rgba(0, 191, 255, 0.6);
    animation: sparkle 3s ease-in-out infinite, glow-premium-tab 2s ease-in-out infinite !important;
}

.search-tab-button-premium::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(157, 78, 221, 0.5), 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5), 
        rgba(0, 191, 255, 0.5));
    background-size: 400% 400%;
    border-radius: 8px;
    z-index: -1;
    animation: sparkle-border 3s ease infinite;
    opacity: 0.8;
}

.search-tab-button-premium::after {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8em;
    animation: sparkle-float 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.search-tab-button-premium:hover {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.5), rgba(0, 191, 255, 0.4)) !important;
    border-color: rgba(157, 78, 221, 0.8) !important;
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.6), 0 0 50px rgba(0, 191, 255, 0.4), 0 0 70px rgba(157, 78, 221, 0.3) !important;
    transform: translateY(-3px) scale(1.05);
    animation: sparkle 1.5s ease-in-out infinite, glow-premium-tab 1s ease-in-out infinite !important;
}

.search-tab-button-premium.active {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.4), rgba(0, 191, 255, 0.3)) !important;
    border-color: var(--accent-purple) !important;
    border-left-color: var(--accent-purple) !important;
    border-left-width: 4px !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(157, 78, 221, 0.5), 
                0 0 30px rgba(0, 191, 255, 0.4), 
                0 0 50px rgba(157, 78, 221, 0.3),
                inset 0 0 20px rgba(157, 78, 221, 0.2) !important;
    animation: sparkle 1s ease-in-out infinite, glow-premium-tab 0.8s ease-in-out infinite !important;
    text-shadow: 0 0 15px rgba(157, 78, 221, 1), 0 0 25px rgba(0, 191, 255, 0.8), 0 0 35px rgba(157, 78, 221, 0.6);
}

/* Green Energy Tab - Web Pulse */
.search-tab-button-green-energy {
    position: relative;
    overflow: visible;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(40, 167, 69, 0.1)) !important;
    border-color: rgba(0, 255, 136, 0.4) !important;
    color: #90ff90 !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6), 0 0 15px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
}

.search-tab-button-green-energy::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 255, 136, 0.3), 
        rgba(40, 167, 69, 0.3), 
        rgba(0, 255, 136, 0.3), 
        rgba(57, 255, 20, 0.3));
    border-radius: 8px 8px 0 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: green-energy-pulse 2s ease-in-out infinite;
}

@keyframes green-energy-pulse {
    0%, 100% {
        opacity: 0.3;
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.3), 0 0 20px rgba(40, 167, 69, 0.2);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 0 40px rgba(40, 167, 69, 0.3), 0 0 60px rgba(57, 255, 20, 0.2);
    }
}

.search-tab-button-green-energy:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(40, 167, 69, 0.2)) !important;
    border-color: rgba(0, 255, 136, 0.6) !important;
    color: #b0ffb0 !important;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4), 0 0 40px rgba(40, 167, 69, 0.3), 0 0 60px rgba(57, 255, 20, 0.2) !important;
    transform: translateY(-2px);
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.8), 0 0 20px rgba(40, 167, 69, 0.6);
}

.search-tab-button-green-energy.active {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(40, 167, 69, 0.2)) !important;
    border-color: rgba(0, 255, 136, 0.7) !important;
    border-left-color: rgba(0, 255, 136, 0.9) !important;
    border-left-width: 4px !important;
    color: #b0ffb0 !important;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.5), 
                0 0 30px rgba(40, 167, 69, 0.4), 
                0 0 50px rgba(57, 255, 20, 0.3),
                inset 0 0 20px rgba(0, 255, 136, 0.15) !important;
    animation: green-energy-pulse 1.5s ease-in-out infinite !important;
    text-shadow: 0 0 15px rgba(0, 255, 136, 1), 0 0 25px rgba(40, 167, 69, 0.8), 0 0 35px rgba(57, 255, 20, 0.6);
}

.search-tab-button-green-energy.active::before {
    opacity: 0.8;
}

/* USA Fin Health Tab - Red, White, and Blue Glow */
.search-tab-button-usa {
    position: relative;
    overflow: visible;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.15), rgba(0, 40, 104, 0.1)) !important;
    border-color: rgba(220, 20, 60, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(220, 20, 60, 0.6), 0 0 15px rgba(0, 40, 104, 0.4);
    transition: all 0.3s ease;
}

.search-tab-button-usa::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(220, 20, 60, 0.3), 
        rgba(255, 255, 255, 0.3), 
        rgba(0, 40, 104, 0.3), 
        rgba(220, 20, 60, 0.3));
    border-radius: inherit;
    z-index: -1;
    opacity: 0.6;
    animation: usa-glow 2s ease-in-out infinite;
}

@keyframes usa-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(220, 20, 60, 0.4), 
                    0 0 20px rgba(255, 255, 255, 0.3), 
                    0 0 30px rgba(0, 40, 104, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.6), 
                    0 0 40px rgba(255, 255, 255, 0.5), 
                    0 0 60px rgba(0, 40, 104, 0.6);
    }
}

.search-tab-button-usa:hover {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.25), rgba(0, 40, 104, 0.2)) !important;
    border-color: rgba(220, 20, 60, 0.6) !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.4), 
                0 0 40px rgba(255, 255, 255, 0.3), 
                0 0 60px rgba(0, 40, 104, 0.4) !important;
    transform: translateY(-2px);
    text-shadow: 0 0 12px rgba(220, 20, 60, 0.8), 
                 0 0 20px rgba(255, 255, 255, 0.6), 
                 0 0 30px rgba(0, 40, 104, 0.6);
}

.search-tab-button-usa.active {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.3), rgba(0, 40, 104, 0.2)) !important;
    border-color: rgba(220, 20, 60, 0.7) !important;
    border-left-color: rgba(220, 20, 60, 0.9) !important;
    border-left-width: 4px !important;
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(220, 20, 60, 0.5), 
                0 0 30px rgba(255, 255, 255, 0.4), 
                0 0 50px rgba(0, 40, 104, 0.5),
                inset 0 0 20px rgba(220, 20, 60, 0.15) !important;
    animation: usa-pulse 1.5s ease-in-out infinite !important;
}

.search-tab-button-usa.active::before {
    opacity: 0.8;
}

@keyframes usa-pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(220, 20, 60, 0.5), 
                    0 0 30px rgba(255, 255, 255, 0.4), 
                    0 0 50px rgba(0, 40, 104, 0.5);
    }
    50% {
        box-shadow: 0 4px 30px rgba(220, 20, 60, 0.7), 
                    0 0 50px rgba(255, 255, 255, 0.6), 
                    0 0 70px rgba(0, 40, 104, 0.7);
    }
}

@keyframes sparkle {
    0%, 100% {
        box-shadow: 0 0 10px rgba(157, 78, 221, 0.4), 0 0 20px rgba(0, 191, 255, 0.3);
    }
    25% {
        box-shadow: 0 0 20px rgba(157, 78, 221, 0.6), 0 0 40px rgba(0, 191, 255, 0.5), 0 0 60px rgba(157, 78, 221, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 191, 255, 0.6), 0 0 50px rgba(157, 78, 221, 0.5), 0 0 70px rgba(0, 191, 255, 0.3);
    }
    75% {
        box-shadow: 0 0 20px rgba(157, 78, 221, 0.6), 0 0 40px rgba(0, 191, 255, 0.5), 0 0 60px rgba(157, 78, 221, 0.3);
    }
}

@keyframes glow-premium-tab {
    0%, 100% {
        text-shadow: 0 0 10px rgba(157, 78, 221, 0.8), 0 0 20px rgba(0, 191, 255, 0.6);
    }
    50% {
        text-shadow: 0 0 20px rgba(157, 78, 221, 1), 0 0 30px rgba(0, 191, 255, 0.8), 0 0 40px rgba(157, 78, 221, 0.6);
    }
}

@keyframes sparkle-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes sparkle-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-5px) rotate(180deg);
        opacity: 1;
    }
}

.search-tab-content {
    display: none !important;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    float: none !important;
    clear: none !important;
    visibility: hidden !important;
    position: relative !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.search-tab-content.active {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    animation: fadeIn 0.3s ease-in;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Ensure all tab content stays within search-section */
.search-section .search-tab-content {
    width: 100% !important;
    max-width: 100% !important;
    display: none;
    float: none !important;
    clear: none !important;
}

.search-section .search-tab-content.active {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
}

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

@media (max-width: 768px) {
    .main-layout-container {
        flex-direction: column !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-top: 60px !important; /* Account for fixed header on mobile too */
    }
    
    .sidebar-section {
        position: relative !important; /* Change from fixed to relative on mobile */
        width: 100vw !important;
        min-width: 100vw !important;
        height: auto !important;
        max-height: none !important;
        top: auto !important; /* Remove fixed positioning */
        left: auto !important;
        bottom: auto !important;
        border-right: none;
        border-bottom: 1px solid rgba(0, 191, 255, 0.2);
    }
    
    .sidebar-section.minimized {
        width: 100vw;
        min-width: 100vw;
    }
    
    .sidebar-nav-content {
        padding: 1em 0.5em;
    }
    
    .sidebar-section .search-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5em;
        justify-content: center;
    }
    
    .sidebar-section .search-tab-button {
        flex: 1 1 auto;
        min-width: 100px;
        max-width: 150px;
        border-radius: 8px;
        border-left: 1px solid rgba(0, 191, 255, 0.2);
        border-left-width: 3px;
        text-align: center;
        padding: 0.75em 0.5em;
        font-size: 0.85em;
        justify-content: center;
    }
    
    .sidebar-section.minimized .search-tab-button {
        flex: 1 1 auto;
        min-width: 100px;
        max-width: 150px;
    }
    
    .sidebar-section .search-tab-button.active {
        border-left-color: var(--accent-color);
        border-left-width: 4px;
    }
    
    .search-section {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important; /* Remove desktop margin on mobile */
        margin-right: 0 !important;
        margin-top: 0 !important;
        padding: 0.5em !important; /* Reduced padding on mobile */
        height: auto;
        min-height: 100vh;
        box-sizing: border-box !important;
    }
    
    /* Override .search-section padding when no-padding-mobile class is present */
    .search-section.no-padding-mobile,
    .search-section.section.no-padding-mobile,
    .section.search-section.no-padding-mobile {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        min-height: 0 !important;
    }
    
    /* Override ANY inline styles on mobile - force remove desktop spacing */
    .search-section.section {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Remove ALL padding/margin from .section class on mobile for specific tabs */
    .search-section.section.no-padding-mobile,
    .section.search-section.no-padding-mobile,
    .search-section:has(#webmood-search-tab.active),
    .search-section:has(#notifications-search-tab.active),
    .search-section:has(#ai-assistant-search-tab.active),
    .search-section:has(#share-of-voice-search-tab.active),
    .section:has(#webmood-search-tab.active),
    .section:has(#notifications-search-tab.active),
    .section:has(#ai-assistant-search-tab.active),
    .section:has(#share-of-voice-search-tab.active) {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Also target the section class directly on mobile */
    .section.search-section {
        padding: 0 !important;
    }
    
    /* But allow padding for other tabs */
    .section.search-section:not(.no-padding-mobile):not(:has(#webmood-search-tab.active)):not(:has(#notifications-search-tab.active)):not(:has(#ai-assistant-search-tab.active)):not(:has(#share-of-voice-search-tab.active)) {
        padding: 0.5em !important;
    }
    
    /* Remove ALL padding/margin from search-section on mobile for specific tabs to eliminate empty space */
    .search-section.section:has(#webmood-search-tab.active),
    .search-section.section:has(#notifications-search-tab.active),
    .search-section.section:has(#ai-assistant-search-tab.active),
    .search-section.section:has(#share-of-voice-search-tab.active) {
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Also target when these tabs are active - remove section padding */
    #webmood-search-tab.active ~ *,
    #notifications-search-tab.active ~ *,
    #ai-assistant-search-tab.active ~ * {
        /* This won't work, need different approach */
    }
    
    /* Alternative: Remove section class padding when specific tabs are active */
    .search-section.section #webmood-search-tab.active,
    .search-section.section #notifications-search-tab.active,
    .search-section.section #ai-assistant-search-tab.active {
        position: relative;
    }
    
    /* Remove section padding from parent when these tabs are active */
    body:has(#webmood-search-tab.active) .search-section.section,
    body:has(#notifications-search-tab.active) .search-section.section,
    body:has(#ai-assistant-search-tab.active) .search-section.section,
    body:has(#share-of-voice-search-tab.active) .search-section.section {
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Hide export bar on mobile */
    .cc-export-bar {
        display: none !important;
    }
    
    /* Hide command center tab on mobile when it's not active (to prevent empty container) */
    #command-center-search-tab:not(.active) {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        visibility: hidden !important;
        position: absolute !important; /* Remove from flow completely */
        left: -9999px !important; /* Move off-screen */
    }
    
    /* Ensure command center tab doesn't take up space when hidden on mobile */
    .search-section #command-center-search-tab:not(.active) {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        visibility: hidden !important;
        position: absolute !important; /* Remove from flow completely */
        left: -9999px !important; /* Move off-screen */
    }
    
    /* Reduce padding on webmood-section on mobile */
    .webmood-section {
        padding: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Ensure webmood tab starts at the top on mobile */
    #webmood-search-tab.active {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Remove any top margin/padding from webmood content */
    #webmood-search-tab.active .webmood-section > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Remove top margin from h2 in webmood section on mobile */
    #webmood-search-tab.active .webmood-section h2 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Ensure main-layout-container doesn't add extra space on mobile */
    .main-layout-container {
        margin-top: 60px !important; /* Keep header spacing */
    }
    
    /* Remove any gap between header and content on mobile for webpulse */
    .search-section #webmood-search-tab.active {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Remove all padding/margin from search-tab-content on mobile when webpulse is active */
    .search-section #webmood-search-tab.active.search-tab-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ensure first element in webmood section has no top spacing */
    #webmood-search-tab.active .webmood-section h2:first-child,
    #webmood-search-tab.active .webmood-section > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Remove spacing from paragraph after h2 in webmood */
    #webmood-search-tab.active .webmood-section h2 + p {
        margin-top: 0.5em !important; /* Small margin only */
    }
    
    /* Remove empty space on mobile for Notifications tab */
    .search-section #notifications-search-tab.active {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .search-section #notifications-search-tab.active.search-tab-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #notifications-search-tab.active .notification-section {
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    #notifications-search-tab.active .notification-section > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    #notifications-search-tab.active .notification-section h2:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Remove empty space on mobile for AI Assistant tab */
    .search-section #ai-assistant-search-tab.active {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .search-section #ai-assistant-search-tab.active.search-tab-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #ai-assistant-search-tab.active .ai-assistant-section {
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        max-width: 100% !important;
    }
    
    /* Override inline styles on .ai-assistant-section - must be very specific */
    .ai-assistant-section[style*="padding"],
    #ai-assistant-search-tab .ai-assistant-section[style*="padding"] {
        padding: 0 !important;
    }
    
    #ai-assistant-search-tab.active .ai-assistant-section > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    #ai-assistant-search-tab.active .ai-assistant-section h2:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Remove empty space on mobile for Share of Voice tab.
     * SoV is special: its inner wrapper is a generic <div class="section">
     * (not a dedicated .share-of-voice-section), and the non-premium variant
     * has inline `padding: 3em 2em` plus a border. That .section CSS adds a
     * dark gradient background, 2em padding, 2em margin-bottom, border-radius
     * and box-shadow. Together this renders as a heavy dark card with a
     * large interior gap above the heading and a trailing 32px margin --
     * which the user perceives as a gap inside main-layout-container.
     *
     * Strategy: zero out the wrapper's spacing and flatten the inner .section
     * on mobile so SoV looks like the other no-padding-mobile tabs
     * (content sits flush with the top, body gradient fills the rest).
     */
    .search-section #share-of-voice-search-tab.active {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .search-section #share-of-voice-search-tab.active.search-tab-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Flatten the inner .section card on mobile -- override inline styles too
     * (3em 2em padding, border) by using !important and a specific selector.
     */
    #share-of-voice-search-tab.active > .section,
    #share-of-voice-search-tab.active .section[style*="padding"] {
        margin: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0.75em !important;
        padding: 1em 1em !important;
        padding-top: 0.75em !important;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    #share-of-voice-search-tab.active > .section > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    #share-of-voice-search-tab.active > .section h2:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Tighten the spacing of inner SoV controls (input row, chart grid, empty
     * state) so the form sits compactly under the header on mobile.
     */
    #share-of-voice-search-tab.active #sov-empty {
        padding: 1.5em 0.5em !important;
    }

    #share-of-voice-search-tab.active #sov-results-container > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.75em !important;
    }

    .nav-container {
        padding: 0 0.5em;
    }
}

/* Results, Subscriptions, Notifications Items */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em; /* Add space between elements */
    padding: 1em;
    margin-bottom: 0.75em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 191, 255, 0.05);
}

.result-item:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.8));
    border-color: rgba(0, 191, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 191, 255, 0.2), 0 0 30px rgba(157, 78, 221, 0.1);
    transform: translateX(4px);
}

.result-item .result-text {
     flex-grow: 1; /* Allow text to take available space */
     line-height: 1.6;
}
.result-item .clickable-timestamp,
.result-item .share-button {
     flex-shrink: 0; /* Prevent timestamp and button from shrinking */
}

/* Share Button Styling */
.share-button {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.3), rgba(157, 78, 221, 0.25));
    border: 2px solid rgba(0, 191, 255, 0.6);
    color: #fff;
    padding: 0.6em 1.2em;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    margin-left: 0.8em;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 191, 255, 0.3),
                0 0 15px rgba(157, 78, 221, 0.2),
                inset 0 0 10px rgba(0, 191, 255, 0.1);
    animation: share-button-pulse 2s ease-in-out infinite;
}

@keyframes share-button-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(0, 191, 255, 0.3),
                    0 0 15px rgba(157, 78, 221, 0.2),
                    inset 0 0 10px rgba(0, 191, 255, 0.1);
    }
    50% {
        box-shadow: 0 2px 15px rgba(0, 191, 255, 0.5),
                    0 0 25px rgba(157, 78, 221, 0.4),
                    inset 0 0 15px rgba(0, 191, 255, 0.2);
    }
}

.share-button:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.5), rgba(157, 78, 221, 0.4));
    border-color: rgba(0, 191, 255, 0.9);
    color: #fff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.5),
                0 0 30px rgba(157, 78, 221, 0.4),
                inset 0 0 20px rgba(0, 191, 255, 0.2);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.8);
    animation: share-button-pulse 1s ease-in-out infinite;
}

.share-button:active {
    transform: translateY(0) scale(1);
}

/* RSS Search Results Styling */
.rss-result-item {
    display: flex;
    flex-direction: column;
    padding: 1.2em;
    margin-bottom: 1em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.rss-result-item:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.8));
    border-color: rgba(0, 191, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 191, 255, 0.2);
    transform: translateY(-2px);
}

.rss-result-header {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-bottom: 0.75em;
}

.rss-result-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.rss-result-title:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.rss-result-meta {
    font-size: 0.85em;
    color: #aaa;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}

.rss-feed-name {
    color: var(--accent-color);
    font-weight: 500;
}

.rss-published {
    color: #888;
}

.rss-keywords {
    color: var(--accent-hover);
    font-weight: 500;
}

.rss-result-summary {
    color: var(--text-color);
    line-height: 1.6;
    margin-top: 0.5em;
    font-size: 0.95em;
    opacity: 0.9;
}

/* Social Media Platform Icons */
.social-platform-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: center;
    margin: 1.5em 0;
    padding: 1em;
}

.social-platform-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border: 2px solid rgba(0, 191, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    min-height: 100px;
    color: var(--text-color);
}

.social-platform-icon:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.8));
    border-color: rgba(0, 191, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.2), 0 0 20px rgba(0, 191, 255, 0.1);
}

.social-platform-icon.active {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(157, 78, 221, 0.1));
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3), 0 0 25px rgba(0, 191, 255, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.social-platform-icon svg {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5em;
    transition: transform 0.3s ease;
}

.social-platform-icon:hover svg {
    transform: scale(1.1);
}

.social-platform-icon.active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(0, 191, 255, 0.5));
}

.social-platform-icon span {
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
}

.social-platform-icon.active span {
    font-weight: 600;
    color: var(--accent-color);
}

#social-platform-fields {
    animation: fadeIn 0.3s ease-in;
}

@media (max-width: 768px) {
    .social-platform-icons {
        gap: 0.75em;
        padding: 0.5em;
    }
    
    .social-platform-icon {
        min-width: 80px;
        min-height: 80px;
        padding: 1em;
    }
    
    .social-platform-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .social-platform-icon span {
        font-size: 0.8em;
    }
}

/* Grid layout for subscriptions on desktop */
#subscriptions,
#rss-subscriptions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
}

@media (min-width: 1024px) {
    #subscriptions,
    #rss-subscriptions {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5em;
    }
}

/* Grid layout for notifications on desktop */
#notifications {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: auto !important;
    transform: none !important;
    contain: layout style !important;
}

/* Override #notifications when inside notifications-search-tab */
#notifications-search-tab #notifications,
.search-section #notifications-search-tab #notifications,
.main-layout-container .search-section #notifications-search-tab #notifications {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: auto !important;
    transform: none !important;
    contain: layout style !important;
    height: auto !important;
    max-height: none !important;
}

/* Notifications header row */
#notifications > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5em;
}

/* Notifications list container */
#notifications > div:nth-child(2) {
    display: block;
    width: 100%;
    clear: both;
}

.share-button {
    padding: 0.4em 0.9em;
    font-size: 0.9em;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid #555;
    background-color: #444;
    color: #ccc;
}
.share-button:hover {
    background-color: #555;
    color: #fff;
}
.share-button:disabled {
     cursor: default;
     opacity: 0.7;
}

.subscription-item {
    display: flex; /* Use flexbox for layout */
    justify-content: space-between; /* Push info and actions apart */
    align-items: center; /* Vertically align items */
    padding: 1.25em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 191, 255, 0.05);
}

.subscription-item:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.8));
    border-color: rgba(0, 191, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 191, 255, 0.2), 0 0 30px rgba(157, 78, 221, 0.1);
    transform: translateX(4px);
}

.sub-info {
    flex-grow: 1; /* Allow info section to take up available space */
    margin-right: 1em; /* Space between info and actions */
}

.sub-actions {
    display: flex; /* Align buttons horizontally */
    align-items: center;
    flex-shrink: 0; /* Prevent action buttons from shrinking */
}

.sub-actions .button-link,
.sub-actions .delete-form button {
    margin-left: 0.5em;
    padding: 0.4em 0.9em;
    font-size: 0.9em;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none; /* Remove button border if needed */
    display: inline-block; /* Ensure links behave like buttons */
}

.sub-actions .edit-button {
    background-color: #444;
    color: #ccc;
    border: 1px solid #555;
}
.sub-actions .edit-button:hover {
    background-color: #555;
    color: #fff;
}

.sub-actions .delete-form {
    margin: 0; /* Remove default form margin */
    padding: 0;
    display: inline-block;
}
.sub-actions .delete-form button {
     background-color: #600;
     border-color: #800;
     color: #fcc;
}
.sub-actions .delete-form button:hover {
      background-color: #800;
      color: #fff;
}

/* Cancel button styling on edit page */
.button-link.cancel-link {
    display: inline-block;
    margin-left: 1em;
    padding: 0.8em 1.5em;
    background-color: #555;
    color: #ddd;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1em;
    vertical-align: middle; /* Align with submit button */
}
.button-link.cancel-link:hover {
     background-color: #777;
     color: #fff;
}

.channel-id {
    font-size: 0.85em;
    color: #888;
    margin-left: 0.5em;
}

.timestamp, .clickable-timestamp {
    font-weight: bold;
    color: var(--link-color);
    cursor: pointer;
    text-decoration: underline;
}
.clickable-timestamp {
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.3);
}

.clickable-timestamp:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.6), 0 0 15px rgba(157, 78, 221, 0.4);
    transform: scale(1.05);
    animation: pulse 1s ease-in-out infinite;
}

.notification-item {
    position: relative;
    padding: 1.25em;
    margin-bottom: 1em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.15);
    border-left: 4px solid rgba(100, 100, 120, 0.5);
    transition: all 0.3s ease;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 191, 255, 0.05);
    overflow: hidden;
    clear: both;
}
.notification-item.notif-youtube   { border-left-color: #ff4444; }
.notification-item.notif-rss       { border-left-color: #2196F3; }
.notification-item.notif-website   { border-left-color: #4CAF50; }
.notification-item.notif-visual    { border-left-color: #9c27b0; }
.notification-item.notif-topic     { border-left-color: #ff9800; }

.notification-item:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.8));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 191, 255, 0.2), 0 0 30px rgba(157, 78, 221, 0.1);
    transform: translateX(4px);
}

.notification-item.unread {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.12), rgba(157, 78, 221, 0.06));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 191, 255, 0.2);
}

.notif-category-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #fff;
    line-height: 1.3;
}
.notif-badge-youtube   { background: #ff4444; }
.notif-badge-rss       { background: #2196F3; }
.notif-badge-website   { background: #4CAF50; }
.notif-badge-visual    { background: #9c27b0; }
.notif-badge-topic     { background: #ff9800; }

.notification-item .notification-thumbnail-container {
    flex-shrink: 0;
    width: 160px;
    max-width: 160px;
}
.notification-item .notification-thumbnail-container img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}
@media (max-width: 600px) {
    .notification-item .notification-thumbnail-container { width: 110px; max-width: 110px; }
}

.channel-name {
    font-weight: bold;
    color: var(--heading-color);
}

.keywords-list {
    font-style: italic;
    color: #aaa;
}

/* Flash Messages */
.flash-messages {
    width: 100%;
    /* max-width: 900px; Already handled by container */
    padding: 0;
    list-style: none;
    margin-bottom: 1.5em;
}
.alert {
    padding: 0.8em 1.2em;
    margin-bottom: 1em;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: center;
}
.alert-success {
    color: white;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-hover));
    border: 1px solid var(--accent-purple);
    box-shadow: 0 2px 8px rgba(157, 78, 221, 0.4), 0 0 15px rgba(157, 78, 221, 0.3);
    animation: glow-purple 3s ease-in-out infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}
.alert-error {
    color: var(--error-text);
    background-color: var(--error-bg);
    border-color: var(--error-border);
}
.alert-info { /* For login required messages */
    color: #c0e0f0;
    background-color: #2a3a4a;
    border-color: #3a5a7a;
}

/* YouTube Player Container */
.player-feedback {
     min-height: 1.2em; /* Reserve space */
     text-align: left; /* Left align on desktop */
     margin-top: 1em;
     font-style: italic;
     color: var(--error-text); /* Use error color for messages initially */
}

@media (max-width: 768px) {
    .player-feedback {
        text-align: center;
    }
}

#player-container {
    margin-top: 1.5em;
    margin-bottom: 2em;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

@media (min-width: 1024px) {
    #player-container {
        max-width: 900px; /* Larger on desktop */
    }
}

#player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

a {
    color: var(--link-color);
    transition: all 0.3s ease;
    text-shadow: 0 0 3px rgba(0, 191, 255, 0.2);
}

a:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.5), 0 0 12px rgba(157, 78, 221, 0.3);
}

/* Small delete button */
.subscription-item form button {
     background-color: #555;
     color: #ddd;
     padding: 0.3em 0.8em;
     font-size: 0.8em;
     margin-left: 1em;
}
.subscription-item form button:hover {
     background-color: #777;
}

/* Notification action buttons */
.notification-actions {
    margin-top: 0.75em;
}
.notification-actions form {
     display: inline-block;
     margin-right: 0.5em; /* Space between buttons */
     margin-bottom: 0; /* Override general form margin */
}
 .notification-actions button {
     background-color: #444;
     color: #ccc;
     padding: 0.3em 0.8em;
     font-size: 0.8em;
     cursor: pointer;
     border: 1px solid #555;
     border-radius: 4px;
     transition: background-color 0.2s ease;
 }
 .notification-actions button:hover {
      background-color: #555;
 }
 .notification-actions .delete-button {
      background-color: #600;
      border-color: #800;
      color: #fcc;
 }
 .notification-actions .delete-button:hover {
      background-color: #800;
 }

/* Logo Styles */
.logo-container {
    text-align: center;
    margin-bottom: 1.5em;
}
.logo-container img {
     max-width: 300px; /* Adjust size as needed */
     height: auto;
     display: block;
     margin-left: auto;
     margin-right: auto;
}

/* Auth Page Specific Styles */
.auth-container .logo-container {
    margin-top: 2em;
}
.auth-switch {
    text-align: center;
    margin-top: 1.5em;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5em 0;
}

/* reCAPTCHA v2 widget (login / register forms).
 * The default widget is 304px x 78px. Center it inside the form group
 * and let it scale on very narrow phones using the official iframe
 * transform trick so it never overflows the login card.
 */
.recaptcha-group {
    display: flex;
    justify-content: center;
    margin: 0.5em 0 1em 0;
}
.recaptcha-group .g-recaptcha {
    display: inline-block;
    transform-origin: 0 0;
}
@media (max-width: 360px) {
    .recaptcha-group .g-recaptcha {
        transform: scale(0.85);
        -webkit-transform: scale(0.85);
        transform-origin: 0 0;
        -webkit-transform-origin: 0 0;
    }
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 191, 255, 0.3);
}

.auth-divider span {
    padding: 0 1em;
    color: var(--text-color);
    font-size: 0.9em;
}

.google-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding: 0.7em 1.2em;
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.google-login-button svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.google-login-button:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.google-login-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.form-group {
     margin-bottom: 1rem;
}
.form-check {
    display: flex;
    align-items: center;
}
.form-check input[type="checkbox"] {
    margin-right: 0.5em;
    width: auto; /* Override default */
}
.form-check label {
     margin-bottom: 0; /* Override default */
}

/* Landing Page / Login Styles */
.landing-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2em;
}

.hero-section {
    text-align: center;
    padding: 3em 1em 4em 1em;
    margin-bottom: 4em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-glow-box {
    text-align: center;
    color: var(--text-color);
    max-width: 800px;
    width: 100%;
    padding: 3rem 2.5rem;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(42, 52, 65, 0.9));
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                0 0 40px rgba(0, 191, 255, 0.3),
                0 0 80px rgba(157, 78, 221, 0.2),
                inset 0 0 30px rgba(0, 191, 255, 0.1);
    border: 2px solid rgba(0, 191, 255, 0.4);
    position: relative;
    overflow: visible;
    animation: hero-box-glow 2s ease-in-out infinite;
}

@keyframes hero-box-glow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                    0 0 40px rgba(0, 191, 255, 0.3),
                    0 0 80px rgba(157, 78, 221, 0.2),
                    inset 0 0 30px rgba(0, 191, 255, 0.1);
        border-color: rgba(0, 191, 255, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                    0 0 60px rgba(0, 191, 255, 0.5),
                    0 0 120px rgba(157, 78, 221, 0.4),
                    inset 0 0 50px rgba(0, 191, 255, 0.2);
        border-color: rgba(0, 191, 255, 0.7);
    }
}

.hero-glow-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5), 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5));
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: hero-border-sparkle 3s ease infinite;
    opacity: 0.8;
}

@keyframes hero-border-sparkle {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.logo-container-large img {
     max-width: 300px;
     height: auto;
     margin-bottom: 2em;
}

.hero-section h1 {
    font-size: 2.8em;
    margin-bottom: 1em;
    font-weight: 700;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.8), 
                 0 0 20px rgba(157, 78, 221, 0.6),
                 0 0 30px rgba(0, 191, 255, 0.4);
    animation: hero-title-glow 2s ease-in-out infinite;
    position: relative;
}

@keyframes hero-title-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 191, 255, 0.8), 
                     0 0 20px rgba(157, 78, 221, 0.6),
                     0 0 30px rgba(0, 191, 255, 0.4);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 191, 255, 1), 
                     0 0 30px rgba(157, 78, 221, 0.8),
                     0 0 40px rgba(0, 191, 255, 0.6),
                     0 0 50px rgba(157, 78, 221, 0.4);
    }
}

.subtitle {
    font-size: 1.3em;
    color: var(--text-color);
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.3);
}

.hero-cta {
    display: flex;
    gap: 1em;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2em;
}

.button-primary.large {
    padding: 1em 2.5em;
    font-size: 1.1em;
}

.button-link.large {
    padding: 1em 2.5em;
    font-size: 1.1em;
}

/* Use Cases Section */
.use-cases-section {
    margin: 4em 0;
    padding: 3em 0;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.3), rgba(20, 25, 38, 0.3));
    border-radius: 12px;
    padding: 3em 2em;
}

.use-cases-section h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 0.5em;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: #aaa;
    margin-bottom: 3em;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2em;
    margin-top: 3em;
}

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

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

.use-case-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.9));
    padding: 2em;
    border-radius: 12px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 191, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: float 8s ease-in-out infinite;
}

.use-case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 191, 255, 0.3), 0 0 40px rgba(157, 78, 221, 0.2);
    border-color: rgba(0, 191, 255, 0.5);
    /* animation: float 4s ease-in-out infinite, glow 2s ease-in-out infinite; */ /* Disabled floating effect */
}

.use-case-icon {
    font-size: 3em;
    margin-bottom: 1em;
    text-align: center;
}

.use-case-card h3 {
    font-size: 1.6em;
    margin-bottom: 1em;
    color: var(--heading-color);
    text-align: center;
}

.use-case-description {
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1.5em;
    flex-grow: 1;
}

.use-case-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.use-case-benefits li {
    padding: 0.5em 0;
    padding-left: 1.5em;
    position: relative;
    color: #ccc;
    font-size: 0.95em;
}

.use-case-benefits li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Features Section */
.features-section {
    margin: 4em 0;
    padding: 3em 2em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(20, 25, 38, 0.6));
    border-radius: 12px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 191, 255, 0.1);
}

.features-section h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 2em;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2em;
    max-width: 1200px;
    margin: 0 auto;
}

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

.feature-item {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.7), rgba(20, 25, 38, 0.7));
    padding: 2em;
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 191, 255, 0.1);
    /* animation: float 10s ease-in-out infinite; */ /* Disabled floating effect */
}

.feature-item:hover {
    border-color: rgba(0, 191, 255, 0.5);
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.9));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 191, 255, 0.3), 0 0 35px rgba(157, 78, 221, 0.2);
    transform: translateY(-4px);
    /* animation: float 5s ease-in-out infinite, glow 2s ease-in-out infinite; */ /* Disabled floating effect */
}

.feature-item h3 {
    font-size: 1.4em;
    margin-bottom: 0.75em;
    color: var(--heading-color);
}

.feature-item p {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 4em 2em;
    margin: 4em 0;
    background-color: rgba(0, 170, 255, 0.1);
    border-radius: 12px;
    border: 2px solid var(--accent-color);
}

.cta-section h2 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    text-align: center;
}

.cta-subtitle {
    font-size: 1.2em;
    color: #aaa;
    margin-bottom: 2em;
}

.cta-buttons {
    display: flex;
    gap: 1.5em;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.login-section {
    max-width: 450px; /* Narrower width for login box */
    margin-left: auto;
    margin-right: auto;
    /* background-color: var(--card-bg); */
    background-color: rgba(42, 42, 42, 0.9); /* Slightly more opaque login box */
}

.login-section .form-group {
    max-width: 100%;
    box-sizing: border-box;
}

.login-section h2 {
     margin-bottom: 1em;
}

/* Admin Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}
.admin-table th, .admin-table td {
    border: 1px solid var(--border-color);
    padding: 0.6em 0.8em;
    text-align: left;
}
.admin-table th {
    background-color: #333;
}
.admin-table tr:nth-child(even) {
     background-color: rgba(255, 255, 255, 0.03);
}
.admin-table .small-button {
     font-size: 0.85em;
     padding: 0.3em 0.7em;
}

/* Search Results Section - Desktop Layout */
#search-results h3 {
    margin-bottom: 1.5em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--border-color);
}

#results-list {
    margin-top: 1.5em;
}

/* Search History Styles */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 1.25em;
    margin-bottom: 0.75em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.07);
    transform: translateX(4px);
    border-color: var(--accent-color);
}

.history-details {
    flex-grow: 1;
    margin-right: 1em;
}

.history-title {
    display: block; /* Ensure title is on its own line if needed */
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.2em;
}

.history-keywords {
     display: block; /* Ensure keywords are below title */
     font-size: 0.9em;
     color: #aaa;
     font-style: italic;
}

.history-meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.history-time {
    font-size: 0.8em;
    color: #888;
    margin-right: 1em;
}

.history-delete-button {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5em; /* Make cross larger */
    line-height: 1;
    padding: 0 0.3em;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.history-delete-button:hover {
    opacity: 1;
    color: var(--error-text);
}

.history-delete-button:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(10, 14, 26, 0.95));
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: overlay-pulse 3s ease-in-out infinite;
}

@keyframes overlay-pulse {
    0%, 100% {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(10, 14, 26, 0.95));
    }
    50% {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(10, 14, 26, 0.9));
        box-shadow: inset 0 0 100px rgba(0, 191, 255, 0.1), inset 0 0 200px rgba(157, 78, 221, 0.05);
    }
}

.loading-content {
    text-align: center;
    color: var(--text-color);
    max-width: 500px;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(42, 52, 65, 0.9));
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                0 0 40px rgba(0, 191, 255, 0.3),
                0 0 80px rgba(157, 78, 221, 0.2),
                inset 0 0 30px rgba(0, 191, 255, 0.1);
    border: 2px solid rgba(0, 191, 255, 0.4);
    position: relative;
    overflow: visible;
    animation: loading-content-glow 2s ease-in-out infinite;
}

@keyframes loading-content-glow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                    0 0 40px rgba(0, 191, 255, 0.3),
                    0 0 80px rgba(157, 78, 221, 0.2),
                    inset 0 0 30px rgba(0, 191, 255, 0.1);
        border-color: rgba(0, 191, 255, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                    0 0 60px rgba(0, 191, 255, 0.5),
                    0 0 120px rgba(157, 78, 221, 0.4),
                    inset 0 0 50px rgba(0, 191, 255, 0.2);
        border-color: rgba(0, 191, 255, 0.7);
    }
}

.loading-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5), 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5));
    background-size: 400% 400%;
    border-radius: 16px;
    z-index: -1;
    animation: loading-border-sparkle 3s ease infinite;
    opacity: 0.8;
}

@keyframes loading-border-sparkle {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.loading-content h2 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.8), 
                 0 0 20px rgba(157, 78, 221, 0.6),
                 0 0 30px rgba(0, 191, 255, 0.4);
    animation: loading-title-glow 2s ease-in-out infinite;
    position: relative;
}

@keyframes loading-title-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 191, 255, 0.8), 
                     0 0 20px rgba(157, 78, 221, 0.6),
                     0 0 30px rgba(0, 191, 255, 0.4);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 191, 255, 1), 
                     0 0 30px rgba(157, 78, 221, 0.8),
                     0 0 40px rgba(0, 191, 255, 0.6),
                     0 0 50px rgba(157, 78, 221, 0.4);
    }
}

.loading-content h2::after {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -30px;
    font-size: 1.2em;
    animation: sparkle-float 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.loading-content p {
    margin-bottom: 2rem;
    color: #aaa;
    font-size: 0.95rem;
}

/* Spinner Animation */
.loading-spinner {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border: 5px solid rgba(0, 191, 255, 0.2);
    border-top: 5px solid var(--accent-color);
    border-right: 5px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin-glow 1s linear infinite;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5),
                0 0 40px rgba(157, 78, 221, 0.3),
                inset 0 0 20px rgba(0, 191, 255, 0.2);
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: rgba(0, 191, 255, 0.6);
    border-right-color: rgba(157, 78, 221, 0.6);
    animation: spin-glow 0.8s linear infinite reverse;
}

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

@keyframes spin-glow {
    0% { 
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.5),
                    0 0 40px rgba(157, 78, 221, 0.3),
                    inset 0 0 20px rgba(0, 191, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 191, 255, 0.7),
                    0 0 60px rgba(157, 78, 221, 0.5),
                    inset 0 0 30px rgba(0, 191, 255, 0.3);
    }
    100% { 
        transform: rotate(360deg);
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.5),
                    0 0 40px rgba(157, 78, 221, 0.3),
                    inset 0 0 20px rgba(0, 191, 255, 0.2);
    }
}

/* Loading Steps */
.loading-steps {
    margin-top: 2rem;
    text-align: left;
}

.loading-step {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    background: var(--bg-color);
    border-radius: 6px;
    border-left: 3px solid transparent;
    color: #888;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.loading-step.active {
    border-left-color: var(--accent-color);
    color: #fff;
    background: linear-gradient(90deg, rgba(0, 191, 255, 0.2), rgba(157, 78, 221, 0.15));
    animation: step-pulse-glow 1.5s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.3),
                inset 0 0 10px rgba(0, 191, 255, 0.1);
}

@keyframes step-pulse-glow {
    0%, 100% { 
        opacity: 1;
        background: linear-gradient(90deg, rgba(0, 191, 255, 0.2), rgba(157, 78, 221, 0.15));
        box-shadow: 0 0 15px rgba(0, 191, 255, 0.3),
                    inset 0 0 10px rgba(0, 191, 255, 0.1);
    }
    50% { 
        opacity: 0.9;
        background: linear-gradient(90deg, rgba(0, 191, 255, 0.3), rgba(157, 78, 221, 0.25));
        box-shadow: 0 0 25px rgba(0, 191, 255, 0.5),
                    0 0 40px rgba(157, 78, 221, 0.3),
                    inset 0 0 15px rgba(0, 191, 255, 0.2);
    }
}

/* Profile Page Styles */
.profile-section {
    text-align: center;
}

.profile-section h2 {
    text-align: center !important;
    margin-bottom: 1.25em;
}

.profile-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5em;
    padding: 0.5em 0;
    max-width: 700px;
    margin: 0 auto;
    justify-items: center;
}

@media (min-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
        gap: 2em;
        align-items: center;
        justify-items: center;
    }
}

.profile-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.5), rgba(20, 25, 38, 0.5));
    border-radius: 12px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    width: 100%;
}

.profile-image-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    box-shadow: 0 4px 16px rgba(0, 191, 255, 0.3), 0 0 25px rgba(0, 191, 255, 0.2);
    margin-bottom: 0.75em;
    background-color: var(--card-bg);
    transition: all 0.3s ease;
    /* animation: float 6s ease-in-out infinite; */ /* Disabled floating effect */
}

.profile-image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4), 0 0 35px rgba(0, 191, 255, 0.3);
    border-color: var(--accent-hover);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    font-size: 2.5em;
    font-weight: bold;
}

.profile-image-hint {
    font-size: 0.85em;
    color: #aaa;
    margin-top: 0.25em;
    margin-bottom: 0;
}

.profile-form {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

.profile-form .form-group {
    margin-bottom: 1em;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.profile-form label {
    display: block;
    margin-bottom: 0.4em;
    font-weight: 600;
    color: var(--text-color);
    font-size: 15px;
    text-align: left;
    width: 100%;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"],
.profile-form input[type="file"] {
    width: 100% !important;
    padding: 0.85em 1em !important;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 16px; /* Prevent iOS zoom - must be 16px or larger */
    transition: all 0.3s ease;
    box-sizing: border-box !important;
    min-height: 44px !important; /* Better touch targets */
    height: auto;
    -webkit-appearance: none;
    appearance: none;
}

/* Ensure password fields are identical - override all possible browser styles */
.profile-form input#current_password,
.profile-form input#new_password {
    width: 100% !important;
    padding: 0.85em 1em !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    height: 44px !important;
    line-height: 1.5 !important;
    font-size: 16px !important;
    margin: 0 !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 6px !important;
    background-color: var(--input-bg) !important;
    color: var(--text-color) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Override browser autofill styles */
.profile-form input#current_password:-webkit-autofill,
.profile-form input#new_password:-webkit-autofill,
.profile-form input#current_password:-webkit-autofill:hover,
.profile-form input#new_password:-webkit-autofill:hover,
.profile-form input#current_password:-webkit-autofill:focus,
.profile-form input#new_password:-webkit-autofill:focus {
    width: 100% !important;
    padding: 0.85em 1em !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    height: 44px !important;
    line-height: 1.5 !important;
    font-size: 16px !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 6px !important;
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
}

.profile-form input[type="text"]:focus,
.profile-form input[type="email"]:focus,
.profile-form input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.2), 0 0 15px rgba(0, 191, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.profile-form input[type="file"] {
    padding: 0.85em 1em;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px;
}

.profile-form input[type="file"]:hover {
    border-color: var(--accent-color);
}

.form-hint {
    display: block;
    font-size: 0.8em;
    color: #aaa;
    margin-top: 0.35em;
    margin-bottom: 0;
    font-style: italic;
    line-height: 1.4;
}

.delete-image-button {
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.8), rgba(150, 0, 0, 0.8));
    color: #fff;
    border: 1px solid rgba(200, 0, 0, 0.5);
    padding: 0.6em 1.2em;
    font-size: 0.9em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.delete-image-button:hover {
    background: linear-gradient(135deg, rgba(220, 0, 0, 0.9), rgba(180, 0, 0, 0.9));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 0, 0, 0.4);
}

.form-actions {
    display: flex;
    gap: 1em;
    margin-top: 1.25em;
    justify-content: center;
}

.profile-form .form-actions {
    justify-content: center;
}

.button-primary {
    background-color: var(--button-bg);
    color: white;
    padding: 0.9em 2em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.3);
    text-decoration: none;
    display: inline-block;
}

.button-primary:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.4);
}

/* Navigation Profile Dropdown */
.nav-profile-dropdown {
    position: relative;
    z-index: 10001;
}

.nav-profile-link {
    display: flex;
    align-items: center;
    gap: 0.5em;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5em;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
}

.nav-profile-link:hover {
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-profile-link.active {
    background-color: rgba(0, 170, 255, 0.1);
    color: var(--accent-color);
}

.dropdown-arrow {
    font-size: 0.7em;
    margin-left: 0.25em;
    transition: transform 0.2s ease;
}

.nav-profile-link.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-profile-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5em;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000 !important;
    padding: 0.5em 0;
    pointer-events: none;
}

.nav-profile-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto !important;
}

.nav-profile-dropdown-menu a {
    display: block;
    padding: 0.75em 1.25em;
    color: var(--text-color) !important;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.95em;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 1001;
    opacity: 1 !important;
    user-select: none;
    -webkit-user-select: none;
}

.nav-profile-dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-color) !important;
}

.nav-profile-dropdown-menu a:active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color) !important;
}

.nav-profile-dropdown-menu a:visited {
    color: var(--text-color) !important;
}

.dropdown-divider {
    margin: 0.5em 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Mobile profile links - hidden on desktop */
.nav-profile-mobile-links {
    display: none;
}

@media (max-width: 768px) {
    /* Hide sidebar on mobile */
    .sidebar-section {
        display: none !important;
    }
    
    /* Make search-section full width on mobile */
    .main-layout-container {
        flex-direction: column !important;
    }
    
    .search-section {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 60px !important; /* Account for header on mobile too */
        padding: 1em !important;
    }
    
    /* Hide desktop dropdown on mobile */
    .nav-profile-dropdown {
        display: none;
    }
    
    /* Show mobile links on mobile */
    .nav-profile-mobile-links {
        display: block;
        width: 100%;
    }
    
    .nav-profile-mobile-header {
        display: flex;
        align-items: center;
        gap: 0.75em;
        padding: 0.75em 0;
        border-bottom: 1px solid rgba(0, 191, 255, 0.1);
        margin-bottom: 0.5em;
    }
    
    .nav-profile-image-mobile {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--accent-color);
    }
    
    .nav-profile-initial-mobile {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-color), var(--accent-purple));
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
        font-size: 1.1em;
        border: 2px solid var(--accent-color);
    }
    
    .nav-user-mobile {
        font-weight: 600;
        color: var(--text-color);
        font-size: 1em;
    }
    
    .nav-profile-mobile-links a {
        display: block;
        width: 100%;
        padding: 0.75em 0;
        border-bottom: 1px solid rgba(0, 191, 255, 0.1);
        color: var(--link-color);
        text-decoration: none;
        font-size: 0.95em;
        transition: color 0.2s ease;
    }
    
    .nav-profile-mobile-links a:hover {
        color: var(--accent-hover);
    }
    
    .nav-profile-mobile-links .dropdown-divider {
        margin: 0.5em 0;
        border: none;
        border-top: 1px solid rgba(0, 191, 255, 0.1);
    }
    
    /* Mobile search tabs in dropdown */
    .mobile-search-tabs {
        display: flex;
        flex-direction: column;
        gap: 0.25em;
        margin: 0.5em 0;
    }
    
    .mobile-search-tab {
        display: block;
        width: 100%;
        padding: 0.6em 0.75em;
        background: rgba(0, 191, 255, 0.05);
        border: 1px solid rgba(0, 191, 255, 0.1);
        border-radius: 4px;
        color: var(--link-color);
        text-decoration: none;
        font-size: 0.9em;
        transition: all 0.2s ease;
        text-align: left;
    }
    
    .mobile-search-tab:hover {
        background: rgba(0, 191, 255, 0.1);
        border-color: rgba(0, 191, 255, 0.3);
        color: var(--accent-hover);
    }
    
    .mobile-search-tab.active {
        background: rgba(0, 191, 255, 0.15);
        border-color: var(--accent-color);
        color: var(--accent-color);
        font-weight: 600;
    }
}

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

.nav-profile-initial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    border: 2px solid var(--accent-color);
}

.nav-user {
    margin: 0;
}

/* Section Header with Actions */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
    gap: 1em;
}

.section-header h2 {
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 0.75em;
    align-items: center;
}

.clear-all-button {
    background-color: #600;
    color: #fcc;
    border: 1px solid #800;
    padding: 0.5em 1em;
    font-size: 0.9em;
}

.clear-all-button:hover {
    background-color: #800;
    color: #fff;
}

.collapse-toggle {
    background-color: #444;
    color: #ccc;
    border: 1px solid #555;
    padding: 0.5em 1em;
    font-size: 0.9em;
    cursor: pointer;
}

.collapse-toggle:hover {
    background-color: #555;
    color: #fff;
}

.collapse-toggle.collapsed {
    background-color: rgba(0, 170, 255, 0.2);
    border-color: var(--accent-color);
}

.history-list-container {
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Premium Features */
.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-hover));
    color: white;
    padding: 0.25em 0.75em;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(157, 78, 221, 0.4);
    animation: glow-purple 2.5s ease-in-out infinite;
    transition: all 0.3s ease;
}

.premium-badge:hover {
    animation: glow-purple 1s ease-in-out infinite;
    transform: scale(1.05);
}

/* Premium Locked Sections
   Keep the section visible and readable so non-premium users still see what
   the feature offers — only the interactive controls inside are disabled
   server-side (and visually via `disabled` attributes). No full-section blur
   or giant overlay icon, because that made non-premium users feel like the
   ENTIRE app was locked when actually only the subscription/automation
   sub-sections require an upgrade. */
.premium-locked {
    position: relative;
    transition: all 0.3s ease;
}

.premium-locked .upgrade-prompt {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    opacity: 1;
    filter: none;
    background: linear-gradient(135deg, rgba(58, 26, 26, 0.9), rgba(90, 42, 42, 0.8));
    border: 2px solid rgba(248, 113, 113, 0.5);
    box-shadow: 0 0 30px rgba(248, 113, 113, 0.3);
}

/* Inputs and buttons inside locked sections that aren't already `disabled`
   should still feel inert — but the surrounding text/headings remain crisp
   so users can read what premium would give them. */
.premium-locked form input:not(.upgrade-prompt input),
.premium-locked form select:not(.upgrade-prompt select),
.premium-locked form textarea:not(.upgrade-prompt textarea),
.premium-locked form button:not(.upgrade-prompt button),
.premium-locked table input,
.premium-locked table button,
.premium-locked table select {
    opacity: 0.55;
    cursor: not-allowed;
}

.premium-features-section {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 2px solid rgba(0, 191, 255, 0.3);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    float: none !important;
    clear: none !important;
}

/* Wrapper for the footer upsell — kept OUTSIDE .main-layout-container so it
   doesn't fight the sidebar + search-section flex-row layout. On desktop the
   sidebar is `position: fixed` taking up 300px (60px when minimized) on the
   left, so we offset this wrapper to match. On mobile the sidebar collapses
   and we fall back to full width. */
.premium-upsell-footer-wrap {
    box-sizing: border-box;
    width: 100%;
    padding: 1em 1.5em 2em;
    margin-left: 300px;
    max-width: calc(100% - 300px);
    transition: margin-left 0.3s ease, max-width 0.3s ease;
}

body:has(.sidebar-section.minimized) .premium-upsell-footer-wrap {
    margin-left: 60px;
    max-width: calc(100% - 60px);
}

@media (max-width: 768px) {
    .premium-upsell-footer-wrap {
        margin-left: 0 !important;
        max-width: 100% !important;
        padding: 1em 0.75em 1.5em;
    }
}

/* Compact upgrade pitch shown at the bottom of the page for free users.
   Replaces the older full-width "🔒 LOCKED" hero, which made the whole
   page feel inaccessible. */
.premium-upsell-compact {
    display: flex;
    align-items: center;
    gap: 1.2em;
    padding: 1em 1.4em;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.08), rgba(157, 78, 221, 0.08));
    border: 1px solid rgba(0, 191, 255, 0.35);
    border-radius: 10px;
    flex-wrap: wrap;
}

.premium-upsell-compact__icon {
    font-size: 2em;
    line-height: 1;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 6px rgba(0, 191, 255, 0.5));
}

.premium-upsell-compact__body {
    flex: 1 1 280px;
    min-width: 0;
}

.premium-upsell-compact__title {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.05em;
    margin-bottom: 0.25em;
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.35);
}

.premium-upsell-compact__text {
    color: var(--text-color);
    opacity: 0.92;
    font-size: 0.92em;
    line-height: 1.45;
}

.premium-upsell-compact__cta {
    flex: 0 0 auto;
    padding: 0.6em 1.2em;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-purple));
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 191, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.premium-upsell-compact__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 191, 255, 0.4);
}

.upgrade-prompt {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.15), rgba(157, 78, 221, 0.1));
    border: 2px dashed var(--accent-color);
    border-radius: 12px;
    padding: 2em;
    text-align: center;
    margin: 1.5em 0;
    animation: pulse 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.2), inset 0 0 20px rgba(157, 78, 221, 0.1);
}

.upgrade-prompt:hover {
    animation: pulse 2s ease-in-out infinite;
    border-color: var(--accent-purple);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.3), 0 0 40px rgba(157, 78, 221, 0.2), inset 0 0 30px rgba(157, 78, 221, 0.15);
}

.upgrade-prompt h3 {
    color: var(--accent-color);
    margin-top: 0;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.upgrade-prompt p {
    margin: 0.75em 0;
    color: var(--text-color);
}

.upgrade-prompt strong {
    color: var(--accent-color);
}

/* Admin Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5em;
    margin: 1.5em 0;
}

.stat-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.8));
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    padding: 1.5em;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 191, 255, 0.1);
    /* animation: float 8s ease-in-out infinite; */ /* Disabled floating effect */
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 191, 255, 0.3), 0 0 35px rgba(157, 78, 221, 0.2);
    border-color: var(--accent-color);
    /* animation: float 4s ease-in-out infinite, glow 2s ease-in-out infinite; */ /* Disabled floating effect */
}

/* Stat cards that double as links — strip default <a> styling and add a click affordance. */
a.stat-card,
.stat-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}
a.stat-card:hover,
.stat-card-link:hover {
    text-decoration: none;
    border-color: var(--accent-color);
}
.stat-card-arrow {
    display: inline-block;
    margin-left: 0.35em;
    color: var(--accent-color);
    font-weight: bold;
    transition: transform 0.2s ease;
}
a.stat-card:hover .stat-card-arrow,
.stat-card-link:hover .stat-card-arrow {
    transform: translateX(3px);
}

/* Highlight a stat card when it has something the admin needs to act on (e.g. unread contacts). */
.stat-card-alert {
    border-color: rgba(0, 191, 255, 0.7);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                0 0 18px rgba(0, 191, 255, 0.35),
                0 0 28px rgba(157, 78, 221, 0.2);
    animation: stat-card-alert-pulse 2.4s ease-in-out infinite;
}
@keyframes stat-card-alert-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 18px rgba(0, 191, 255, 0.35), 0 0 28px rgba(157, 78, 221, 0.2); }
    50%      { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 26px rgba(0, 191, 255, 0.55), 0 0 38px rgba(157, 78, 221, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
    .stat-card-alert { animation: none; }
    a.stat-card:hover .stat-card-arrow,
    .stat-card-link:hover .stat-card-arrow { transform: none; }
}

.stat-card h3 {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--accent-color);
    display: block;
    margin: 0.5em 0;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5), 0 0 20px rgba(157, 78, 221, 0.3);
    animation: pulse 3s ease-in-out infinite;
}

.stat-card small {
    color: #888;
    font-size: 0.85em;
}

.admin-actions {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin: 1.5em 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table thead {
    background: rgba(0, 170, 255, 0.2);
}

.admin-table th {
    padding: 1em;
    text-align: left;
    font-weight: 600;
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.admin-table td {
    padding: 1em;
    border-bottom: 1px solid var(--border-color);
}

.admin-table tbody tr:hover {
    background: rgba(0, 170, 255, 0.05);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.action-buttons {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.small-button {
    padding: 0.4em 0.8em;
    font-size: 0.85em;
}

.admin-form {
    max-width: 600px;
}

.admin-form .form-group {
    margin-bottom: 1.5em;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.admin-form input[type="text"],
.admin-form input[type="password"] {
    width: 100%;
    padding: 0.75em;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1em;
}

.admin-form input[type="checkbox"] {
    margin-right: 0.5em;
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
}

.admin-form small {
    display: block;
    margin-top: 0.25em;
    color: #888;
    font-size: 0.85em;
}

.form-actions {
    display: flex;
    gap: 1em;
    margin-top: 2em;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.9em;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75em 0.5em;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons form {
        width: 100%;
    }
    
    .action-buttons button {
        width: 100%;
    }
}

/* Pricing Page Styles */
.pricing-section {
    margin: 4em 0;
    padding: 2em 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2em;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2em;
}

.pricing-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.9));
    border: 2px solid rgba(0, 191, 255, 0.2);
    border-radius: 16px;
    padding: 2.5em;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 191, 255, 0.1);
    /* animation: float 10s ease-in-out infinite; */ /* Disabled floating effect */
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 191, 255, 0.3), 0 0 40px rgba(157, 78, 221, 0.2);
    border-color: rgba(0, 191, 255, 0.5);
    /* animation: float 5s ease-in-out infinite, glow 2s ease-in-out infinite; */ /* Disabled floating effect */
}

.pricing-card.featured {
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 191, 255, 0.3);
    transform: scale(1.05);
}

.pricing-card.premium {
    border: 2px solid var(--accent-purple);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 25px rgba(157, 78, 221, 0.3);
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
}

.pricing-badge {
    position: absolute;
    top: 1em;
    right: 1em;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    padding: 0.4em 0.8em;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.pricing-badge.premium-badge {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-hover));
    box-shadow: 0 2px 8px rgba(157, 78, 221, 0.4);
    animation: glow-purple 2s ease-in-out infinite;
}

.pricing-header {
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid rgba(0, 191, 255, 0.2);
}

.pricing-target {
    font-size: 0.9em;
    color: rgba(0, 191, 255, 0.7);
    margin-top: 0.5em;
    font-style: italic;
    text-transform: none;
}

.pricing-header h3 {
    font-size: 2em;
    margin-bottom: 0.5em;
    color: var(--heading-color);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25em;
    margin-top: 0.5em;
}

.price-amount {
    font-size: 3em;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
    animation: pulse 3s ease-in-out infinite;
}

.pricing-card.premium .price-amount {
    color: var(--accent-purple);
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.price-period {
    font-size: 1.2em;
    color: #aaa;
}

.pricing-features {
    text-align: left;
    margin: 2em 0;
    min-height: 300px;
}

.pricing-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-features li {
    padding: 0.75em 0;
    color: var(--text-color);
    border-bottom: 1px solid rgba(0, 191, 255, 0.1);
    font-size: 1em;
    line-height: 1.6;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-cta {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid rgba(0, 191, 255, 0.2);
}

.current-plan-badge {
    display: inline-block;
    padding: 0.8em 2em;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(157, 78, 221, 0.2));
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-faq {
    margin: 4em 0;
    padding: 3em 2em;
}

.pricing-faq h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 2em;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2em;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-item {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.7), rgba(20, 25, 38, 0.7));
    padding: 2em;
    border-radius: 12px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 191, 255, 0.1);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(0, 191, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 191, 255, 0.2);
    transform: translateY(-4px);
}

.faq-item h3 {
    color: var(--accent-color);
    margin-bottom: 1em;
    font-size: 1.3em;
}

.faq-item p {
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
}

/* About page video styling */
.about-intro-video {
    max-width: 50%;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 3em auto;
    display: block;
}

@media (max-width: 768px) {
    .about-intro-video {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        padding: 0 1em;
    }
    
    .pricing-card.featured {
        transform: scale(1);
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* Global mobile fix to prevent horizontal scrolling */
@media (max-width: 768px) {
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    img, video, iframe, embed, object {
        max-width: 100%;
        height: auto;
    }
    
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure forms don't overflow */
    form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure all text containers are constrained */
    p, div, span, a, h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Prevent fixed width elements from causing overflow */
    .nav-links.mobile-open {
        max-width: 280px;
        width: 280px;
    }
    
    /* Ensure video background doesn't cause overflow */
    .video-background-container {
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
    }
    
    #background-video {
        max-width: 100vw;
        width: 100vw;
    }
}

/* ============================================
   COMMAND CENTER - FUTURISTIC HUD INTERFACE
   ============================================ */

.command-center {
    width: 100%;
    max-width: 100%;
    padding: 2em;
    box-sizing: border-box;
    background: transparent;
}

/* Loading state until first command-center API response (deferred mode) */
.cc-initial-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    padding: 1em 1.5em;
    margin-bottom: 1em;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.12), rgba(157, 78, 221, 0.08));
    border: 1px solid rgba(0, 191, 255, 0.35);
    border-radius: 8px;
    color: rgba(224, 224, 224, 0.95);
    font-size: 0.95em;
}
.cc-initial-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-top-color: rgba(0, 191, 255, 0.9);
    border-radius: 50%;
    animation: cc-spinner 0.7s linear infinite;
}
@keyframes cc-spinner {
    to { transform: rotate(360deg); }
}

/* Command Center Header */
.cc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5em 2em;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.15), rgba(157, 78, 221, 0.1));
    border: 2px solid rgba(0, 191, 255, 0.4);
    border-radius: 12px;
    margin-bottom: 1em;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.2),
                0 0 40px rgba(157, 78, 221, 0.15);
    position: relative;
    overflow: hidden;
}

/* Compact header variant - half height */
.cc-header.cc-header-compact {
    padding: 0.75em 1.5em;
    margin-bottom: 0.75em;
}

.cc-header.cc-header-compact .cc-title h1 {
    font-size: 1.5em;
    letter-spacing: 2px;
}

.cc-header.cc-header-compact .cc-status {
    margin-top: 0.25em;
    font-size: 0.8em;
}

.cc-header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5), 
        rgba(0, 191, 255, 0.5), 
        rgba(157, 78, 221, 0.5));
    background-size: 400% 400%;
    border-radius: 12px;
    z-index: -1;
    opacity: 0.6;
}

/* Removed heavy animations for performance */
.cc-title h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px rgba(0, 191, 255, 0.6),
                 0 0 30px rgba(157, 78, 221, 0.4);
    letter-spacing: 3px;
}

.cc-status {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.5em;
    font-size: 0.9em;
    color: rgba(0, 255, 150, 0.9);
    text-shadow: 0 0 10px rgba(0, 255, 150, 0.5);
}

/* Export Bar - moved below header */
.cc-export-bar {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.75em 1.5em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.9));
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
}

.cc-export-bar .cc-export-label {
    font-size: 0.85em;
    color: rgba(0, 191, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    white-space: nowrap;
}

.cc-export-form-inline {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.cc-date-range-inline {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.cc-date-range-inline label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

.cc-date-range-inline input[type="date"] {
    padding: 0.4em 0.6em;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 0.85em;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    animation: cc-status-blink 2s ease-in-out infinite;
}

.status-indicator.active {
    background: rgba(0, 255, 150, 0.8);
    box-shadow: 0 0 15px rgba(0, 255, 150, 0.8);
    animation: cc-status-pulse 1.5s ease-in-out infinite;
}

@keyframes cc-status-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.cc-time {
    font-size: 1.2em;
    font-weight: 600;
    color: rgba(0, 191, 255, 0.9);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Export Section */
.cc-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1em;
}

.cc-export-section {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    align-items: flex-end;
}

.cc-export-label {
    font-size: 0.9em;
    color: rgba(0, 191, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.cc-export-form {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    align-items: flex-end;
}

.cc-date-range {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.cc-date-range label {
    font-size: 0.85em;
    color: rgba(0, 191, 255, 0.7);
    font-weight: 500;
}

.cc-date-range input[type="date"] {
    padding: 0.4em 0.6em;
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid rgba(0, 191, 255, 0.4);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
}

.cc-date-range input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.cc-export-buttons {
    display: flex;
    gap: 0.5em;
}

.cc-export-btn {
    padding: 0.5em 1.2em;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.3), rgba(157, 78, 221, 0.25));
    border: 1px solid rgba(0, 191, 255, 0.5);
    border-radius: 6px;
    color: var(--accent-color);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-export-btn:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.5), rgba(157, 78, 221, 0.4));
    border-color: rgba(0, 191, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.4);
    transform: translateY(-2px);
}

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

/* Stats Grid */
.cc-stats-grid {
    display: grid;
    /* 4-column grid so the 8 KPI tiles render as a clean 4x2 on desktop
       instead of the old 7+1 fall-off. Smaller breakpoints below step it
       down to 3 / 2 cols. */
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8em;
    margin-bottom: 2em;
}

.cc-stat-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.9));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    padding: 1em;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(0, 191, 255, 0.2),
                inset 0 0 20px rgba(0, 191, 255, 0.05);
}

.cc-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 191, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.cc-stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 191, 255, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5),
                0 0 50px rgba(0, 191, 255, 0.4),
                0 0 70px rgba(157, 78, 221, 0.3),
                inset 0 0 30px rgba(0, 191, 255, 0.1);
}

.cc-stat-card:hover::before {
    left: 100%;
}

.cc-stat-icon {
    font-size: 2em;
    margin-bottom: 0.3em;
    filter: drop-shadow(0 0 10px rgba(0, 191, 255, 0.5));
}

.cc-stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(0, 191, 255, 0.8),
                 0 0 40px rgba(157, 78, 221, 0.6);
    margin: 0.2em 0;
    font-family: 'Courier New', monospace;
    animation: cc-number-glow 2s ease-in-out infinite;
    line-height: 1.2;
}

@keyframes cc-number-glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 191, 255, 0.8),
                     0 0 40px rgba(157, 78, 221, 0.6);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 191, 255, 1),
                     0 0 60px rgba(157, 78, 221, 0.8);
    }
}

.cc-stat-label {
    font-size: 0.75em;
    color: var(--text-color);
    font-weight: 600;
    margin-top: 0.3em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.cc-stat-detail {
    font-size: 0.7em;
    color: rgba(0, 191, 255, 0.7);
    margin-top: 0.2em;
    line-height: 1.2;
}

/* Charts Grid */
.cc-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5em;
    margin-bottom: 2em;
}

.cc-chart-panel {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    padding: 1.5em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(0, 191, 255, 0.2),
                inset 0 0 20px rgba(0, 191, 255, 0.05);
}

/* SortableJS drag states */
.cc-sortable-ghost {
    opacity: 0.4;
    background: rgba(0, 191, 255, 0.1) !important;
    border: 2px dashed rgba(0, 191, 255, 0.6) !important;
}

.cc-sortable-chosen {
    cursor: grabbing !important;
    transform: scale(1.02);
    box-shadow: 0 8px 40px rgba(0, 191, 255, 0.5),
                0 0 60px rgba(0, 191, 255, 0.3) !important;
    border-color: rgba(0, 191, 255, 0.8) !important;
    z-index: 1000 !important;
}

.cc-sortable-drag {
    opacity: 0.8;
}

.cc-chart-panel:hover {
    border-color: rgba(0, 191, 255, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5),
                0 0 50px rgba(0, 191, 255, 0.4);
}

.cc-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    padding-bottom: 1em;
    border-bottom: 1px solid rgba(0, 191, 255, 0.2);
    position: relative;
    overflow: visible;
}

.cc-drag-handle {
    cursor: grab;
    color: rgba(0, 191, 255, 0.6);
    font-size: 1.2em;
    margin-right: 0.5em;
    user-select: none;
    transition: all 0.2s ease;
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.cc-drag-handle:hover {
    color: rgba(0, 191, 255, 1);
    background: rgba(0, 191, 255, 0.1);
    transform: scale(1.1);
}

.cc-drag-handle:active {
    cursor: grabbing;
}

.cc-panel-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.cc-panel-controls {
    display: flex;
    gap: 0.5em;
    position: relative;
    overflow: visible;
}

.cc-btn-small {
    background: rgba(0, 191, 255, 0.2);
    border: 1px solid rgba(0, 191, 255, 0.4);
    color: var(--accent-color);
    padding: 0.3em 0.6em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.cc-btn-small:hover {
    background: rgba(0, 191, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.cc-chart-container {
    height: 300px;
    position: relative;
}

/* Windows Grid */
.cc-windows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5em;
    margin-top: 2em;
}

/* Fixed 2-column layout for windows */
.cc-windows-grid.cc-windows-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.cc-window {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(0, 191, 255, 0.15);
    overflow: visible;
    min-height: 300px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.cc-window-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.75em 1em;
    background: rgba(0, 191, 255, 0.1);
    border-bottom: 1px solid rgba(0, 191, 255, 0.3);
    flex-shrink: 0;
    gap: 0.5em;
}

.cc-window-header .cc-drag-handle {
    cursor: grab;
    color: rgba(0, 191, 255, 0.6);
    font-size: 1.1em;
    user-select: none;
    transition: all 0.2s ease;
    padding: 0.3em 0.5em;
    border-radius: 4px;
    flex-shrink: 0;
}

.cc-window-header .cc-drag-handle:hover {
    color: rgba(0, 191, 255, 1);
    background: rgba(0, 191, 255, 0.2);
}

.cc-window-header .cc-drag-handle:active {
    cursor: grabbing;
    background: rgba(0, 191, 255, 0.3);
}

.cc-window-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1em;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.cc-window-header .cc-panel-controls {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-shrink: 0;
}

.cc-window:hover {
    border-color: rgba(0, 191, 255, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 191, 255, 0.3);
}

.cc-window.minimized {
    min-height: auto;
    max-height: 50px;
}

.cc-window.minimized .cc-window-content {
    display: none;
}

.cc-window-controls {
    display: flex;
    gap: 0.5em;
}

.cc-btn-minimize,
.cc-btn-maximize {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(0, 191, 255, 0.4);
    background: rgba(0, 191, 255, 0.2);
    color: var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.cc-btn-minimize:hover,
.cc-btn-maximize:hover {
    background: rgba(0, 191, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.cc-window-content {
    padding: 1em;
    flex: 1;
    overflow-y: auto;
}

.cc-window-content::-webkit-scrollbar {
    width: 6px;
}

.cc-window-content::-webkit-scrollbar-track {
    background: rgba(0, 191, 255, 0.1);
    border-radius: 3px;
}

.cc-window-content::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 255, 0.4);
    border-radius: 3px;
}

.cc-window-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 191, 255, 0.6);
}

/* Notification List */
.cc-notification-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.cc-notification-item {
    display: flex;
    gap: 1em;
    padding: 1em;
    background: rgba(0, 191, 255, 0.05);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cc-notification-item:hover {
    background: rgba(0, 191, 255, 0.1);
    border-color: rgba(0, 191, 255, 0.4);
    transform: translateX(5px);
}

.cc-notification-item.unread {
}

/* Notification inline video player styles */
.notification-video-player {
    margin: 0.75em 0;
    border-radius: 4px;
    overflow: hidden;
}

.notification-player-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.notification-player-container > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.notification-timestamp {
    cursor: pointer;
    color: #00bfff;
    text-decoration: underline;
    transition: color 0.2s;
}

.notification-timestamp:hover {
    color: #0099cc;
}

/* Notification thumbnail styles */
.notification-thumbnail-container {
    position: relative;
    overflow: hidden;
}

.notification-thumbnail-container:hover .notification-thumbnail-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.notification-thumbnail-container:hover .notification-thumbnail-overlay > div {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.notification-thumbnail-overlay > div {
    transition: transform 0.2s, background 0.2s;
}
    border-left: 4px solid var(--accent-color);
    background: rgba(0, 191, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
}

.cc-notif-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.cc-notif-content {
    flex: 1;
}

.cc-notif-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3em;
}

.cc-notif-title a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.cc-notif-title a:hover {
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.8);
}

.cc-notif-meta {
    display: flex;
    gap: 1em;
    align-items: center;
    font-size: 0.85em;
}

.cc-keyword-tag {
    background: rgba(0, 191, 255, 0.2);
    border: 1px solid rgba(0, 191, 255, 0.4);
    padding: 0.2em 0.6em;
    border-radius: 12px;
    color: var(--accent-color);
    font-size: 0.9em;
}

.cc-time {
    color: rgba(0, 191, 255, 0.6);
    font-family: 'Courier New', monospace;
}

/* Search List */
.cc-search-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.cc-search-item {
    display: flex;
    gap: 1em;
    padding: 1em;
    background: rgba(157, 78, 221, 0.05);
    border: 1px solid rgba(157, 78, 221, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cc-search-item:hover {
    background: rgba(157, 78, 221, 0.1);
    border-color: rgba(157, 78, 221, 0.4);
    transform: translateX(5px);
}

.cc-search-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.cc-search-content {
    flex: 1;
}

.cc-search-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3em;
}

.cc-search-meta {
    display: flex;
    gap: 1em;
    align-items: center;
    font-size: 0.85em;
}

.cc-keywords {
    color: rgba(157, 78, 221, 0.8);
    font-style: italic;
}

/* Activity List */
.cc-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.cc-activity-item {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.cc-activity-bar {
    height: 8px;
    background: rgba(0, 191, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.cc-activity-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 191, 255, 0.8), 
        rgba(157, 78, 221, 0.8));
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    animation: cc-bar-glow 2s ease-in-out infinite;
}

@keyframes cc-bar-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.8);
    }
}

.cc-activity-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-color);
}

.cc-activity-count {
    color: var(--accent-color);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Empty State */
.cc-empty-state {
    text-align: center;
    padding: 3em 1em;
    color: rgba(0, 191, 255, 0.5);
    font-style: italic;
}

/* Floating Command Center Toggle Button */
.cc-float-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.9), rgba(157, 78, 221, 0.9));
    border: 3px solid rgba(0, 191, 255, 0.6);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.5),
                0 0 40px rgba(157, 78, 221, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: cc-float-pulse 2s ease-in-out infinite;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
}

.cc-float-button.active {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.9), rgba(255, 99, 71, 0.9));
    border-color: rgba(255, 165, 0, 0.8);
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.5),
                0 0 40px rgba(255, 99, 71, 0.4);
}

/* Command Center Embedded (always visible) */
.command-center-embedded {
    width: 100%;
    margin-bottom: 2em;
}

.command-center-embedded .command-center {
    position: relative;
    width: 100%;
    padding: 1em;
}

.cc-login-message {
    padding: 3em;
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(42, 52, 65, 0.9));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    margin: 2em 0;
}

.cc-login-message p {
    color: var(--text-color);
    font-size: 1.2em;
}

.cc-login-message a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.cc-login-message a:hover {
    text-decoration: underline;
}

.cc-float-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transform: rotate(45deg);
    animation: cc-float-shine 3s ease-in-out infinite;
}

@keyframes cc-float-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 191, 255, 0.5),
                    0 0 40px rgba(157, 78, 221, 0.4),
                    inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 30px rgba(0, 191, 255, 0.7),
                    0 0 60px rgba(157, 78, 221, 0.6),
                    inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

@keyframes cc-float-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.cc-float-button:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 40px rgba(0, 191, 255, 0.8),
                0 0 80px rgba(157, 78, 221, 0.7),
                inset 0 0 40px rgba(255, 255, 255, 0.3);
    animation: none;
}

.cc-float-icon {
    font-size: 2em;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
}

.cc-float-text {
    font-size: 0.7em;
    letter-spacing: 1px;
    margin-top: 0.2em;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .cc-float-button {
        width: 70px;
        height: 70px;
        bottom: 20px;
        right: 20px;
    }
    
    .cc-float-icon {
        font-size: 1.8em;
    }
    
    .cc-float-text {
        font-size: 0.6em;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cc-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Note: the base .cc-stats-grid rule above already uses repeat(4, 1fr),
   so the old max-width:1400px override was redundant and has been removed.
   Smaller-screen step-downs continue below. */

@media (max-width: 1000px) {
    .cc-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .command-center {
        padding: 1em;
    }
    
    .cc-header {
        flex-direction: column;
        gap: 1em;
        text-align: center;
    }
    
    .cc-title h1 {
        font-size: 1.4em;
    }
    
    .cc-header.cc-header-compact .cc-title h1 {
        font-size: 1.2em;
    }
    
    .cc-export-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75em;
    }
    
    .cc-export-form-inline {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .cc-date-range-inline {
        flex-wrap: wrap;
    }
    
    .cc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cc-windows-grid,
    .cc-windows-grid.cc-windows-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .cc-window {
        min-height: 250px;
        max-height: 350px;
    }
    
    .cc-chart-container {
        height: 250px;
    }
}

/* KPI Section Styles */
.cc-kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2em;
    margin-top: 2em;
}

.cc-kpi-panel {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(42, 52, 65, 0.9));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    padding: 1.5em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(0, 191, 255, 0.2);
}

.cc-kpi-summary {
    display: flex;
    justify-content: space-around;
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid rgba(0, 191, 255, 0.2);
}

.cc-kpi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.cc-kpi-label {
    font-size: 0.85em;
    color: rgba(0, 191, 255, 0.7);
    text-transform: uppercase;
}

.cc-kpi-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-color);
}

.cc-kpi-value.trend-up {
    color: #00ff90;
}

.cc-kpi-value.trend-down {
    color: #ff6b6b;
}

/* Competitor Benchmarking */
.cc-competitor-input {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1em;
    margin-bottom: 1.5em;
    align-items: end;
}

.cc-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.cc-input-group label {
    font-size: 0.85em;
    color: rgba(0, 191, 255, 0.8);
    text-transform: uppercase;
}

.cc-input-group input,
.cc-input-group select {
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 6px;
    padding: 0.7em;
    color: var(--text-color);
    font-size: 0.9em;
}

.cc-input-group input:focus,
.cc-input-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.cc-btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-purple));
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.4);
}

.cc-sov-results {
    margin-top: 1.5em;
    padding: 1em;
    background: rgba(10, 14, 26, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.2);
}

.cc-sov-stats {
    display: flex;
    justify-content: space-around;
    gap: 1em;
}

.cc-sov-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.cc-sov-label {
    font-size: 0.9em;
    color: rgba(0, 191, 255, 0.7);
}

.cc-sov-value {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--accent-color);
}

/* Sentiment Pulse */
.cc-sentiment-bar {
    display: flex;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1em;
    border: 2px solid rgba(0, 191, 255, 0.3);
}

.cc-sentiment-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: width 0.5s ease;
    min-width: 80px;
}

.cc-sentiment-segment.positive {
    background: linear-gradient(135deg, rgba(0, 255, 150, 0.8), rgba(0, 200, 120, 0.8));
}

.cc-sentiment-segment.neutral {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(200, 200, 200, 0.2));
}

.cc-sentiment-segment.negative {
    background: linear-gradient(135deg, rgba(255, 99, 132, 0.8), rgba(200, 70, 100, 0.8));
}

.cc-sentiment-label {
    font-size: 0.75em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cc-sentiment-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Potential Reach */
.cc-reach-display {
    text-align: center;
    padding: 2em;
}

.cc-reach-number {
    font-size: 4em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5em;
    text-shadow: 0 0 30px rgba(0, 191, 255, 0.5);
}

.cc-reach-label {
    font-size: 1.2em;
    color: rgba(0, 191, 255, 0.8);
    margin-bottom: 1em;
    text-transform: uppercase;
}

.cc-reach-breakdown {
    display: flex;
    justify-content: center;
    gap: 1em;
    color: rgba(0, 191, 255, 0.6);
    font-size: 0.9em;
}

/* Influencer Leaderboard */
.cc-influencer-list {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    margin-top: 1em;
}

.cc-influencer-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 1em;
    align-items: center;
    padding: 1em;
    background: rgba(10, 14, 26, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    transition: all 0.3s ease;
}

.cc-influencer-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
    transform: translateX(5px);
}

.cc-influencer-rank {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
}

.cc-influencer-name {
    color: var(--text-color);
    font-weight: 500;
}

.cc-influencer-count {
    color: rgba(0, 191, 255, 0.8);
    font-weight: bold;
}

/* Actionable Proof Gallery */
.cc-proof-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5em;
    margin-top: 1em;
}

.cc-proof-card {
    background: rgba(10, 14, 26, 0.8);
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cc-proof-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.4);
    transform: translateY(-5px);
}

.cc-proof-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.cc-proof-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc-proof-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
}

.cc-proof-thumbnail:hover .cc-proof-play {
    transform: translate(-50%, -50%) scale(1.2);
}

.cc-proof-content {
    padding: 1em;
}

.cc-proof-content h4 {
    color: var(--text-color);
    margin-bottom: 0.5em;
    font-size: 1em;
}

.cc-proof-meta {
    display: flex;
    gap: 1em;
    margin-bottom: 0.5em;
    align-items: center;
}

.cc-keyword-tag {
    background: rgba(0, 191, 255, 0.2);
    color: var(--accent-color);
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

.cc-timestamp {
    color: rgba(0, 191, 255, 0.7);
    font-size: 0.85em;
}

.cc-proof-snippet {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    line-height: 1.5;
    margin-top: 0.5em;
}

.cc-empty-state {
    text-align: center;
    padding: 2em;
    color: rgba(0, 191, 255, 0.5);
    font-style: italic;
}

.cc-btn-small {
    background: rgba(0, 191, 255, 0.2);
    border: 1px solid rgba(0, 191, 255, 0.4);
    border-radius: 4px;
    padding: 0.4em 0.8em;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.2s ease;
    display: inline-block;
}

.cc-btn-small:hover {
    background: rgba(0, 191, 255, 0.3);
    border-color: var(--accent-color);
}

/* Info Tooltips */
.cc-info-tooltip {
    position: relative;
    display: inline-block;
    margin-right: 0.5em;
    z-index: 20;
}

.cc-info-icon {
    font-size: 1.2em;
    cursor: help;
    color: rgba(0, 191, 255, 0.7);
    transition: all 0.2s ease;
    display: inline-block;
}

.cc-info-icon:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.cc-tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    right: 0;
    left: auto;
    transform: none;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.98), rgba(26, 31, 46, 0.98));
    color: var(--text-color);
    padding: 1em 1.2em;
    border-radius: 8px;
    border: 2px solid rgba(0, 191, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(0, 191, 255, 0.3);
    width: clamp(280px, 34vw, 420px);
    min-width: 280px;
    max-width: 420px;
    z-index: 1000;
    font-size: 0.85em;
    line-height: 1.6;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.cc-tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 16px;
    left: auto;
    transform: none;
    border: 8px solid transparent;
    border-bottom-color: rgba(0, 191, 255, 0.5);
}

.cc-tooltip-content strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5em;
    font-size: 1.05em;
}

.cc-info-tooltip:hover .cc-tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Ensure tooltips don't overflow on mobile */
@media (max-width: 768px) {
    .cc-tooltip-content {
        width: min(340px, calc(100vw - 24px));
        min-width: 260px;
        max-width: calc(100vw - 24px);
        font-size: 0.8em;
        left: auto;
        right: 0;
        transform: none;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }
    
    .cc-tooltip-content::after {
        left: auto;
        right: 20px;
        transform: none;
    }

    /* Override generic mobile text-wrap rule for command center tooltips */
    .cc-tooltip-content,
    .cc-tooltip-content *,
    .cc-info-tooltip,
    .cc-info-tooltip * {
        max-width: none !important;
        word-wrap: normal !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        white-space: normal !important;
    }
}

/* Premium Management UI */
.premium-management {
    margin-top: 2em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    padding: 1.5em;
}

.premium-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
    gap: 1em;
}

.premium-management-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.3em;
}

.premium-management-controls {
    display: flex;
    gap: 1em;
    align-items: center;
    flex-wrap: wrap;
}

.premium-search-input {
    padding: 0.6em 1em;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95em;
    min-width: 200px;
}

.premium-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

.premium-filter-select {
    padding: 0.6em 1em;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95em;
}

.premium-bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 1em;
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 8px;
}

.premium-bulk-actions span {
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 0.5em;
}

.premium-bulk-btn {
    padding: 0.4em 0.8em;
    background: rgba(0, 191, 255, 0.2);
    border: 1px solid rgba(0, 191, 255, 0.4);
    border-radius: 6px;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.premium-bulk-btn:hover {
    background: rgba(0, 191, 255, 0.3);
    border-color: rgba(0, 191, 255, 0.6);
}

.premium-bulk-delete {
    background: rgba(255, 99, 132, 0.2);
    border-color: rgba(255, 99, 132, 0.4);
    color: #ff6384;
}

.premium-bulk-delete:hover {
    background: rgba(255, 99, 132, 0.3);
    border-color: rgba(255, 99, 132, 0.6);
}

.premium-table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.premium-management-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.premium-management-table thead {
    position: sticky;
    top: 0;
    background: rgba(26, 31, 46, 0.98);
    z-index: 10;
}

.premium-management-table th {
    padding: 1em;
    text-align: left;
    border-bottom: 2px solid rgba(0, 191, 255, 0.3);
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.premium-management-table td {
    padding: 1em;
    border-bottom: 1px solid rgba(0, 191, 255, 0.1);
    color: var(--text-color);
}

.premium-management-table tbody tr {
    transition: all 0.2s ease;
}

.premium-management-table tbody tr:hover {
    background: rgba(0, 191, 255, 0.05);
}

.premium-management-table tbody tr.premium-muted {
    opacity: 0.5;
    background: rgba(100, 100, 100, 0.1);
}

.premium-sub-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3em;
}

.premium-sub-id {
    font-size: 0.85em;
    color: #aaa;
}

.premium-keywords-display {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent-color);
}

.premium-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.premium-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.premium-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(100, 100, 100, 0.5);
    transition: 0.3s;
    border-radius: 24px;
}

.premium-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.premium-toggle-switch input:checked + .premium-toggle-slider {
    background-color: var(--accent-color);
}

.premium-toggle-switch input:checked + .premium-toggle-slider:before {
    transform: translateX(26px);
}

.premium-quick-actions {
    display: flex;
    gap: 0.5em;
}

.premium-check-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-right: 5px;
}

.premium-check-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.premium-check-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.premium-action-btn {
    background: transparent;
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 6px;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.4em 0.6em;
    font-size: 1em;
    transition: all 0.2s ease;
    line-height: 1;
}

.premium-action-btn:hover {
    background: rgba(0, 191, 255, 0.2);
    border-color: rgba(0, 191, 255, 0.6);
    transform: scale(1.1);
}

.premium-delete-btn {
    border-color: rgba(255, 99, 132, 0.3);
    color: #ff6384;
}

.premium-delete-btn:hover {
    background: rgba(255, 99, 132, 0.2);
    border-color: rgba(255, 99, 132, 0.6);
}

.premium-sub-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

@media (max-width: 768px) {
    .premium-management-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .premium-management-controls {
        flex-direction: column;
    }
    
    .premium-search-input,
    .premium-filter-select {
        width: 100%;
    }
    
    .premium-table-container {
        font-size: 0.85em;
    }
    
    .premium-management-table th,
    .premium-management-table td {
        padding: 0.6em 0.4em;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 100px; /* Position below header (header is ~80px tall) */
    right: 20px;
    z-index: 10001; /* Higher than header z-index (100) to appear in front */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 1em 1.5em;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(20, 25, 38, 0.95));
    border: 2px solid rgba(0, 191, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3), 0 0 30px rgba(0, 191, 255, 0.1);
    color: var(--text-color);
    font-size: 0.95em;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out, toastFadeOut 0.3s ease-in 2.7s;
    animation-fill-mode: forwards;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-purple));
    animation: toastProgress 3s linear forwards;
}

.toast.success {
    border-color: rgba(144, 255, 144, 0.5);
    box-shadow: 0 4px 20px rgba(144, 255, 144, 0.3), 0 0 30px rgba(144, 255, 144, 0.1);
}

.toast.success::before {
    background: linear-gradient(90deg, #90ff90, #4ade80);
}

.toast.error {
    border-color: rgba(255, 144, 144, 0.5);
    box-shadow: 0 4px 20px rgba(255, 144, 144, 0.3), 0 0 30px rgba(255, 144, 144, 0.1);
}

.toast.error::before {
    background: linear-gradient(90deg, #ff9090, #f87171);
}

.toast.warning {
    border-color: rgba(255, 200, 100, 0.5);
    box-shadow: 0 4px 20px rgba(255, 200, 100, 0.3), 0 0 30px rgba(255, 200, 100, 0.1);
}

.toast.warning::before {
    background: linear-gradient(90deg, #ffc864, #fbbf24);
}

.toast.info {
    border-color: rgba(0, 191, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3), 0 0 30px rgba(0, 191, 255, 0.1);
}

.toast.info::before {
    background: linear-gradient(90deg, var(--accent-color), var(--accent-purple));
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75em;
}

.toast-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@media (max-width: 768px) {
    .toast-container {
        top: 90px; /* Position below header on mobile */
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* ============================================
   YouTube Tab Two-Column Layout
   ============================================ */

/* Main container for YouTube tab - side by side layout */
.youtube-main-container {
    display: flex;
    gap: 2em;
    align-items: flex-start;
}

/* Left column - Form inputs */
.youtube-form-column {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

/* Right column - Video player */
.youtube-video-column {
    flex: 1;
    min-width: 400px;
    max-width: 640px;
}

/* Inline video player container */
#youtube-inline-player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(20, 25, 38, 0.9));
    border: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#youtube-inline-player-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 191, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(157, 78, 221, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

#youtube-inline-player {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

#youtube-inline-player iframe {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.video-placeholder-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1em;
    text-align: center;
    position: absolute;
    z-index: 1;
}

#youtube-inline-player-container.has-video .video-placeholder-text {
    display: none;
}

/* Right-justify text in form containers */
.youtube-form-column label,
.youtube-form-column h3,
#youtube-search-tab .subscription-section label,
#youtube-search-tab .subscription-section h3,
#youtube-search-tab .logo-subscription-section label,
#youtube-search-tab .logo-subscription-section h3,
#rss-search-tab label,
#rss-search-tab h3,
#social-search-tab label,
#social-search-tab h3 {
    text-align: right;
    display: block;
}

/* Form inputs should also be right-aligned */
.youtube-form-column input[type="text"],
.youtube-form-column input[type="url"],
.youtube-form-column select,
#youtube-search-tab .subscription-section input[type="text"],
#youtube-search-tab .subscription-section select,
#youtube-search-tab .logo-subscription-section input[type="text"],
#youtube-search-tab .logo-subscription-section select {
    text-align: right;
}

/* Right-align buttons container */
.youtube-form-column form > div:last-child {
    justify-content: flex-end;
}

/* Responsive: Stack on mobile */
@media (max-width: 1024px) {
    .youtube-main-container {
        flex-direction: column;
    }
    
    .youtube-form-column,
    .youtube-video-column {
        max-width: 100%;
        min-width: auto;
        width: 100%;
    }
    
    .youtube-video-column {
        order: -1; /* Video on top on mobile */
        margin-bottom: 1.5em;
    }
    
    /* Reset text alignment on mobile for better readability */
    .youtube-form-column label,
    .youtube-form-column h3,
    #youtube-search-tab .subscription-section label,
    #youtube-search-tab .subscription-section h3,
    #youtube-search-tab .logo-subscription-section label,
    #youtube-search-tab .logo-subscription-section h3 {
        text-align: left;
    }
    
    .youtube-form-column input[type="text"],
    .youtube-form-column input[type="url"],
    .youtube-form-column select {
        text-align: left;
    }
}

/* ── SEO Topic Tracker Cards ── */
.seo-topic-card {
    border: 1px solid rgba(0, 191, 255, 0.18);
    border-radius: 12px;
    padding: 1.2em 1.3em;
    background: rgba(26, 31, 46, 0.55);
    transition: border-color 0.25s, box-shadow 0.25s;
}
.seo-topic-card:hover {
    border-color: rgba(0, 191, 255, 0.35);
    box-shadow: 0 0 18px rgba(0, 191, 255, 0.08);
}
.seo-kpi-cell {
    background: rgba(0, 191, 255, 0.05);
    border-radius: 7px;
    padding: 0.5em 0.5em;
    text-align: center;
}
.seo-kpi-label {
    font-size: 0.72em;
    color: #8ea5bf;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.seo-kpi-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #e8f4ff;
    line-height: 1.3;
}
.seo-tip-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    z-index: 20;
}
.seo-tip-icon {
    cursor: help;
    font-size: 0.95em;
    color: rgba(0, 191, 255, 0.5);
    transition: color 0.2s;
}
.seo-tip-icon:hover {
    color: rgba(0, 191, 255, 1);
}
.seo-tip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.98), rgba(26, 31, 46, 0.98));
    color: #d9eeff;
    padding: 0.8em 1em;
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.45);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 191, 255, 0.15);
    width: 260px;
    min-width: 220px;
    max-width: 320px;
    z-index: 1000;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}
.seo-tip-box::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 191, 255, 0.45) transparent;
}
.seo-tip-wrap:hover .seo-tip-box {
    visibility: visible;
    opacity: 1;
}
@media (max-width: 768px) {
    .seo-tip-box {
        left: auto;
        right: -10px;
        transform: none;
        width: min(260px, calc(100vw - 30px));
    }
    .seo-tip-box::before {
        left: auto;
        right: 14px;
        transform: none;
    }
}
.seo-badge {
    font-size: 0.74em;
    padding: 0.15em 0.55em;
    border-radius: 999px;
    font-weight: 600;
}
.seo-badge-rising { background: rgba(0,255,136,0.15); color: #7cffb2; }
.seo-badge-falling { background: rgba(255,100,100,0.15); color: #ff8f8f; }
.seo-badge-stable { background: rgba(255,255,255,0.08); color: #9fb3c8; }
.seo-badge-traffic { background: rgba(255,200,0,0.12); color: #ffd966; }
.seo-section-label {
    font-size: 0.74em;
    color: #8ea5bf;
    margin-bottom: 0.3em;
}
.seo-assoc-tag {
    font-size: 0.73em;
    padding: 0.2em 0.5em;
    border-radius: 999px;
    border: 1px solid rgba(0,191,255,0.3);
    color: #d9eeff;
    background: rgba(0,191,255,0.06);
}
.seo-trend-tag {
    font-size: 0.73em;
    padding: 0.2em 0.5em;
    border-radius: 999px;
    background: rgba(255,200,0,0.08);
    border: 1px solid rgba(255,200,0,0.2);
    color: #ffd966;
}
.seo-news-link {
    font-size: 0.8em;
    color: #8ecfff;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 0.4em;
    padding: 0.3em 0.5em;
    border-radius: 5px;
    background: rgba(0,191,255,0.04);
    transition: background 0.2s;
}
.seo-news-link:hover {
    background: rgba(0,191,255,0.12);
}
.seo-card-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
    margin-top: 0.85em;
}
.seo-card-left, .seo-card-right {
    display: flex;
    flex-direction: column;
    gap: 0.65em;
}

@media (max-width: 700px) {
    .seo-card-bottom {
        grid-template-columns: 1fr;
    }
    .seo-topic-card .seo-kpi-cell {
        padding: 0.35em 0.25em;
    }
    .seo-kpi-value {
        font-size: 0.9em;
    }
}

/* ------------------------------------------------------------------
 * Notification Intelligence (Phase 1)
 *
 * Visual layer for the LLM-driven intel + solo workflow shown on each
 * notification card: burst badge, AI summary block, urgency/threat/
 * opportunity/sentiment score chips, source-quote collapse, status
 * dropdown, notes editor.
 * ------------------------------------------------------------------ */

/* Burst badge — highest-confidence "something is moving" signal. */
.notif-burst-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff5722, #ff9800);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 87, 34, 0.45);
    animation: notif-burst-pulse 2.6s ease-in-out infinite;
}

@keyframes notif-burst-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 87, 34, 0.35); }
    50%      { box-shadow: 0 0 18px rgba(255, 87, 34, 0.75); }
}

@media (prefers-reduced-motion: reduce) {
    .notif-burst-badge { animation: none; }
}

/* Triage status chip (header) */
.notif-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.12);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.notif-status-chip.notif-status-in_progress {
    background: rgba(33, 150, 243, 0.18);
    color: #64b5f6;
    border-color: rgba(33, 150, 243, 0.4);
}
.notif-status-chip.notif-status-done {
    background: rgba(76, 175, 80, 0.18);
    color: #81c784;
    border-color: rgba(76, 175, 80, 0.4);
}
.notif-status-chip.notif-status-snoozed {
    background: rgba(158, 158, 158, 0.18);
    color: #bdbdbd;
    border-color: rgba(158, 158, 158, 0.4);
}

/* Dim cards that have been triaged so the open inbox feels lighter. */
.notification-item.notif-status-done,
.notification-item.notif-status-snoozed {
    opacity: 0.72;
}

/* AI Summary block */
.notif-ai-summary {
    margin-top: 0.7em;
    padding: 0.7em 0.85em;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.08), rgba(0, 191, 255, 0.03));
    border-left: 3px solid rgba(0, 191, 255, 0.55);
    border-radius: 6px;
    font-size: 0.92em;
    line-height: 1.45;
    color: #e6e9ef;
}
.notif-ai-summary--pending {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(255, 255, 255, 0.15);
    color: #999;
}
.notif-ai-summary__label {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #00bfff;
    margin-bottom: 0.25em;
}
.notif-ai-summary--pending .notif-ai-summary__label {
    color: #888;
}
.notif-ai-summary__body {
    margin: 0;
}
.notif-ai-summary__body--pending em {
    color: #888;
}
.notif-ai-summary__why {
    margin-top: 0.5em;
    padding-top: 0.5em;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.88em;
    color: #cfd5e0;
}
.notif-ai-summary__why-label {
    font-weight: 600;
    color: #ffb74d;
    margin-right: 0.3em;
}

/* Score chips row */
.notif-score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 0.6em;
}
.notif-score {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.74em;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
    white-space: nowrap;
}
/* Color bands shared across urgency/threat/opportunity. Sentiment uses
   its own palette below to make positive/negative obvious. */
.notif-score--low    { background: rgba(76, 175, 80, 0.15);  border-color: rgba(76, 175, 80, 0.4);  color: #a5d6a7; }
.notif-score--mid    { background: rgba(255, 193, 7, 0.18);  border-color: rgba(255, 193, 7, 0.45); color: #ffe082; }
.notif-score--high   { background: rgba(244, 67, 54, 0.18);  border-color: rgba(244, 67, 54, 0.45); color: #ef9a9a; }

/* Sentiment chip overrides */
.notif-sentiment--positive { background: rgba(76, 175, 80, 0.18); border-color: rgba(76, 175, 80, 0.45); color: #a5d6a7; }
.notif-sentiment--neutral  { background: rgba(158, 158, 158, 0.15); border-color: rgba(158, 158, 158, 0.4); color: #cfcfcf; }
.notif-sentiment--negative { background: rgba(244, 67, 54, 0.18); border-color: rgba(244, 67, 54, 0.45); color: #ef9a9a; }

/* Source-quote toggle + collapsed quote */
.notif-source-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72em;
    cursor: pointer;
    margin-right: 0.5em;
    transition: all 0.15s ease;
}
.notif-source-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ddd;
}
.notif-source-quote {
    margin-top: 0.4em;
    padding: 0.5em 0.7em;
    background: rgba(255, 255, 255, 0.04);
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 0.85em;
    color: #aaa;
    line-height: 1.4;
}

/* Workflow row — status dropdown + notes + read/delete buttons */
.notif-workflow {
    margin-top: 0.7em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}
.notif-workflow__group {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.8em;
    color: #aaa;
}
.notif-workflow__label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}
.notif-status-select {
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #e6e9ef;
    font-size: 0.82em;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.notif-status-select:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.25);
}
.notif-status-select.notif-saved-ok {
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.35);
}
.notif-status-select.notif-saved-err {
    border-color: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.35);
}

.notif-notes-toggle,
.notif-workflow__btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.15s ease;
}
.notif-notes-toggle:hover,
.notif-workflow__btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.notif-workflow__btn--danger {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}
.notif-workflow__btn--danger:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}
.notif-workflow__form {
    margin: 0;
    display: inline;
}

/* Inline notes editor */
.notif-notes-editor {
    margin-top: 0.5em;
    padding: 0.6em 0.7em;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}
.notif-notes-textarea {
    width: 100%;
    min-height: 70px;
    box-sizing: border-box;
    resize: vertical;
    padding: 0.5em 0.7em;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.35);
    color: #e6e9ef;
    font-size: 0.88em;
    font-family: inherit;
    line-height: 1.4;
}
.notif-notes-textarea:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.25);
}
.notif-notes-status {
    margin-top: 0.3em;
    font-size: 0.75em;
    color: #888;
    min-height: 1em;
}

@media (max-width: 700px) {
    .notif-workflow {
        gap: 0.4em;
    }
    .notif-workflow__label {
        display: none;
    }
}

/* Command Center: Burst Alerts tile — pulses orange when there are
   active burst alerts today, otherwise renders identically to a normal
   stat card. */
.cc-stat-card.cc-stat-burst-active {
    border-color: rgba(255, 87, 34, 0.55) !important;
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.12), rgba(255, 152, 0, 0.06)) !important;
    animation: cc-burst-card-pulse 2.6s ease-in-out infinite;
}
.cc-stat-card.cc-stat-burst-active .cc-stat-icon {
    color: #ff9800;
    text-shadow: 0 0 12px rgba(255, 87, 34, 0.55);
}
.cc-stat-card.cc-stat-burst-active .cc-stat-value {
    color: #ffab40;
}

@keyframes cc-burst-card-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 87, 34, 0.0); }
    50%      { box-shadow: 0 0 18px rgba(255, 87, 34, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
    .cc-stat-card.cc-stat-burst-active { animation: none; }
}

/* ------------------------------------------------------------------
 * Mobile fixes — May 2026
 *
 * Targeted overrides for four issues that didn't fit cleanly into the
 * existing mobile rules:
 *   1. SEO Topic Tracker — the add-topic form has a 5-column grid
 *      with two fixed-px columns that clip on narrow screens.
 *   2. Web Pulse — three "Top 20 / Top 50 positive vs negative" panels
 *      use inline grid-template-columns: 1fr 1fr which makes the right
 *      (negative) column clip off-screen on mobile.
 *   3. AI Assistant — the chat container is hard-coded to 600px tall,
 *      which renders as a giant empty dark box above the input on
 *      mobile and forces a long scroll to find the textbox.
 *   4. Notifications — the heading + actions + filter rows take up a
 *      lot of vertical space on mobile, pushing the first notification
 *      off-screen. We compact the spacing without changing the layout.
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
    /* 1. SEO Topic Tracker — stack the add-topic form vertically.
     *    The outer wrapper that hosts the "Refresh Data" button and
     *    the inner form both need their inline grids overridden.
     *    NOTE: Flask renders url_for('add_seo_topic') as the literal
     *    path "/seo-tracker/add" (and "/seo-tracker/refresh") so the
     *    selectors below match the rendered form action, not the
     *    Python route name. */
    #seo-tracker-search-tab .section > div[style*="grid-template-columns: 1fr auto"] {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8em !important;
    }
    #seo-tracker-search-tab form[action*="/seo-tracker/add"] {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 0.6em !important;
    }
    #seo-tracker-search-tab form[action*="/seo-tracker/add"] input,
    #seo-tracker-search-tab form[action*="/seo-tracker/add"] select,
    #seo-tracker-search-tab form[action*="/seo-tracker/add"] button {
        width: 100% !important;
        min-height: 44px;
        box-sizing: border-box !important;
    }
    #seo-tracker-search-tab form[action*="/seo-tracker/refresh"] {
        width: 100% !important;
    }
    #seo-tracker-search-tab form[action*="/seo-tracker/refresh"] button {
        width: 100% !important;
        min-height: 44px;
    }
    /* Keep each SEO topic card visually separated and contained. The
     * outer flex container already sets gap, but on narrow screens
     * the .section background can collapse against the cards inside
     * if padding is too tight, making them look like they "smash"
     * together. */
    #seo-tracker-search-tab .section,
    #seo-tracker-search-tab .section.history-section {
        padding: 1em !important;
        margin-bottom: 1em !important;
    }
    #seo-tracker-search-tab .seo-topic-card {
        padding: 0.9em !important;
        margin: 0 !important;
        border-color: rgba(0, 191, 255, 0.35) !important;
    }
    /* Header row: name+badges on top, action buttons wrap below if
     * the card is too narrow to fit them on one line. */
    #seo-tracker-search-tab .seo-topic-card > div:first-child {
        flex-wrap: wrap !important;
        gap: 0.5em !important;
    }
    #seo-tracker-search-tab .seo-topic-card .seo-badge {
        font-size: 0.68em;
        padding: 0.12em 0.45em;
    }
    /* KPI row: 5-column grid is unreadable on phones. Drop to 2
     * columns on small phones and 3 on slightly wider screens so the
     * numbers and labels actually fit. */
    #seo-tracker-search-tab .seo-topic-card > div[style*="grid-template-columns: repeat(5, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4em !important;
    }
    #seo-tracker-search-tab .seo-topic-card .seo-kpi-cell {
        padding: 0.5em 0.4em !important;
    }
    #seo-tracker-search-tab .seo-topic-card .seo-kpi-cell .seo-kpi-label {
        white-space: normal !important;
        font-size: 0.7em !important;
        line-height: 1.25;
    }
    #seo-tracker-search-tab .seo-topic-card .seo-kpi-cell .seo-kpi-value {
        font-size: 1em !important;
    }
    #seo-tracker-search-tab .seo-card-bottom {
        grid-template-columns: 1fr !important;
        gap: 0.9em !important;
        margin-top: 0.8em !important;
    }
    /* Prevent matched-trends / news / association tag clouds from
     * overflowing their container on narrow screens. */
    #seo-tracker-search-tab .seo-trend-tag,
    #seo-tracker-search-tab .seo-assoc-tag {
        max-width: 100%;
        word-break: break-word;
    }
    #seo-tracker-search-tab .seo-news-link {
        font-size: 0.78em;
    }
    #seo-tracker-search-tab .section-header {
        flex-wrap: wrap;
    }
    /* 480px and below: even tighter so cards fit a typical phone */
    @media (max-width: 480px) {
        #seo-tracker-search-tab .seo-topic-card {
            padding: 0.7em !important;
        }
        #seo-tracker-search-tab .seo-topic-card .seo-kpi-cell .seo-kpi-label {
            font-size: 0.62em !important;
        }
        #seo-tracker-search-tab .seo-topic-card .seo-kpi-cell .seo-kpi-value {
            font-size: 0.9em !important;
        }
    }

    /* 2. Web Pulse — collapse the inline 1fr / 1fr grids inside
     *    #webmood-content so the negative (right) column drops below
     *    the positive (left) column on mobile. */
    #webmood-content div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5em !important;
    }
    /* Shorten the per-column scrollable lists so they don't each
     * fill a full screen height after stacking. */
    #webmood-content #top-20-positive-chart,
    #webmood-content #top-20-negative-chart,
    #webmood-content #all-time-positive-sources,
    #webmood-content #all-time-negative-sources,
    #webmood-content #top-50-positive-headlines,
    #webmood-content #top-50-negative-headlines {
        max-height: 360px !important;
    }
    /* Reduce wasted vertical space on the other chart panels too */
    #webmood-content #top-20-words-chart,
    #webmood-content #category-pie-chart,
    #webmood-content #sentiment-distribution-chart {
        min-height: 280px !important;
        padding: 0.8em !important;
    }
    /* The sentiment gauge container has 2em padding on every side */
    #webmood-content .sentiment-gauge-container {
        padding: 1em !important;
        margin-bottom: 1.5em !important;
    }
    #webmood-search-tab.active .webmood-section h3 {
        font-size: 1.05em;
        margin-bottom: 0.5em;
    }

    /* 3. AI Assistant — the hard-coded 600px chat container renders
     *    as a tall dark "black box" on mobile because its inline
     *    background is a dark gradient and most of the area is empty
     *    (only the greeting message + input fit in normal use).
     *
     *    On mobile we collapse the box to fit its content, cap it at
     *    a sensible max-height, and strip the dark gradient so empty
     *    space below the messages doesn't look like a black panel.
     *    The input row keeps its own subtle background so it's still
     *    clearly visible. */
    #ai-assistant-search-tab #ai-chat-container {
        height: auto !important;
        min-height: 280px !important;
        max-height: 55vh !important;
        background: transparent !important;
        box-shadow: none !important;
        border-color: rgba(0, 191, 255, 0.25) !important;
    }
    #ai-assistant-search-tab #ai-chat-messages {
        min-height: 180px !important;
        max-height: 40vh !important;
    }
    #ai-assistant-search-tab #ai-chat-input-container {
        background: rgba(10, 14, 26, 0.85) !important;
    }
    #ai-assistant-search-tab .ai-assistant-section > h2:first-child {
        font-size: 1.3em;
        margin-top: 0.6em !important;
        margin-bottom: 0.5em !important;
    }
    #ai-assistant-search-tab .ai-assistant-section > p {
        margin-top: 0 !important;
        margin-bottom: 0.8em !important;
    }

    /* 4. Notifications — compact the heading / actions / filter rows
     *    so the first notification card is visible without scrolling
     *    past a large dead zone, and don't let the dark search-section
     *    background spill below short content. */
    #notifications-search-tab .notification-section > h2#notifications-heading {
        font-size: 1.3em;
        margin-top: 0.4em !important;
        margin-bottom: 0.5em !important;
    }
    #notifications-search-tab #notifications > div[style*="justify-content: space-between"] {
        margin-bottom: 0.6em !important;
    }
    #notifications-search-tab #notifications > div[style*="justify-content: space-between"] h3 {
        font-size: 1em;
    }
    #notifications-search-tab .notif-filter-btn {
        padding: 4px 10px !important;
        font-size: 0.75em !important;
    }
    #notifications-search-tab #notifications > div[style*="gap: 0.4em"] {
        margin-bottom: 0.6em !important;
    }
    /* Notification cards: trim padding and stack actions cleanly */
    #notifications-search-tab .notification-item {
        padding: 0.9em !important;
    }
    #notifications-search-tab .upgrade-prompt {
        padding: 1.2em !important;
        margin: 0.8em 0 !important;
    }
    /* The "black empty area" below Notifications / AI Assistant on
     * mobile was the body's --bg-color (#0a0e1a) showing through
     * after a short tab's content ended. Previously fixed by making
     * the section itself 100vh tall with a gradient, but that created
     * a huge gradient void *between* short content and the end of
     * the page that the user had to scroll through.
     *
     * Better fix: keep the section content-sized (transparent), and
     * paint the themed gradient on the body for the whole page on
     * mobile. That way short tabs render their content immediately
     * below the header, and the visible "empty" area below is just
     * the page background which now looks intentionally themed
     * instead of a black void.
     */
    body {
        background:
            radial-gradient(ellipse 80% 40% at 50% 0%,
                rgba(0, 191, 255, 0.16) 0%,
                rgba(0, 191, 255, 0.05) 30%,
                transparent 60%
            ),
            radial-gradient(ellipse 90% 50% at 50% 100%,
                rgba(157, 78, 221, 0.14) 0%,
                rgba(157, 78, 221, 0.04) 40%,
                transparent 70%
            ),
            linear-gradient(180deg,
                rgba(13, 22, 45, 0.92) 0%,
                rgba(20, 15, 40, 0.92) 100%
            ),
            var(--bg-color) !important;
        background-attachment: fixed !important;
    }
    /* And on the no-padding-mobile tabs, keep the section transparent
     * + content-sized so the body gradient shows through naturally
     * below short content. Hard-reset any inline minHeight the JS
     * may have set, and don't force flex-grow (the section sits at
     * the top of the layout column with the gradient body underneath).
     */
    .main-layout-container .search-section.no-padding-mobile,
    .main-layout-container .search-section:has(#ai-assistant-search-tab.active),
    .main-layout-container .search-section:has(#notifications-search-tab.active),
    .main-layout-container .search-section:has(#webmood-search-tab.active),
    .main-layout-container .search-section:has(#share-of-voice-search-tab.active) {
        background: transparent !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
    }
}
