/* ============================================================================
   av-studio.css — Modulo CSS estratto da av.html
   AIVEK Vision — Generato automaticamente
   ============================================================================ */

/* ========================================
   STUDIO SUITE - SIDE PANELS
   Desktop only: + buttons on left/right sides
   Styled to match header/footer gradient
   ======================================== */

/* Hide on mobile portrait, show only on desktop */
@media (max-width: 1024px) and (orientation: portrait) {
    .studio-add-btn,
    .studio-panel,
    .studio-menu,
    .studio-lite-menu,
    .studio-lite-side-btn,
    .studio-lite-header-menu {
        display: none !important;
    }
}

/* Also hide on small landscape when not in Studio Lite mode */
@media (max-width: 896px) and (orientation: landscape) {
    .studio-add-btn,
    .studio-menu {
        display: none !important;
    }
}

/* Add button styles - matching header gradient */
.studio-add-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    font-weight: 300;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.studio-add-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%);
    pointer-events: none;
}
.studio-add-btn:hover {
    background: linear-gradient(135deg, #7086f0 0%, #8456b0 100%);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.studio-add-btn.left {
    left: 20px;
}
.studio-add-btn.right {
    right: 20px;
}
/* Smooth hide/show animation for primary buttons */
body.studio-left-open .studio-add-btn.left,
body.studio-right-open .studio-add-btn.right {
    opacity: 0;
    transform: translateY(-50%) scale(0.5);
    pointer-events: none;
}

/* Dropdown menu for panel selection - matching footer style */
.studio-menu {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 12px;
    z-index: 1001;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: none;
    min-width: 200px;
}
.studio-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(255, 255, 255, 0.04) 50%,
        transparent 100%);
    pointer-events: none;
}
.studio-menu.show {
    display: block;
    animation: studioMenuIn 0.25s ease-out;
}
.studio-menu.left {
    left: 80px;
}
.studio-menu.right {
    right: 80px;
}
@keyframes studioMenuIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.9); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}
.studio-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.studio-menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
}
.studio-menu-item i {
    width: 22px;
    text-align: center;
    color: #fff;
    font-size: 15px;
    opacity: 0.9;
}
.studio-menu-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.studio-menu-item.disabled:hover {
    background: transparent;
}

