:root {
    --primary: #422afb;
    --primary-hover: #3622cc;
    --sidebar-bg: #f8faff;
    --text-dark: #0a0b12;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}

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

body {
    background: white;
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

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

.app-container {
    display: flex;
    height: 100vh;
}

/* ================= SIDEBAR ================= */

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Wapas space-between kar diya taaki icons neeche hi rahein */
    padding: 24px 20px;
    transition: all 0.3s ease;

    height: 100vh;           /* Screen height lock */
    box-sizing: border-box;  
    overflow: hidden !important; /* Sidebar khud scroll nahi hoga, sirf chats scroll hongi */
}

/* Chrome aur Safari ke liye scrollbar chhupane ka code (Ise .sidebar ke turant baad rakhein) */
.sidebar::-webkit-scrollbar {
    display: none; 
}

/* ================= SIDEBAR COLLAPSED (EXACT MATCH) ================= */

.sidebar.collapsed {
    width: 80px !important;
    padding: 24px 0 !important;
    align-items: center !important;
    overflow: visible !important; /* Double check if it's visible */
}

/* Strict Hiding of Text and Specific Sections on Collapse */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .btn-text,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .pro-card,
.sidebar.collapsed .footer-nav span,
.sidebar.collapsed .details {
    display: none !important;
}

/* Yeh rule double selector strong specificity use karta hai, jisse collapsed mode mein card har haal mein hide rahega */
aside#sidebar.sidebar.collapsed .pro-card {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* Adjusting Top Layout for Centering Icons */
.sidebar.collapsed .brand-header {
    justify-content: center;
    margin-bottom: 30px;
}

/* Revised Icon Box Styling (The Gray Squares) */
.sidebar.collapsed .menu-icon,
.sidebar.collapsed .footer-nav a,
.sidebar.collapsed .user-profile-footer .avatar {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9; /* Light gray box background */
    color: var(--text-dark);
    border-radius: 12px;
    font-size: 20px; /* Slightly smaller for centered look */
    margin-bottom: 20px; /* Spacing between boxed icons */
    cursor: pointer;
    transition: background 0.2s;
}

/* Hover effect for boxed icons */
.sidebar.collapsed .menu-icon:hover,
.sidebar.collapsed .footer-nav a:hover,
.sidebar.collapsed .user-profile-footer .avatar:hover {
    background: #e2e8f0;
}

/* Specific Style for New Chat Button (Still Blue) */
.sidebar.collapsed .new-chat-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 0 auto 30px auto; /* Centers the button horizontally */
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Setting spacing for the bottom section in collapsed mode */
.sidebar.collapsed .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ================= TOOLTIP SYSTEM (Added for Cursor Label) ================= */

/* Defining Tooltip for Collapsed Sidebar Elements */
.sidebar.collapsed [data-tooltip] {
    position: relative;
}

/* Creating the Tooltip (Label Box) */
.sidebar.collapsed [data-tooltip]::after {
    /* 1. Content fetch */
    content: attr(data-tooltip) !important;
    
    /* 2. Positioning */
    position: absolute;
    left: 110%;           
    top: 50%;
    transform: translateY(-50%);
    
    /* 3. Styling */
    background: #1f2937;
    color: white !important;
    padding: 8px 16px !important; /* Thoda extra side padding */
    border-radius: 8px;
    font-size: 14px !important;
    font-weight: 600 !important;
    z-index: 999999 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);

    /* 4. THE FIX (M vs MENU) */
    display: inline-block !important;
    visibility: visible;            /* Testing ke liye ise hamesha dikhao pehle */
    white-space: nowrap !important; /* Text ko line todne se rokega */
    width: max-content !important;  /* Box ko text ke barabar failayega */
    min-width: unset !important;    /* Kisi bhi purani limit ko khatam karega */
    max-width: unset !important;    /* Agar kahin max-width 20px set hai toh usey hatayega */
    text-overflow: clip !important; /* "..." wala system band karega */
    overflow: visible !important;   /* Box ke bahar text ko nikalne dega */
    
    /* Transition (Optional) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}

/* Hover Logic */
.sidebar.collapsed [data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Header */
.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #000000; /* Blue se Black kar diya */
    font-size: 22px;
    font-weight: 800;
}

.menu-icon {
    font-size: 22px;
    cursor: pointer;
}

/* New Chat */
/* New Chat */
.new-chat-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 30px;
    box-shadow: 0 6px 18px rgba(66, 42, 251, 0.15);
    transition: 0.2s;
}

.new-chat-btn:hover {
    background: var(--primary-hover);
}

/* Icon size badhane ke liye ye add kiya */
.new-chat-btn i {
    font-size: 22px !important;
    font-weight: 700 !important;
}

/* Primary Color for New Chat Icon Box */
.sidebar.collapsed .new-chat-btn {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: none;
}

/* Footer icons box color fix */
.sidebar.collapsed .footer-nav a {
    background: transparent; /* Settings icon clear background par */
    border: 1px solid var(--border);
}

.sidebar.collapsed .new-chat-btn i {
    font-size: 22px;
}

.sidebar.collapsed .new-chat-btn .btn-text {
    display: none;
}

/* Recent */
.section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    padding-left: 4px;
}

/* Dynamic container jisme saari chats load hoti hain */
.nav-section {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin-right: -20px; 
    padding-right: 14px; 
    display: flex;
    flex-direction: column;
    gap: 4px;
    
    /* THE REAL FIX: Yeh chats ko niche ke elements ko push karne se rokega */
    max-height: calc(100vh - 340px) !important; 
}

