/* AI Demo - Visual Mode Enhancement */
.demo-visual-container {
    position: relative;
    padding: 60px 40px;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

/* Blobs */
.blob-3 {
    position: absolute;
    /* Fix: Remove from flow */
    width: 600px;
    height: 600px;
    background: #ec4899;
    top: -100px;
    left: 5%;
    animation: float 10s infinite alternate;
    opacity: 0.4;
    filter: blur(80px);
    z-index: 0;
}

.blob-4 {
    position: absolute;
    /* Fix: Remove from flow */
    width: 550px;
    height: 550px;
    background: #f59e0b;
    bottom: -100px;
    right: 10%;
    animation: float 8s infinite alternate-reverse;
    opacity: 0.4;
    filter: blur(80px);
    z-index: 0;
}

/* Big Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    width: 100%;
    max-width: 1000px;
    position: relative;
    z-index: 10;
    overflow: hidden;
    /* Height fix for chat containment */
    height: 650px;
    display: flex;
    flex-direction: column;
}

/* Glass Tabs */
.demo-tabs-glass {
    flex-shrink: 0;
    /* Prevents tabs from shrinking */
    display: flex;
    align-items: center;
    background: transparent;
    padding: 10px 20px 0;
    height: 60px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tab-btn-glass {
    background: transparent;
    border: none;
    padding: 0 25px;
    height: 100%;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: 0.2s;
    font-size: 0.95rem;
}

.tab-btn-glass:hover,
.tab-btn-glass.active {
    color: var(--primary);
}

.tab-btn-glass.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.window-controls {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.dot-control {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red {
    background: #ff5f57;
}

.yellow {
    background: #febc2e;
}

.green {
    background: #28c840;
}

/* Demo Content Area */
.demo-content {
    flex: 1;
    /* Takes remaining height */
    overflow: hidden;
    /* Contains children */
    display: none;
    height: 100%;
}

.demo-content.active {
    display: block;
}

/* Layout Split */
.chat-layout-split,
.video-layout-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Sidebar Left (280px), Content Right */
    height: 100%;
}

/* Chat Interface FIXES */
.chat-interface-glass {
    display: flex;
    flex-direction: column;
    /* Stack messages and input vertically */
    height: 100%;
    /* Fill parent */
    height: 100%;
    /* Fill parent */
    border-right: none;
    background: transparent;
    overflow: hidden;
    /* Prevent spillover */
}

.chat-messages-glass {
    flex-grow: 1;
    /* Takes all available space */
    overflow-y: auto;
    /* Scrolls internally */
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    height: 0;
    /* Flexbox trick to force scrolling */
    min-height: 0;
}

.chat-input-glass {
    flex-shrink: 0;
    /* Never shrink the input area */
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.4);
    /* Slight background to separate */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Bubbles */
.message {
    padding: 12px 20px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 85%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    animation: fadeIn 0.3s ease;
}

.message.ai {
    background: white;
    border-top-left-radius: 4px;
    color: var(--text-main);
}

.message.user {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
    align-self: flex-end;
}

.chat-input-glass input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    outline: none;
    font-size: 0.95rem;
}

.chat-input-glass button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--dark);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar */
.demo-sidebar {
    padding: 30px;
    background: linear-gradient(135deg, #fff0f5 0%, #fff5eb 100%);
    /* Light Pink-Peach base */
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    /* Border on right now */
    border-left: none;
    order: -1;
    /* Move visually to the left */
}

/* Add a pseudo-element for the stronger colorful "cloud" effect */
.demo-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15), rgba(245, 158, 11, 0.1));
    z-index: 0;
    pointer-events: none;
}

.demo-sidebar>* {
    position: relative;
    z-index: 1;
}

.demo-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Video Container 9:16 */
.video-container-916 {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 9/16;
    margin: auto;
    /* Center in grid */
    background: #000;
    border-radius: 16px;
    /* Smooth corners */
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    border: 4px solid #000;
    /* Frame effect */
}

.video-frame-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure Rutube iframe fits 9:16 nicely without black bars if possible */
.video-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Art Interface */
.art-interface-glass {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.art-preview-area {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.art-image-result {
    max-width: 100%;
    max-height: 350px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Art Actions */
.art-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.btn-action {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-main);
}

.btn-action:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    backdrop-filter: blur(10px);
    width: 90%;
    max-width: 600px;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    flex: 1;
}

.cookie-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .glass-panel {
        height: auto;
        min-height: 800px;
    }

    .chat-layout-split,
    .video-layout-split {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .chat-interface-glass,
    .video-container-916 {
        height: 500px;
        border-right: none;
    }

    .demo-sidebar {
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding: 20px;
        height: auto;
    }
}