/* Studio Side Panel - matching header/footer aesthetic */
.studio-panel {
    position: fixed;
    top: 0;
    width: 380px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(118, 75, 162, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 60px rgba(102, 126, 234, 0.2);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.studio-panel.left {
    left: 0;
    transform: translateX(-100%);
    border-left: none;
    border-radius: 0 24px 24px 0;
}
.studio-panel.right {
    right: 0;
    transform: translateX(100%);
    border-right: none;
    border-radius: 24px 0 0 24px;
}
.studio-panel.open {
    transform: translateX(0);
}

/* Panel Header - matching header gradient */
.studio-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}
.studio-panel-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(255, 255, 255, 0.04) 50%,
        transparent 100%);
    pointer-events: none;
}
.studio-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}
.studio-panel-header h3 i {
    color: #fff;
    opacity: 0.9;
}
.studio-panel-close {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    transition: all 0.2s ease;
}
.studio-panel-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Panel Empty State */
.studio-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(102, 126, 234, 0.6);
    text-align: center;
    padding: 24px;
}
.studio-panel-empty i {
    font-size: 56px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.5;
}
.studio-panel-empty p {
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

/* Adjust chat container when panels are open - panels overlay, don't push content */
body.studio-left-open .chat-container {
    margin-left: 0;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.studio-left-open-2 .chat-container {
    margin-left: 0;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.studio-left-open-wide .chat-container {
    margin-left: 0;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.studio-right-open .chat-container {
    margin-right: 0;
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.studio-right-open-2 .chat-container {
    margin-right: 0;
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.studio-right-open-wide .chat-container {
    margin-right: 0;
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Secondary Add Buttons (visible when 1 panel is open) */
.studio-add-btn-secondary {
    position: fixed;
    top: 50%;
    transform: translateY(-50%) scale(0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.studio-add-btn-secondary:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #7b91f0 0%, #8a5bb5 100%);
}
.studio-add-btn-secondary.left {
    left: 390px;
}
.studio-add-btn-secondary.right {
    right: 390px;
}
/* Smooth show animation for secondary buttons */
body.studio-left-open .studio-add-btn-secondary.left {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}
body.studio-right-open .studio-add-btn-secondary.right {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}
/* Smooth hide when 2 panels open */
body.studio-left-open-2 .studio-add-btn-secondary.left,
body.studio-right-open-2 .studio-add-btn-secondary.right {
    opacity: 0;
    transform: translateY(-50%) scale(0.5);
    pointer-events: none;
}

/* Secondary panels - hidden by default */
.studio-panel.left.secondary {
    left: 380px;
    border-radius: 0;
    border-left: 1px solid rgba(102, 126, 234, 0.15);
    transform: translateX(-200%);
    z-index: 1045;
}
.studio-panel.right.secondary {
    right: 380px;
    border-radius: 0;
    border-right: 1px solid rgba(102, 126, 234, 0.15);
    transform: translateX(200%);
    z-index: 1045;
}
.studio-panel.left.secondary.open {
    transform: translateX(0);
}
.studio-panel.right.secondary.open {
    transform: translateX(0);
}

/* Promotion animation - when secondary becomes primary */
.studio-panel.promoting {
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                right 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.4s ease;
}
.studio-panel.secondary.promoting {
    z-index: 1060;
}
.studio-panel.closing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.studio-panel.left.secondary.promoting {
    left: 0 !important;
    border-radius: 0 24px 24px 0;
}
.studio-panel.right.secondary.promoting {
    right: 0 !important;
    border-radius: 24px 0 0 24px;
}

/* Wide Panel (Web Browser) - takes 2 slots */
.studio-panel.wide {
    width: 760px; /* Double width: 380px * 2 */
}
.studio-panel.left.wide {
    left: 0;
    border-radius: 0 24px 24px 0;
}
.studio-panel.right.wide {
    right: 0;
    border-radius: 24px 0 0 24px;
}
/* Hide add buttons when wide panel is open */
body.studio-left-open-wide .studio-add-btn.left,
body.studio-left-open-wide .studio-add-btn-secondary.left {
    opacity: 0;
    pointer-events: none;
}
body.studio-right-open-wide .studio-add-btn.right,
body.studio-right-open-wide .studio-add-btn-secondary.right {
    opacity: 0;
    pointer-events: none;
}

/* Web Browser Panel Styles */
.web-browser-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Important for flex children */
    gap: 12px;
}
.web-browser-search {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}
.web-browser-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: #1f2937;
    outline: none;
    transition: all 0.2s ease;
}
.web-browser-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}
.web-browser-input::placeholder {
    color: #9ca3af;
}
.web-browser-go-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.web-browser-go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}
body[class*="theme-"] .web-browser-go-btn {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: var(--theme-text);
}
body[class*="theme-"] .web-browser-go-btn:hover {
    box-shadow: 0 4px 16px var(--theme-shadow);
}
body[class*="theme-"].dark-mode .web-browser-go-btn {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--theme-gradient-end) 80%, white) 0%, 
        var(--theme-gradient-end) 100%
    );
    color: #0a0a14;
}
.web-browser-iframe-container {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.2);
    background: #fff;
    position: relative;
    min-height: 400px;
    /* Use calc to ensure proper height */
    height: calc(100vh - 250px);
    max-height: calc(100vh - 250px);
}
.dark-mode .web-browser-iframe-container {
    background: #1a1a2e;
    border-color: rgba(102, 126, 234, 0.3);
}
body[class*="theme-"] .web-browser-iframe-container {
    border-color: color-mix(in srgb, var(--theme-gradient-end) 30%, transparent);
}

/* External Link UI - Theme Aware */
.web-browser-external-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fc 0%, #eef1f8 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}
.dark-mode .web-browser-external-ui {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
body[class*="theme-"] .web-browser-external-ui {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--theme-gradient-start) 15%, white) 0%, 
        color-mix(in srgb, var(--theme-gradient-end) 10%, white) 100%
    );
}
body[class*="theme-"].dark-mode .web-browser-external-ui {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--theme-gradient-start) 60%, #0a0a14) 0%, 
        color-mix(in srgb, var(--theme-gradient-end) 40%, #0a0a14) 100%
    );
}

.external-ui-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
.dark-mode .external-ui-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
body[class*="theme-"] .external-ui-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: color-mix(in srgb, var(--theme-gradient-end) 20%, transparent);
}
body[class*="theme-"].dark-mode .external-ui-card {
    background: color-mix(in srgb, var(--theme-gradient-start) 15%, rgba(10, 10, 20, 0.9));
    border-color: color-mix(in srgb, var(--theme-gradient-end) 30%, transparent);
}