/* Sleek Minimal Scrollbar - Ekdum corner wall layout */
.nav-section::-webkit-scrollbar {
    width: 4px !important;
}

.nav-section::-webkit-scrollbar-track {
    background: transparent !important;
}

.nav-section::-webkit-scrollbar-thumb {
    background: #e2e8f0 !important;
    border-radius: 10px !important;
}

body.dark-theme .nav-section::-webkit-scrollbar-thumb {
    background: #2d3142 !important;
}

/* Node layout for each Chat Item (Flat row design like Image 2) */
.dynamic-chat-node {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Icon/Text on left, Three-Dots on absolute right */
    padding: 10px 14px !important;
    border-radius: 10px !important;
    background: transparent !important; 
    border: none !important;
    transition: background 0.2s ease;
    width: 100% !important;
    cursor: pointer;
}

/* Hover dynamic rows background tint layout match */
.dynamic-chat-node:hover,
.dynamic-chat-node.active-chat-accent {
    background: #eceff8 !important; 
}

body.dark-theme .dynamic-chat-node:hover,
body.dark-theme .dynamic-chat-node.active-chat-accent {
    background: #1c2030 !important;
}

/* Internal Row Text layout boundaries */
.chat-node-left-group {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex: 1;
}

.chat-title-truncate {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

body.dark-theme .chat-title-truncate {
    color: #f3f4f6;
}

/* Three Dots Context Trigger Button (Only visible on Row Hover) */
.action-dots-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.dynamic-chat-node:hover .action-dots-menu {
    opacity: 1;
    pointer-events: auto;
}

.action-dots-menu:hover {
    color: var(--primary);
}

/* Secondary meta tracking for absolute time placement */
.session-time-text {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    margin-top: 1px;
}

/* Action Group Buttons (Rename & Delete Animations) */
.action-buttons-group i {
    transition: all 0.2s ease-in-out;
}

.action-buttons-group i:hover {
    transform: scale(1.15);
}

/* Action dropdown menu wrapper visibility handles */
.dynamic-chat-node .action-dots-menu {
    opacity: 0;
    color: #9ca3af;
    transition: opacity 0.15s ease, color 0.15s ease;
    cursor: pointer;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Show icons seamlessly on full item layout hover */
.dynamic-chat-node:hover .action-dots-menu {
    opacity: 1;
}

.dynamic-chat-node .action-dots-menu:hover {
    color: var(--primary);
}

/* PRO CARD */
.pro-card {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    padding: 14px;       /* Padding kam ki */
    margin-bottom: 20px;
}

.pro-header {
    display: flex;
    gap: 8px;
    color: var(--primary);
    margin-bottom: 8px;
}

.pro-card p {
    font-size: 11px;     /* Thoda chota text */
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.upgrade-action {
    width: 100%;
    padding: 10px;
    background: white;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}

/* Footer */
.footer-nav {
    margin-top: 20px;
}

.footer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    margin-bottom: 12px; /* 16px se 12px kiya */
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--primary);
}

/* ================= MAIN ================= */

.main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top */
.top-nav {
    padding: 15px 30px;
    display: flex;
    justify-content: flex-end;
    border-bottom: none !important; /* Isse wo line gayab ho jayegi */
    background: transparent; /* Background clean rakhne ke liye */
}

.auth-btn {
    background: #ffffff;        /* Shuddh safed background */
    color: #422afb;             /* Video word wala blue color */
    border: 1px solid #e5e7eb;  /* Halka gray border */
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;           /* Medium bold semi-bold look */
    border-radius: 50px;        /* Full rounded pill shape jaisa image mein hai */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02); /* Bahut halki shadow */
}

/* Hover karne par halka sa change */
.auth-btn:hover {
    background: #f9fafb;        /* Halka sa gray tint */
    border-color: #422afb;      /* Border blue ho jayegi */
    transform: translateY(-1px);
}

/* Center */
.viewport-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start !important; /* Content top se shuru hoga */
    padding-top: 10px; /* Thoda sa gap top nav se */
    height: 100%;
}

/* Hero */
.hero-block {
    text-align: center;
    margin-top: 60px; /* Thoda upar aur shift kiya balance ke liye */
    padding: 0 20px;
}

.hero-block h1 {
    font-size: 45px; /* Professional standard size */
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* Isse "Video" word blue ho jayega */
.hero-block h1 span {
    color: var(--primary) !important;
}

.hero-block p {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 15px; /* Thoda chota aur clean */
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* ================= INPUT ================= */
.input-zone {
    position: absolute;
    bottom: 0;
    width: 70%; /* width lega */
    display: flex; /* Flexbox activate kiya */
    flex-direction: column; /* Content upar niche rahega */
    align-items: center; /* Horizontally center karega */
    padding: 20px 20px 40px 20px;
    background: linear-gradient(transparent, white 45%);
    z-index: 100;
}

/* tags */
.tag-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}

.tag-row button {
    background: #f5f3ff;
    border: 1px solid #e0e7ff;
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
}

.tag-row button:hover {
    background: var(--primary);
    color: white;
}

/* input */
.search-bar-wrapper {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 20px; /* Thoda kam rounded */
    padding: 8px 14px;   /* Padding kam ki gayi */
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    transition: 0.3s;
    width: 100%;
    max-width: 750px;    /* 850px se kam karke 750px kiya */
}

.search-bar-wrapper:focus-within {
    border-color: #422afb;
    box-shadow: 0 0 0 3px rgba(66, 42, 251, 0.12);
}

.search-bar-wrapper i#input-icon {
    font-size: 22px;
    color: #6366f1;
}

