/* ═══════════════════════════════════════════════════════════════
   VYOMA UI OVERRIDES v2.0 — Smart Agent Mode
   
   Hides:
   1. Model switcher (Auto/Lawyer/Commerce dropdown)
   2. File upload buttons & drag-drop
   3. Sidebar AGENTS section (logic stays, UI hidden)
   
   Adds:
   4. Comprehensive mobile responsiveness
   5. Agent panel mobile sheet behavior
   6. Explore Models agent popup styles
   
   All overlay elements remain in DOM for internal use.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. HIDE MODEL SWITCHER ──────────────────────────────── */
#gemini-mode-switcher,
.gemini-mode-switcher,
.gemini-mode-btn,
#gemini-mode-dropdown,
.gemini-mode-dropdown,
#gemini-mode-backdrop,
.gemini-mode-backdrop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ─── 2. HIDE FILE UPLOAD BUTTONS ──────────────────────────── */
.akira-upload-btn,
.akira-file-btn,
.akira-image-btn,
.akira-upload-zone,
.akira-dropzone,
.file-upload-trigger,
[class*="upload-btn"],
[class*="file-btn"],
[class*="image-btn"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.akira-drop-overlay,
.akira-drop-active,
[class*="drop-overlay"],
[class*="drag-active"] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.akira-preview-bar:empty {
    display: none !important;
}

/* ─── 3. HIDE SIDEBAR AGENTS SECTION ──────────────────────── */
/* Logic in agents.js is preserved; only the sidebar dropdown is hidden */
#va-agents-section,
.va-agents-section {
    display: none !important;
}

/* ─── 4. KEEP CHAT TITLE after removing mode switcher ──────── */
.header-left .chat-title {
    margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   5. EXPLORE MODELS — AGENT FEATURES POPUP
   Appears as a floating card inside the Explore Models page
   ═══════════════════════════════════════════════════════════════ */
.akm-agent-promo {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 8810;
    width: 340px;
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
    padding: 20px;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.akm-agent-promo.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.akm-agent-promo-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f0f0f3;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.akm-agent-promo-title svg {
    width: 16px;
    height: 16px;
    color: #a78bfa;
}

.akm-agent-promo-sub {
    font-size: 0.68rem;
    color: rgba(161, 161, 170, 0.45);
    margin-bottom: 14px;
}

.akm-agent-promo-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.akm-agent-promo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.akm-agent-promo-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.akm-agent-promo-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.akm-agent-promo-item-icon svg {
    width: 15px;
    height: 15px;
}

.akm-agent-promo-item-icon.gmail-ico {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}

.akm-agent-promo-item-icon.drive-ico {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
}

.akm-agent-promo-item-icon.cal-ico {
    background: rgba(129, 140, 248, 0.1);
    color: #818cf8;
}

.akm-agent-promo-item-text {
    font-size: 0.72rem;
    color: rgba(228, 228, 231, 0.6);
    line-height: 1.35;
}

.akm-agent-promo-item-text strong {
    display: block;
    color: #f0f0f3;
    font-size: 0.76rem;
    font-weight: 600;
    margin-bottom: 1px;
}

.akm-agent-promo-cta {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.akm-agent-promo-cta:hover {
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.akm-agent-promo-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 6px;
    color: rgba(161, 161, 170, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.akm-agent-promo-close svg {
    width: 12px;
    height: 12px;
}

.akm-agent-promo-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
}

/* ─── Coming Soon Agents List (under promo popup) ──────────── */
.akm-coming-soon-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.akm-coming-soon-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(168, 85, 247, 0.6);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.akm-coming-soon-label span {
    font-size: 0.72rem;
}

.akm-coming-soon-item {
    font-size: 0.68rem;
    color: rgba(161, 161, 170, 0.5);
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.akm-coming-soon-item::before {
    content: '•';
    color: rgba(168, 85, 247, 0.4);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════
   EXPLORE MODELS — COMING SOON BANNER
   (Blur is now handled by a LOCAL overlay div in JS — PATCH #2)
   No parent-level filter or pointer-events: none anywhere.
   ═══════════════════════════════════════════════════════════════ */

/* ─── COMING SOON BANNER ──────────────────────────────────── */
.vyoma-coming-soon-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 8830;
    max-width: 520px;
    width: 90%;
    padding: 36px 32px;
    border-radius: 24px;
    background: rgba(18, 18, 24, 0.96);
    backdrop-filter: blur(50px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 32px 100px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 80px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.vyoma-coming-soon-banner.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Banner gradient strip */
.vyoma-cs-gradient-bar {
    width: 60px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #3b82f6);
    background-size: 200% 100%;
    animation: vyomaGradShift 3s ease infinite;
    margin: 0 auto 20px;
}

@keyframes vyomaGradShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Emoji bounce */
.vyoma-cs-emoji {
    font-size: 2.2rem;
    display: inline-block;
    animation: vyomaBounce 2s ease-in-out infinite;
    margin-bottom: 12px;
}

@keyframes vyomaBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.vyoma-cs-title {
    font-size: 1.15rem;
    font-weight: 750;
    color: #f0f0f3;
    letter-spacing: -0.4px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #a78bfa, #818cf8, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vyoma-cs-desc {
    font-size: 0.82rem;
    color: rgba(161, 161, 170, 0.55);
    line-height: 1.55;
    max-width: 400px;
    margin: 0 auto 20px;
}

.vyoma-cs-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    font-size: 0.7rem;
    font-weight: 600;
    color: #818cf8;
}

.vyoma-cs-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #818cf8;
    animation: vyomaPulse 1.5s ease-in-out infinite;
}

@keyframes vyomaPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.vyoma-cs-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: rgba(161, 161, 170, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.vyoma-cs-close svg {
    width: 14px;
    height: 14px;
}

.vyoma-cs-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
}

/* ─── DISABLED MODEL CARDS ────────────────────────────────── */
.akm-card.vyoma-disabled {
    cursor: not-allowed !important;
    filter: grayscale(0.3);
    opacity: 0.55;
    pointer-events: auto;
}

.akm-card.vyoma-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--border) !important;
}

.akm-card.vyoma-disabled::before {
    opacity: 0 !important;
}

/* Tooltip for disabled cards */
.akm-card.vyoma-disabled::after {
    content: 'Coming Soon for Upgrade';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(18, 18, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a78bfa;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.akm-card.vyoma-disabled:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* Keep the active card visually distinct (still running) */
.akm-card.vyoma-disabled.active {
    filter: none;
    opacity: 0.8;
}

/* ─── Mobile Coming Soon banner ───────────────────────────── */
@media (max-width: 768px) {
    .vyoma-coming-soon-banner {
        width: 94%;
        max-width: none;
        padding: 28px 20px;
        border-radius: 20px;
    }

    .vyoma-cs-title {
        font-size: 1rem;
    }

    .vyoma-cs-desc {
        font-size: 0.78rem;
    }

    .vyoma-cs-emoji {
        font-size: 1.8rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   6. COMPREHENSIVE MOBILE RESPONSIVENESS
   ═══════════════════════════════════════════════════════════════ */

/* ─── Mobile < 768px ──────────────────────────────────────── */
@media (max-width: 768px) {

    /* Chat header sticky + compact */
    .main-header {
        position: sticky !important;
        top: 0;
        z-index: 100;
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .chat-title {
        font-size: 0.88rem !important;
    }

    .header-right {
        gap: 4px !important;
    }

    /* Messages area — full width, proper spacing */
    .messages {
        padding: 12px 10px 120px !important;
    }

    .message {
        max-width: 92% !important;
        margin-bottom: 6px !important;
    }

    .user-message {
        margin-left: auto !important;
    }

    .assistant-message {
        margin-right: auto !important;
    }

    /* Input bar — stretch to full width, fixed bottom */
    .input-bar {
        padding: 8px 10px !important;
        border-radius: 14px !important;
        margin: 0 8px 8px !important;
    }

    .input-wrapper textarea {
        font-size: 0.88rem !important;
        min-height: 40px !important;
    }

    /* Agent Panel — full-screen mobile sheet */
    .agent-panel-overlay {
        align-items: flex-end !important;
    }

    .agent-panel {
        width: 100% !important;
        max-width: 100% !important;
        height: 90vh !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
    }

    /* Agent Studio popup — full-screen on mobile */
    .agent-studio-modal {
        width: 100% !important;
        max-width: 100% !important;
        height: 92vh !important;
        max-height: 92vh !important;
        border-radius: 20px 20px 0 0 !important;
    }

    .agent-studio-grid {
        grid-template-columns: 1fr !important;
    }

    /* Agents Page — single column */
    .agents-page-grid {
        grid-template-columns: 1fr !important;
    }

    .agents-page {
        padding: 24px 16px 60px !important;
    }

    .agents-page-hero h1 {
        font-size: 1.3rem !important;
    }

    .agents-page-hero p {
        font-size: 0.82rem !important;
    }

    /* Agent Studio cards — bigger tap targets */
    .agent-studio-card {
        padding: 20px 18px !important;
    }

    .agent-card-btn {
        padding: 12px !important;
        font-size: 0.82rem !important;
    }

    .agent-showcase-btn {
        padding: 12px 20px !important;
        font-size: 0.82rem !important;
    }

    /* Explore Models — mobile friendly */
    .akm-topbar {
        flex-wrap: wrap;
        gap: 8px !important;
        padding: 10px 12px !important;
    }

    .akm-search-wrap {
        width: 100% !important;
        max-width: none !important;
        order: 10;
    }

    .akm-body {
        padding: 0 12px 32px !important;
    }

    .akm-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .akm-hero {
        padding: 24px 14px 8px !important;
    }

    .akm-hero h1 {
        font-size: 1.2rem !important;
    }

    /* Model detail -> full-screen sheet */
    .akm-detail {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    /* Agent promo popup — bottom sheet style */
    .akm-agent-promo {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%) !important;
    }

    .akm-agent-promo.visible {
        transform: translateY(0) !important;
    }

    /* Floating button — smaller on mobile */
    .agent-studio-float-btn {
        bottom: 16px !important;
        right: 16px !important;
        padding: 12px 18px !important;
        font-size: 0.78rem !important;
        border-radius: 14px !important;
    }

    /* Sidebar footer buttons */
    .sidebar-footer .settings-btn {
        padding: 8px 12px !important;
    }

    /* Gmail/Drive/Calendar command cards */
    .gc-card,
    .dc-card,
    .cc-card {
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* ─── Small phones < 480px ────────────────────────────────── */
@media (max-width: 480px) {
    .main-header {
        padding: 8px 10px !important;
    }

    .chat-title {
        font-size: 0.82rem !important;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .messages {
        padding: 8px 6px 110px !important;
    }

    .message {
        max-width: 96% !important;
        font-size: 0.84rem !important;
    }

    .input-bar {
        margin: 0 6px 6px !important;
        padding: 6px 8px !important;
    }

    /* Agent Showcase cards — extra padding */
    .agent-showcase-card {
        padding: 22px 18px !important;
    }

    .agent-showcase-name {
        font-size: 0.95rem !important;
    }

    .agent-showcase-features li {
        font-size: 0.78rem !important;
        padding: 6px 0 !important;
    }

    .agent-showcase-btn {
        padding: 14px 22px !important;
        font-size: 0.84rem !important;
    }

    /* Agent card icons bigger */
    .agent-card-icon-wrap,
    .agent-showcase-icon {
        width: 52px !important;
        height: 52px !important;
    }

    .agent-card-icon-wrap svg,
    .agent-showcase-icon svg {
        width: 24px !important;
        height: 24px !important;
    }

    .agents-page-hero h1 {
        font-size: 1.15rem !important;
    }

    .agents-page-hero p {
        font-size: 0.78rem !important;
    }
}

/* ─── Very small phones < 400px ───────────────────────────── */
@media (max-width: 400px) {
    .agents-page {
        padding: 20px 12px 50px !important;
    }

    .agent-showcase-card {
        border-radius: 18px !important;
        padding: 20px 16px !important;
    }

    .agent-studio-card {
        border-radius: 14px !important;
    }

    .akm-agent-promo {
        padding: 16px !important;
    }

    .agent-studio-header {
        padding: 18px 16px 14px !important;
    }
}

/* ─── Landscape phones ────────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {

    .agent-studio-modal,
    .agent-panel,
    .agents-page-overlay {
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .agents-page-hero {
        margin-bottom: 20px !important;
    }

    .agents-page-hero-icon {
        width: 48px !important;
        height: 48px !important;
    }
}

/* ─── Safe area (notch phones) ────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .input-bar {
            padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        }

        .agent-studio-modal,
        .agent-panel,
        .akm-agent-promo {
            padding-bottom: env(safe-area-inset-bottom) !important;
        }
    }
}