.external-ui-favicon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: white;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.dark-mode .external-ui-favicon {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.external-ui-title {
    color: #1a1a2e;
    font-size: 1.3em;
    margin: 0 0 10px 0;
    font-weight: 600;
}
.dark-mode .external-ui-title {
    color: white;
}
body[class*="theme-"] .external-ui-title {
    color: var(--theme-text);
}

.external-ui-description {
    color: #6b7280;
    font-size: 0.9em;
    margin: 0 0 25px 0;
    line-height: 1.5;
}
.dark-mode .external-ui-description {
    color: rgba(255, 255, 255, 0.6);
}
body[class*="theme-"] .external-ui-description {
    color: color-mix(in srgb, var(--theme-text) 70%, transparent);
}

.external-ui-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.external-ui-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
body[class*="theme-"] .external-ui-button {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: var(--theme-text);
    box-shadow: 0 4px 15px var(--theme-shadow);
}
body[class*="theme-"] .external-ui-button:hover {
    box-shadow: 0 6px 20px var(--theme-shadow);
}
body[class*="theme-"].dark-mode .external-ui-button {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--theme-gradient-end) 80%, white) 0%, 
        var(--theme-gradient-end) 100%
    );
    color: #0a0a14;
}

.external-ui-hint {
    color: #9ca3af;
    font-size: 0.75em;
    margin-top: 20px;
    margin-bottom: 0;
}
.dark-mode .external-ui-hint {
    color: rgba(255, 255, 255, 0.4);
}
body[class*="theme-"] .external-ui-hint {
    color: color-mix(in srgb, var(--theme-text) 50%, transparent);
}

.web-browser-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    display: block;
}
.dark-mode .web-browser-iframe {
    background: #1a1a2e;
}
.web-browser-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
}
.dark-mode .web-browser-loading {
    background: rgba(26, 26, 46, 0.95);
}
body[class*="theme-"] .web-browser-loading {
    background: color-mix(in srgb, var(--theme-gradient-start) 15%, rgba(255, 255, 255, 0.95));
}
body[class*="theme-"].dark-mode .web-browser-loading {
    background: color-mix(in srgb, var(--theme-gradient-start) 30%, rgba(10, 10, 20, 0.95));
}
.web-browser-loading i {
    font-size: 48px;
    color: #667eea;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
.dark-mode .web-browser-loading i {
    color: #8b9cf4;
}
body[class*="theme-"] .web-browser-loading i {
    color: var(--theme-gradient-end);
}
.web-browser-loading p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}
.dark-mode .web-browser-loading p {
    color: rgba(255, 255, 255, 0.7);
}
body[class*="theme-"] .web-browser-loading p {
    color: var(--theme-text);
    opacity: 0.8;
}
.web-browser-progress-container {
    width: 280px;
    height: 6px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
}
.dark-mode .web-browser-progress-container {
    background: rgba(139, 156, 244, 0.2);
}
body[class*="theme-"] .web-browser-progress-container {
    background: color-mix(in srgb, var(--theme-gradient-end) 20%, transparent);
}
.web-browser-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShimmer 1.5s ease-in-out infinite;
}
body[class*="theme-"] .web-browser-progress-bar {
    background: linear-gradient(90deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 50%, var(--theme-gradient-start) 100%);
    background-size: 200% 100%;
}
@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.web-browser-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10;
    padding: 40px;
    text-align: center;
}
.web-browser-error i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}
.web-browser-error h4 {
    color: #1f2937;
    font-size: 16px;
    margin-bottom: 8px;
}
.web-browser-error p {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 16px;
    max-width: 300px;
}
.web-browser-error-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.web-browser-error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}
.web-browser-open-external {
    margin-top: 12px;
    color: #667eea;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.web-browser-empty {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    z-index: 2;
}
.dark-mode .web-browser-empty {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
}
body[class*="theme-"] .web-browser-empty {
    background: linear-gradient(180deg, 
        color-mix(in srgb, var(--theme-gradient-start) 10%, white) 0%,
        color-mix(in srgb, var(--theme-gradient-end) 5%, white) 100%
    );
}
body[class*="theme-"].dark-mode .web-browser-empty {
    background: linear-gradient(180deg, 
        color-mix(in srgb, var(--theme-gradient-start) 20%, #0a0a14) 0%,
        color-mix(in srgb, var(--theme-gradient-end) 10%, #0a0a14) 100%
    );
}

/* Nexus Search Title - Montserrat Bold */
.nexus-search-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}
.dark-mode .nexus-search-title {
    color: white;
}
body[class*="theme-"] .nexus-search-title {
    color: var(--theme-text);
}

.nexus-search-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
body[class*="theme-"] .nexus-search-badge {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: var(--theme-text);
}
body[class*="theme-"].dark-mode .nexus-search-badge {
    color: #0a0a14;
}

.nexus-search-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 28px 0;
    max-width: 400px;
}
.dark-mode .nexus-search-subtitle {
    color: rgba(255, 255, 255, 0.6);
}
body[class*="theme-"] .nexus-search-subtitle {
    color: color-mix(in srgb, var(--theme-text) 70%, transparent);
}