.search-bar-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;     /* Font size balance kiya */
    font-weight: 500;
    color: #111827;
    background: transparent;
}

.send-arrow-btn {
    width: 40px;         /* 48px se kam kiya */
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #422afb, #6a5cff);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-arrow-btn:hover {
    transform: scale(1.05);
}

/* privacy */
.privacy-footer {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 12px;
    width: 100%;
}

/* ================= VIDEO ================= */

.analysis-block {
    width: 100%;
    max-width: 950px; /* Readable wide width */
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* ================= VIDEO BANNER FIX ================= */

/* MAIN UTILITY WRAPPER: Jo pure banner aur button ko hold karega */
.video-info-banner {
    margin-top: 0 !important;
    margin-bottom: 20px;
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    border: 1px solid #eef2ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    z-index: 10;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inside Elements Layout */
.video-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    overflow: hidden;
}

.video-info-banner img {
    width: 160px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.v-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.v-details h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.v-details p {
    font-size: 13px;
    color: #64748b;
}

/* Premium Rounded Caret Button */
.banner-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9; 
    border: 1px solid #e2e8f0;
    color: #4b5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 15px;
}

.banner-toggle-btn:hover {
    background: #e2e8f0;
    color: #4f46e5;
    transform: scale(1.05);
}

.banner-toggle-btn i {
    font-size: 20px;
    transition: transform 0.25s ease; 
}

/* ================= COLLAPSED ACTIVE STATE OVERRIDES ================= */

/* Jab JS se 'collapsed-active' milegi tab background aur borders vanish honge */
.video-info-banner.collapsed-active {
    background: transparent !important;
    border: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 10px;
    justify-content: center; /* Button pure workspace ke horizontal center me float karega */
}

/* Left elements completely workflow se hide honge taaki tags aur chats upar shift ho sakein */
.video-info-banner.collapsed-active .video-banner-left {
    display: none !important;
}

.video-info-banner.collapsed-active .banner-toggle-btn {
    margin-left: 0 !important;
}

/* Caret Icon rotation handled cleanly */
.video-info-banner.collapsed-active #toggle-arrow-icon {
    transform: rotate(180deg); 
}

/* Sidebar Profile Footer */
.user-profile-footer {
    width: 100%;
    margin-top: auto; 
    padding: 12px 0;
    flex-shrink: 0; /* Isse profile card pichkega nahi */
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: #4411ff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.details .name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.details .email {
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all; /* Badi email wrap ho jayegi */
    max-width: 160px;
}

/* Upgrade Pro Button (Top Right) */
.upgrade-pro-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* ========================================================
   💥 CHAT SCROLLBAR EXTREME RIGHT EDGE COUPLING FIX 💥
======================================================== */

/* 1. Main viewport aur view block ki right padding completely zero */
.main-view, 
.viewport-container,
.analysis-block {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

/* 2. Chat flow container ko window ke ekdam last border se touch karne ke liye */
.chat-flow {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 220px);
    
    /* Content text right side me scrollbar ke neeche na dabe, isliye right padding yahan balance ki */
    padding: 20px 30px 150px 30px !important; 
    
    margin-right: 0 !important;
    overflow-y: auto !important;
    scroll-behavior: smooth;
}

/* 3. Custom Premium Scrollbar Danda (Extreme Right Wall Boundary) */
.chat-flow::-webkit-scrollbar {
    width: 6px !important; /* Elegant thin design */
}

.chat-flow::-webkit-scrollbar-track {
    background: transparent !important; /* Background transparent rahega */
}

.chat-flow::-webkit-scrollbar-thumb {
    background: rgba(66, 42, 251, 0.2) !important; /* Premium Accent Color */
    border-radius: 10px !important;
    transition: background 0.2s ease;
}

.chat-flow::-webkit-scrollbar-thumb:hover {
    background: rgba(66, 42, 251, 0.5) !important;
}

/* 4. Dark Theme support code override */
body.dark-theme .chat-flow::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12) !important;
}
body.dark-theme .chat-flow::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* ================= CHAT ================= */

.message {
    width: 100%;
    display: flex;
    margin-bottom: 24px !important; /* Balanced gap between streams */
}

.user-msg {
    justify-content: flex-end;
}

.bot-msg {
    justify-content: flex-start;
}

/* 🌟 Wrapper to hold Bubble Text + Absolute Positioned Buttons */
.msg-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 70%; /* ChatGPT Standard Max Boundary */
    position: relative;
}

.bot-msg .msg-bubble-wrapper {
    max-width: 85%;
    width: 100%;
}

.msg-bubble {
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.6;
    border-radius: 18px;
    word-wrap: break-word;
}

/* 🤖 Bot Bubble Reset */
.bot-msg .msg-bubble {
    background: transparent;
    color: #1f2937;
    border: none;
    width: 100%;
    padding-left: 0;
}

/* 👤 User Bubble: Width Fix & Height Expand (ChatGPT Style Match) */
.user-msg .msg-bubble {
    background: #f4f4f9;
    color: #000000;
    border-radius: 18px 18px 4px 18px; /* Smooth professional fold */
    width: fit-content; /* Force capsule constraint matching text size */
    margin-left: auto;  /* Absolute right-side sticking alignment */
    padding-bottom: 36px; /* Space cushion at bottom for premium action buttons */
}

.msg-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ========================================================
   🛠️ RE-DESIGNED ACTION BUTTONS (REAL & ULTRA PREMIUM)
======================================================== */

/* General Controller Layout for Rows */
.msg-action-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0; /* Hidden by default - Sleek entry hover utility */
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reveal action buttons smoothly on hover over message container */
.msg-bubble-wrapper:hover .msg-action-bar {
    opacity: 1;
}