/* Nexus Search Box */
.nexus-search-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: transparent;
    border-radius: 16px;
    padding: 6px;
    border: none;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 500px;
    margin-bottom: 24px;
}
.nexus-search-box:focus-within {
    background: transparent;
}
.dark-mode .nexus-search-box {
    background: transparent;
}
.dark-mode .nexus-search-box:focus-within {
    background: transparent;
}
body[class*="theme-"] .nexus-search-box {
    background: transparent;
}
body[class*="theme-"] .nexus-search-box:focus-within {
    background: transparent;
}
body[class*="theme-"].dark-mode .nexus-search-box {
    background: transparent;
}

.nexus-search-box i {
    padding: 0 12px 0 16px;
    color: #9ca3af;
    font-size: 18px;
}
.dark-mode .nexus-search-box i {
    color: rgba(255, 255, 255, 0.5);
}
body[class*="theme-"] .nexus-search-box i {
    color: var(--theme-gradient-end);
}

.nexus-search-input {
    flex: 1;
    border: none !important;
    border-width: 0 !important;
    background: transparent !important;
    font-size: 16px;
    color: #1f2937;
    outline: none !important;
    box-shadow: none !important;
    padding: 12px 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.nexus-search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.nexus-search-input::placeholder {
    color: #9ca3af;
}
.dark-mode .nexus-search-input {
    color: white;
    background: transparent !important;
    border: none !important;
}
.dark-mode .nexus-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
body[class*="theme-"] .nexus-search-input {
    color: var(--theme-text);
    background: transparent !important;
    border: none !important;
}

.nexus-search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.nexus-search-btn:hover {
    transform: scale(1.02);
}
body[class*="theme-"] .nexus-search-btn {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: var(--theme-text);
}
body[class*="theme-"].dark-mode .nexus-search-btn {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--theme-gradient-end) 80%, white) 0%, 
        var(--theme-gradient-end) 100%
    );
    color: #0a0a14;
}

/* Quick Links */
.nexus-quick-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.nexus-quick-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.dark-mode .nexus-quick-label {
    color: rgba(255, 255, 255, 0.4);
}
body[class*="theme-"] .nexus-quick-label {
    color: color-mix(in srgb, var(--theme-text) 50%, transparent);
}

.nexus-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.nexus-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.nexus-chip:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}
.dark-mode .nexus-chip {
    background: rgba(102, 126, 234, 0.15);
    color: #8b9cf4;
}
.dark-mode .nexus-chip:hover {
    background: rgba(102, 126, 234, 0.25);
}
body[class*="theme-"] .nexus-chip {
    background: color-mix(in srgb, var(--theme-gradient-end) 15%, transparent);
    color: var(--theme-gradient-end);
}
body[class*="theme-"] .nexus-chip:hover {
    background: color-mix(in srgb, var(--theme-gradient-end) 25%, transparent);
}

.nexus-hint {
    margin-top: 24px;
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nexus-hint i {
    color: #fbbf24;
}
.dark-mode .nexus-hint {
    color: rgba(255, 255, 255, 0.4);
}
body[class*="theme-"] .nexus-hint {
    color: color-mix(in srgb, var(--theme-text) 50%, transparent);
}

/* Search Results UI */
.web-browser-results {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 16px;
    background: #fafbfc;
    z-index: 3;
}
.dark-mode .web-browser-results {
    background: #1a1a2e;
}
.web-search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.web-search-header i {
    color: #667eea;
    font-size: 16px;
}
.web-search-header span {
    color: #374151;
    font-size: 14px;
}
.web-search-header strong {
    color: #667eea;
}
.web-search-count {
    margin-left: auto;
    color: #9ca3af;
    font-size: 12px;
}
.web-search-empty {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}
.web-search-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.web-search-result {
    background: white;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.web-search-result:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}
.web-search-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.web-search-favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}
.web-search-domain {
    font-size: 12px;
    color: #059669;
}
.web-search-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a56db;
    margin: 0 0 6px 0;
    line-height: 1.3;
}
.web-search-result:hover .web-search-title {
    text-decoration: underline;
}
.web-search-snippet {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.web-search-url {
    font-size: 11px;
    color: #9ca3af;
    word-break: break-all;
}

/* Quick Links in Browser */
.web-browser-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.web-browser-quick-link {
    padding: 8px 14px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.web-browser-quick-link:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}
.web-browser-quick-link i {
    font-size: 11px;
}

/* Web Browser Navigation Controls */
.web-browser-nav-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 16px 16px 0 0;
}
.web-browser-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.web-browser-nav-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}
.web-browser-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.web-browser-nav-btn i {
    font-size: 14px;
}

/* Paste to Context button */
.web-browser-nav-btn.paste-context-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    margin-left: 8px;
}
.web-browser-nav-btn.paste-context-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.5);
}
.web-browser-nav-btn.paste-context-btn.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}
.dark-mode .web-browser-nav-btn.paste-context-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    color: #a5b4fc;
}

/* Tab Bar */
.web-browser-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px 0;
    background: rgba(102, 126, 234, 0.03);
    overflow-x: auto;
    scrollbar-width: none;
}
.web-browser-tabs::-webkit-scrollbar {
    display: none;
}
.web-browser-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    max-width: 180px;
    min-width: 100px;
    transition: all 0.2s ease;
}
.web-browser-tab:hover {
    background: rgba(102, 126, 234, 0.12);
}
.web-browser-tab.active {
    background: white;
    color: #1f2937;
    border-color: rgba(102, 126, 234, 0.25);
}
.web-browser-tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.web-browser-tab-close {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #9ca3af;
    transition: all 0.2s ease;
}
.web-browser-tab-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.web-browser-new-tab {
    width: 28px;
    height: 28px;
    border: 1px dashed rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    background: transparent;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.web-browser-new-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    border-style: solid;
}

/* Wide badge for menu items */
.wide-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: auto;
}
.studio-menu-item.wide-panel-item {
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    margin-top: 4px;
    padding-top: 12px;
}

/* Panel body fade animation */
.studio-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children to shrink */
}
/* Web browser needs full height */
.studio-panel-body:has(.web-browser-container) {
    overflow: hidden;
}
.studio-panel-body.fade-out {
    opacity: 0;
}
.studio-panel-body.fade-in {
    animation: fadeInContent 0.3s ease forwards;
}
@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideDown {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Panel content cards - matching gradient style */
.studio-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}
.studio-card:hover {
    border-color: rgba(102, 126, 234, 0.35);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}
.studio-card-header {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.studio-card-value {
    font-size: 13px;
    color: #374151;
}
.studio-bar {
    height: 6px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    margin-top: 8px;
}

/* Studio buttons */
.studio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}
.studio-btn:hover {
    background: linear-gradient(135deg, #7086f0 0%, #8456b0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}
.studio-btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: none;
}
.studio-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Studio dropzone */
.studio-dropzone {
    border: 2px dashed rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.studio-dropzone:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.06) 100%);
}
.studio-dropzone i {
    font-size: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    display: block;
}
.studio-dropzone p {
    color: #374151;
    font-size: 14px;
    margin: 0 0 8px 0;
}
.studio-dropzone small {
    color: #9ca3af;
    font-size: 12px;
}

/* Studio toggle switches */
.studio-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
}
.studio-toggle-item:last-child {
    border-bottom: none;
}
.studio-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* File upload list items */
.studio-file-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    margin-bottom: 8px;
    position: relative;
}
.studio-file-item i.file-type-icon {
    color: #667eea;
    font-size: 16px;
    flex-shrink: 0;
}
.studio-file-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-file-size {
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}
.studio-file-item .file-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.studio-file-item .file-preview-icon,
.studio-file-item .file-delete-icon {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
    flex-shrink: 0;
}
.studio-file-item .file-preview-icon {
    color: #667eea;
    opacity: 0.8;
}
.studio-file-item .file-preview-icon:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
    opacity: 1;
}
.studio-file-item .file-delete-icon {
    color: #ef4444;
    opacity: 1;
}
.studio-file-item .file-delete-icon:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
/* Context badges - hidden by default, shown with .active class */
.studio-file-item .context-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
/* Show badge only when in-context AND active */
.studio-file-item.in-context .context-badge.active {
    display: inline-flex;
}
.studio-file-item .context-badge.full {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.studio-file-item .context-badge.full:hover {
    background: rgba(16, 185, 129, 0.3);
}
.studio-file-item .context-badge.partial {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.studio-file-item .context-badge.partial:hover {
    background: rgba(251, 191, 36, 0.3);
}
.studio-file-item.in-context {
    border-left: 3px solid #10b981;
    padding-left: 9px;
}