/* 🎯 USER ACTIONS: Placed inside prompt bubble at bottom right */
.user-actions {
    position: absolute;
    bottom: 6px;
    right: 10px;
    z-index: 10;
}

/* 🤖 BOT ACTIONS: Placed cleanly below the response text */
.bot-actions {
    margin-top: 6px;
    padding-left: 2px;
}

/* Premium Mini Utility Buttons Styling */
.action-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 15px;
    transition: all 0.15s ease;
}

/* Premium Light Theme Hover Highlight */
.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

/* Action Active/Clicked Highlight Triggers */
.action-btn.active-state {
    color: var(--primary) !important;
}

/*/ Blur effect add karne ke liye/*/
/* Jab modal open ho tab landing page ko blur karne ke liye */

#modal-injection-point {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none; /* Shuru me hidden */
}

/* --- CHAT WINDOW PREMIUM SCROLLBAR DANDA (UPDATED) --- */
.chat-flow {
    /* Layout ko bina hilae dande ko halka sa aur right edge ki taraf shift karne ke liye */
    margin-right: -10px !important; 
    padding-right: 42px !important; /* Taaki text dande ke peeche na dabe */
    overflow-y: auto !important;
}

.chat-flow::-webkit-scrollbar {
    width: 7px !important; /* 8px se 5px kar diya hai, ab thoda aur slim aur premium dikhega */
}

.chat-flow::-webkit-scrollbar-track {
    background: transparent !important; 
}

.chat-flow::-webkit-scrollbar-thumb {
    background: rgba(66, 42, 251, 0.22) !important; 
    border-radius: 10px !important;
    transition: background 0.2s ease;
}

.chat-flow::-webkit-scrollbar-thumb:hover {
    background: rgba(66, 42, 251, 0.52) !important; 
}

/* Sidebar collapse hone par naye dynamic chats sections ko completely hide karne ke liye */
.sidebar.collapsed .nav-section {
    display: none !important;
}

/* ========================================================
   📥 BOT ACTION MORE MENU DROPDOWN (PDF/DOCX)
======================================================== */

/* Dropdown Parent Context Adjuster */
.bot-actions {
    position: relative; /* Anchor for the pop-up menu */
}

/* Premium Floating Pop-up Card style matching image_874721.png */
.bot-more-dropdown {
    position: absolute;
    top: 110%; /* Just below the three-dots button */
    left: 64px; /* Perfectly aligned to pop up under/beside the dots */
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 6px;
    z-index: 1000;
    display: none; /* Controlled via JS toggles */
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
    animation: dropScaleEntry 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropScaleEntry {
    from { opacity: 0; transform: translateY(-5px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Individual Dropdown row options */
.bot-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    color: var(--text-dark);
}

/* Soft Hover effect */
.bot-dropdown-item:hover {
    background: #f1f5f9;
}

/* Specialized Brand Icon Branding Colors */
.bot-dropdown-item i.ph-file-pdf {
    color: #ef4444; /* Premium Adobe PDF Red */
    font-size: 17px;
}

.bot-dropdown-item i.ph-file-doc {
    color: #1a73e8; /* Classic Word/Docs Blue */
    font-size: 17px;
}

/* ========================================================
   🌙 DARK THEME COMPATIBILITY FOR BOT DROPDOWN
======================================================== */
body.dark-theme .bot-more-dropdown {
    background: #161925 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .bot-dropdown-item {
    color: #d1d5db !important;
}

body.dark-theme .bot-dropdown-item:hover {
    background: #24293e !important;
}

 /* code bas yahi tak hai neeche ka function dark theme ke liye hai*/

 
 /* =======================================================================
                                DARK THEME START                          
    =======================================================================*/
 

/* ==========================================================================
   LINKGPT PREMIUM DARK THEME CONTROLS (OVERRIDE)
   ========================================================================== */

/* ================= CONTEXT DROPDOWN OVERLAY MGR ================= */
.chat-context-dropdown {
    position: absolute;
    right: 10px;
    top: 40px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    padding: 6px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}

body.dark-theme .chat-context-dropdown {
    background: #161925;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dropdown-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #374151;
}

body.dark-theme .dropdown-action-item {
    color: #d1d5db;
}

.dropdown-action-item:hover {
    background: #f1f5f9;
}

body.dark-theme .dropdown-action-item:hover {
    background: #24293e;
}

/* Delete dynamic specific tracking danger state */
.dropdown-action-item.delete-action {
    color: #ef4444;
}

.dropdown-action-item.delete-action:hover {
    background: #fef2f2;
}

body.dark-theme .dropdown-action-item.delete-action:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Root variables update for Dark Theme */
body.dark-theme {
    background: #0f111a !important; /* Premium pitch dark layout background */
    color: #f3f4f6 !important;
}

/* Sidebar Dark Adjustments */
body.dark-theme .sidebar {
    background: #151824 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body.dark-theme .logo {
    color: #ffffff !important;
}

body.dark-theme .recent-item {
    background: #1c2030 !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #9ca3af !important;
}

body.dark-theme .footer-nav a {
    color: #9ca3af !important;
}
body.dark-theme .footer-nav a:hover {
    color: #422afb !important;
}

/* Auth Button Fix for Top Nav in Dark Mode */
body.dark-theme .auth-btn {
    background: #1c2030 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
body.dark-theme .auth-btn:hover {
    background: #24293e !important;
    border-color: #422afb !important;
}

/* ================= INPUT ZONE & PROMPT BOX DARK EFFECT ================= */

/* Input zone parent background gradient fix */
body.dark-theme .input-zone {
    background: linear-gradient(transparent, #0f111a 45%) !important;
}

/* Premium Glassmorphic / Matte Capsule Search Bar (YouTube Box) */
body.dark-theme .search-bar-wrapper {
    background: #161925 !important; /* Premium Matte Deep Slate */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02) !important;
}

/* Glow Border Effect on Focus */
body.dark-theme .search-bar-wrapper:focus-within {
    border-color: #422afb !important;
    box-shadow: 0 0 0 3px rgba(66, 42, 251, 0.25), 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

/* Dynamic Input text styling */
body.dark-theme .search-bar-wrapper input {
    color: #ffffff !important;
}
body.dark-theme .search-bar-wrapper input::placeholder {
    color: #4b5563 !important; /* Muted sleek placeholder */
}

/* Icon adjustments inside search input */
body.dark-theme .search-bar-wrapper i#input-icon {
    color: #422afb !important; /* Main accent branding color */
}

/* Dynamic Sidebar Row Muted Icons Fix in Dark Mode */
body.dark-theme .action-buttons-group i {
    color: #4b5563 !important; /* Subtle gray inside dark mode nodes */
}

/* Privacy Text below box */
body.dark-theme .privacy-footer {
    color: #4b5563 !important;
}

/* ================= QUICK PROMPT CHAT TAGS DIALOGS ================= */

/* Quick Action Suggestion Buttons (Summarize, Key Takeaways, etc.) */
body.dark-theme .tag-row button,
body.dark-theme .quick-prompt-tag {
    background: rgba(66, 42, 251, 0.08) !important; /* Subdued subtle blue tint */
    border: 1px solid rgba(66, 42, 251, 0.2) !important;
    color: #818cf8 !important; /* Bright accessible indigo text */
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

body.dark-theme .tag-row button:hover,
body.dark-theme .quick-prompt-tag:hover {
    background: #422afb !important;
    border-color: #422afb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(66, 42, 251, 0.3) !important;
}

/* ================= ANALYSIS SECTION / CONTEXT SUMMARY AREA ================= */

/* Video Preview Banner Fix */
body.dark-theme .video-info-banner {
    background: #161925 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .v-details h2 {
    color: #ffffff !important;
}

body.dark-theme .v-details p {
    color: #9ca3af !important;
}

/* Chat flow text and context data formatting */
body.dark-theme .bot-msg .msg-bubble {
    color: #e5e7eb !important; /* Perfect contrast for user readability */
}

body.dark-theme .user-msg .msg-bubble {
    background: #1c2030 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    width: fit-content !important; /* Keep capsule width intact in dark mode */
    margin-left: auto !important;
}

/* 🌟 DARK MODE HOVER HIGHLIGHTS FOR PREMIUM ACTION BUTTONS */
body.dark-theme .action-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

body.dark-theme .action-btn.active-state {
    color: #818cf8 !important; /* Elegant indigo active state under dark mode */
}

/* Dark Mode Control overrides for video collapse system */
body.dark-theme .banner-toggle-btn {
    background: #1c2030 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #9ca3af !important;
}

body.dark-theme .banner-toggle-btn:hover {
    background: rgba(66, 42, 251, 0.2) !important;
    color: #ffffff !important;
}

body.dark-theme .video-info-banner.collapsed-state {
    background: #161925 !important;
}

/* 🚨 PREMIUM DAFK MODE RECENT CHATS - YOUTUBE ICON OVERRIDE */
.dark-theme .recent-chats i.ph-youtube-logo,
.dark-theme [class*="recent"] i[class*="youtube"] {
    color: #ff0000 !important;          /* Core Brand Red Layer */
    background: #ffffff !important;       /* Inner Play Button Perfect White Mask */
    border-radius: 4px !important;       /* Balanced Border Smooth Corners */
    filter: none !important;             /* Anti-inversion core layer lock */
    opacity: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px #ffffff !important; /* Fixes microscopic edge bleed lines */
}

/* Phosphor Fill Mode Handle Grid Fix */
.dark-theme .recent-chats i.ph-fill.ph-youtube-logo::before {
    color: #ff0000 !important;
}

/* ==========================================================================
   💥 ULTRA OMNI-LOCK: PREMIUM LINKGPT BLUE BACKGROUND (LIGHT & DARK)
   ========================================================================== */

/* 1. LIGHT MODE: Sabhi tarah ke active selectors ko target karo */
.nav-section .dynamic-chat-node.active-chat-accent,
.nav-section .dynamic-chat-node.active,
.nav-section .dynamic-chat-node.selected,
.dynamic-chat-node[class*="active"],
.dynamic-chat-node[class*="selected"] {
    background: rgba(66, 42, 251, 0.1) !important; /* Premium light blue tint */
    background-color: rgba(66, 42, 251, 0.1) !important;
    border: 1px solid rgba(66, 42, 251, 0.25) !important; /* Clear brand stroke */
}

/* Light Mode Text & Icons Rang */
.nav-section .dynamic-chat-node.active-chat-accent *,
.nav-section .dynamic-chat-node.active *,
.nav-section .dynamic-chat-node.selected *,
.dynamic-chat-node[class*="active"] *,
.dynamic-chat-node[class*="selected"] * {
    color: #422afb !important; /* Pure Brand Blue text & icon color */
    font-weight: 600 !important;
}

/* 2. DARK MODE: Sabhi tarah ke active selectors ko target karo */
body.dark-theme .nav-section .dynamic-chat-node.active-chat-accent,
body.dark-theme .nav-section .dynamic-chat-node.active,
body.dark-theme .nav-section .dynamic-chat-node.selected,
body.dark-theme .dynamic-chat-node[class*="active"],
body.dark-theme .dynamic-chat-node[class*="selected"] {
    background: rgba(66, 42, 251, 0.18) !important; /* Glowing matte blue shade */
    background-color: rgba(66, 42, 251, 0.18) !important;
    border: 1px solid rgba(66, 42, 251, 0.4) !important;
}

/* Dark Mode Text & Icons Rang */
body.dark-theme .nav-section .dynamic-chat-node.active-chat-accent *,
body.dark-theme .nav-section .dynamic-chat-node.active *,
body.dark-theme .nav-section .dynamic-chat-node.selected *,
body.dark-theme .dynamic-chat-node[class*="active"] *,
body.dark-theme .dynamic-chat-node[class*="selected"] * {
    color: #6a5cff !important; /* Vibrant indigo text/icons on dark surface */
    font-weight: 600 !important;
}

/* 3. HOVER STABILITY */
.dynamic-chat-node:hover {
    background: #eceff8 !important;
}
body.dark-theme .dynamic-chat-node:hover {
    background: #1c2030 !important;
}
/* ✅ Active box ke andar YouTube logo ko wapas brand red aur text ko dark rakhne ke liye */
.nav-section .dynamic-chat-node.active-chat-accent i.ph-youtube-logo {
    color: #ef4444 !important;
}

.nav-section .dynamic-chat-node.active-chat-accent .session-title-text {
    color: #374151 !important;
    font-weight: 500 !important;
}

/* ==========================================================================
   📱 LINKGPT MOBILE ENGINE (Preserving Original HTML Structure & Fixed Chat UI)
   ========================================================================== */

.mobile-header {
    display: none !important;
}

@media (max-width: 768px) {
    html, body {
        overflow: hidden !important;
        width: 100% !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .app-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        overflow: hidden !important;
        position: relative !important;
    }

    /* Kill Desktop Layout Rules on Mobile */
    .top-nav, .sidebar-toggle, .desktop-only, .video-info-banner-desktop {
        display: none !important;
    }

    /* Mobile Header Fixed Top */
    .mobile-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        height: 56px !important;
        padding: 0 16px !important;
        background: #ffffff !important;
        border-bottom: 1px solid #f3f4f6 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1000 !important;
    }

    .header-left {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    #mobile-menu-btn {
        font-size: 24px !important;
        color: #111827 !important;
        cursor: pointer !important;
        background: transparent !important;
        border: none !important;
        display: flex !important;
        align-items: center;
    }

    .mobile-app-title {
        font-size: 19px !important;
        font-weight: 800 !important;
        color: #000000 !important;
        letter-spacing: -0.5px !important;
    }

    .mobile-header-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .mobile-auth-btn, .mobile-upgrade-btn {
        background: #422afb !important;
        color: #ffffff !important;
        border: none !important;
        padding: 8px 16px !important;
        border-radius: 50px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
    }

    /* Workspace Framing */
    .main-view {
        width: 100vw !important;
        height: calc(100vh - 56px) !important;
        margin-top: 56px !important; 
        padding: 0 !important;
        margin-left: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        background: #ffffff !important;
        overflow: hidden !important;
        position: relative !important;
        flex: 1 !important;
    }

    .viewport-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        position: relative !important;
    }

    /* THE ORIGINAL CHAT UI CONTAINER AS FLEX-COLUMN */
    #chat-ui.analysis-block {
        flex: 1 !important;
        width: 100% !important;
        display: none !important; /* Managed by JS */
        flex-direction: column !important;
        overflow: hidden !important;
        position: relative !important;
    }

    body.video-active #chat-ui.analysis-block {
        display: flex !important;
    }

    /* DYNAMIC ACTIVE BANNER ENGINE */
    #chat-ui .video-info-banner, #video-banner {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        
        height: 58px !important;
        min-height: 58px !important;
        align-items: center !important;
        justify-content: space-between !important;
        
        margin: 12px 16px 4px 16px !important; 
        padding: 8px 12px !important;
        background: #f9fafb !important; 
        border-radius: 12px !important;
        border: 1px solid #f3f4f6 !important;
        width: calc(100% - 32px) !important;
        flex-shrink: 0 !important;
        z-index: 110 !important;
    }

    /* Collapsed state modifier for mobile */
    #chat-ui .video-info-banner.collapsed {
        height: 16px !important;
        min-height: 16px !important;
        padding: 0 12px !important;
        background: #f3f4f6 !important;
    }
    #chat-ui .video-info-banner.collapsed .video-banner-left {
        display: none !important;
    }

    .video-banner-left {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: calc(100% - 30px) !important;
        background: transparent !important;
    }

    #v-thumb {
        display: block !important;
        width: 46px !important;
        height: 32px !important;
        object-fit: cover !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }

    .v-details {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        overflow: hidden !important;
    }

    #v-title {
        display: block !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        color: #111827 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #v-source {
        display: block !important;
        font-size: 11px !important;
        color: #9ca3af !important;
        margin: 1px 0 0 0 !important;
    }

    .banner-toggle-btn {
        background: transparent !important;
        border: none !important;
        color: #6b7280 !important;
        font-size: 18px !important;
        cursor: pointer !important;
    }

    /* Messages Scroll Frame */
    #chat-messages {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 12px 16px 110px 16px !important; /* 🔥 Changed: Adjusted padding for perfect prompt-boundary scroll */
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        background: #ffffff !important;
        width: 100% !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;
    }

    #chat-messages .message {
        font-size: 14.5px !important;
        line-height: 1.5 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }

    /* ==========================================================================
       🎯 FIX 1: USER PROMPT BUBBLE RIGHT ALIGNMENT & DYNAMIC WIDTH
       ========================================================================== */
    #chat-messages .message.user-msg {
        align-items: flex-end !important;   /* Andar ke content wrapper ko right push karega */
        align-self: flex-end !important;    /* Pure flex row element ko display right boundary par lock karega */
        background: transparent !important;  
        padding: 0 !important;
    }

    /* Dynamic context capsule selection rules */
    #chat-messages .message.user-msg .msg-text,
    #chat-messages .message.user-msg > div:not(.message-actions) {
        display: inline-block !important;
        width: -webkit-fit-content !important;
        width: -moz-fit-content !important;
        width: fit-content !important;      /* 🔥 Jitna text sirf utna hi space capsulation scale hoga */
        max-width: 78% !important;          /* 78% of mobile viewport horizontal wrap anchor */
        text-align: left !important;
        
        background: #f3f4f6 !important;     /* Clean standard chatbot dynamic box color */
        color: #111827 !important;
        padding: 10px 16px !important;
        border-radius: 18px 18px 4px 18px !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        word-break: normal !important;
        white-space: normal !important;
    }

    /* ==========================================================================
       🎯 FIX 2: BOT MSG STYLING & ICONS POSITIONED AT BOTTOM LEFT
       ========================================================================== */
    #chat-messages .message.bot-msg {
        align-items: flex-start !important; /* Content columns start always from standard left side */
        align-self: flex-start !important;
        background: transparent !important;
        color: #111827 !important;
        padding: 0 !important;
    }

    /* Target bot text container layout */
    #chat-messages .message.bot-msg .msg-text,
    #chat-messages .message.bot-msg > div:not(.message-actions) {
        width: 100% !important;
        max-width: 90% !important;
        text-align: left !important;
        white-space: normal !important;
    }

    /* 🚨 Target elements housing those 2 icons (Dynamic action anchors) */
    #chat-messages .message .message-actions,
    #chat-messages .message.bot-msg .message-actions,
    #chat-messages .message .actions-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important; /* Force icons to align completely to the Left side */
        
        width: 100% !important;
        margin-top: 6px !important;             /* Text khatam hone ke baad thoda sa space dekar niche layega */
        padding-left: 2px !important;           /* Smooth structural alignment from left track */
        gap: 8px !important;                    /* Spacing between the two action icons */
        background: transparent !important;
    }

    /* Make sure individual action buttons / icons match beautifully */
    #chat-messages .message-actions button,
    #chat-messages .message-actions i {
        background: transparent !important;
        color: #9ca3af !important;             /* Professional light grey minimal icon tone */
        font-size: 16px !important;
        border: none !important;
        cursor: pointer !important;
    }

    /* USER PROMPT AREA: STRICT CONTEXT HEIGHT & WIDTH LOCK */
    .input-zone {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        padding: 8px 16px 16px 16px !important; 
        margin: 0 !important;
        height: auto !important;
        min-height: unset !important;
        max-height: 160px !important; 
        background: transparent !important; /* 🔥 Changed: Transparent background to let buttons float freely */
        z-index: 100 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        border: none !important;
        border-top: none !important; 
        box-shadow: none !important; 
    }

    /* Quick Tags Row Frame */
    .tag-row, #quick-tags {
        display: none !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        gap: 6px !important;
        width: 100% !important;
        padding: 4px 0 !important;
        margin-bottom: 2px !important;
        border: none !important;
        scrollbar-width: none !important;
    }

    .tag-row::-webkit-scrollbar, 
    #quick-tags::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    body.video-active .tag-row, 
    body.video-active #quick-tags {
        display: flex !important;
    }

    .tag-row button, #quick-tags button {
        background: #ffffff !important;
        color: #4b5563 !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 24px !important;
        font-size: 13px !important;
        padding: 5px 12px !important;
        flex-shrink: 0 !important;
    }

    /* WRAPPER: Force strictly compact size */
    .search-bar-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: 44px !important; 
        min-height: 44px !important;
        max-height: 44px !important;
        background: #f3f4f6 !important;
        border: none !important;
        border-radius: 24px !important;
        display: flex !important;
        align-items: center !important;
        padding: 0 4px 0 16px !important;
        box-shadow: none !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        position: relative !important; /* 🔥 Changed: Required to anchor the bottom cover */
    }

    /* 🔥 NEW: This creates the solid cover starting EXACTLY from the prompt box to the bottom */
    .search-bar-wrapper::before {
        content: "" !important;
        position: absolute !important;
        top: 0 !important; /* Fixed: Perfectly aligned with prompt bar top */
        left: -16px !important;
        right: -16px !important;
        bottom: -100px !important; /* Stretches completely to the bottom edge */
        background: #ffffff !important; /* Matches your core background */
        z-index: -1 !important;
        border-top: none !important; /* 🔥 Fixed: Removed the line that was flashing */
        box-shadow: none !important; /* 🔥 Fixed: Removed the separate shadow */
    }

    /* CRITICAL TARGET: Kills the JS inline-height stretching on mobile */
    .search-bar-wrapper input,
    .search-bar-wrapper textarea,
    #user-input {
        font-size: 14px !important;
        height: 24px !important; 
        min-height: 24px !important;
        max-height: 24px !important;
        line-height: 24px !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 1 !important;
        min-width: 0 !important; 
        border: none !important;
        outline: none !important;
        background: transparent !important;
        color: #111827 !important;
        resize: none !important;
    }

    /* ARROW BUTTON COMPACT FIT */
    .send-arrow-btn {
        width: 34px !important;
        height: 34px !important;
        border-radius: 50% !important;
        background: #422afb !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        flex-shrink: 0 !important;
    }

    /* PRIVACY FOOTER */
    .privacy-footer, #privacy-note {
        font-size: 11px !important;
        color: #9ca3af !important;
        text-align: center !important;
        margin: 2px 0 0 0 !important; 
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        line-height: 1.1 !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -105% !important; 
        width: 82% !important;
        max-width: 295px !important;
        height: 100vh !important;
        background: #ffffff !important;
        z-index: 2000 !important; 
        transition: left 0.25s ease !important;
        /* 🔥 FIX: Sirf height aur safe padding control ki hai, no flex, no layout breaking! */
        height: 100dvh !important; /* Mobile browser ke nav-bar ke piche icons ko dabne se rokega */
        box-sizing: border-box !important;
        
        /* iPhone aur Android dono par bottom icons ko safe area se perfect spacing dega */
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .sidebar.open {
        left: 0 !important;
    }

/* 1. Base Body & Workspace Viewport Dark Force */
    body.dark-theme {
        background: #0b0d14 !important; /* Premium deep dark background */
        color: #f3f4f6 !important;
    }

    body.dark-theme .app-container,
    body.dark-theme .main-view,
    body.dark-theme #landing-ui,
    body.dark-theme #chat-messages {
        background: #0b0d14 !important;
    }

    /* 2. Mobile Fixed Header Dark Fix */
    body.dark-theme .mobile-header {
        background: #0b0d14 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    body.dark-theme .mobile-app-title {
        color: #ffffff !important;
    }

    body.dark-theme #mobile-menu-btn {
        color: #ffffff !important;
    }

    body.dark-theme .mobile-header .mobile-app-title span,
    body.dark-theme .mobile-app-title span,
    body.dark-theme .brand-logo span {
        color: #4f46e5 !important;                /* Exact deep vibrant brand purple from Upgrade button */
        background: transparent !important;       /* Purane kisi bhi background gradient ko hatane ke liye */
        -webkit-text-fill-color: #4f46e5 !important; /* Forcefully fills the text color overriding any clip-path */
        font-weight: 700 !important;
    }

    /* 3. Video Info Banner Dark Mode */
    body.dark-theme #chat-ui .video-info-banner, 
    body.dark-theme #video-banner {
        background: #11131f !important; /* Sleek elevated charcoal dark */
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    body.dark-theme #v-title {
        color: #ffffff !important;
    }

    body.dark-theme #v-source,
    body.dark-theme .banner-toggle-btn {
        color: #9ca3af !important;
    }

    /* 4. 🔥 FIXED: User Prompt Bubble (Kills the double border frame bug from Image 1) */
    body.dark-theme #chat-messages .message.user-msg .msg-text,
    body.dark-theme #chat-messages .message.user-msg > div:not(.message-actions) {
        background: #161824 !important; /* Exact premium slate-navy tone from Image 2 */
        color: #ffffff !important;      /* Crisp white text */
        border: none !important;         /* Explicitly kills light borders */
        box-shadow: none !important;     /* Removes any outer glowing shadows */
    }

    /* 5. 🔥 FIXED: Three Prompt Keywords / Quick Tags (Exact Image 2 Premium Style) */
    body.dark-theme .tag-row button, 
    body.dark-theme #quick-tags button,
    body.dark-theme .input-zone .tag-row button {
        background: #11131f !important; /* Solid dark blending pill background */
        color: #ffffff !important;      /* Crisp white keyword text */
        border: 1px solid rgba(255, 255, 255, 0.12) !important; /* Super fine elegant border */
        padding: 6px 16px !important;
        font-weight: 500 !important;
    }

    /* 6. Bottom Prompt Input Zone & Search Bar Wrapper */
    body.dark-theme .input-zone {
        background: transparent !important; 
        border-top: none !important;
        box-shadow: none !important;
    }

    body.dark-theme .search-bar-wrapper {
        background: #11131f !important; /* Perfectly matches tags and top banner */
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* Dark mode support for the prompt-to-bottom cover sheet */
    body.dark-theme .search-bar-wrapper::before {
        background: #0b0d14 !important;
        border-top: none !important; 
        box-shadow: none !important;
    }

    body.dark-theme .search-bar-wrapper input,
    body.dark-theme .search-bar-wrapper textarea,
    body.dark-theme #user-input {
        color: #ffffff !important;
        background: transparent !important;
    }

    /* Placeholder text visibility in dark mode */
    body.dark-theme #user-input::placeholder {
        color: #6b7280 !important;
    }

    /* 7. Landing Page Content Text Controls */
    body.dark-theme #landing-ui h1,
    body.dark-theme #landing-ui h2,
    body.dark-theme #landing-ui h3,
    body.dark-theme .landing-title,
    body.dark-theme .hero-text,
    body.dark-theme .brand-logo {
        color: #ffffff !important;
    }

    body.dark-theme #landing-ui p,
    body.dark-theme .landing-subtitle,
    body.dark-theme .hero-desc,
    body.dark-theme .feature-item-text {
        color: #9ca3af !important; 
    }

    /* Privacy layout footer notes adjust */
    body.dark-theme .privacy-footer, 
    body.dark-theme #privacy-note {
        color: #4b5563 !important;
        background: transparent !important;
    }
    
    /* Global tap overrides before media-query closing */
    button, 
    a, 
    .emoji-btn, 
    .fb-tag-btn {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
    }
}