/* ==========================================================================
   PREMIUM THEME CORE CONFIGURATIONS
   ========================================================================== */
:root {
    --bg-master: #090c15;
    --bg-surface: #12182c;
    --bg-input: #1a223f;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(99, 102, 241, 0.25);
    
    /* Premium Gemini/ChatGPT Inspired Custom Neon Gradients */
    --gradient-accent: linear-gradient(135deg, #4f46e5, #9333ea, #ec4899);
    --gradient-glow: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0) 70%);
    
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.05);
}

/* Vibrant Light Mode Override */
body.light {
    --bg-master: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-input: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(79, 70, 229, 0.15);
    --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   GLOBAL STRUCTURE SETTINGS
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-master);
    color: var(--text-main);
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

/* Modern Animated Background Ambient Mesh */
.ambient-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: var(--gradient-glow);
    top: -80px;
    left: -80px;
    z-index: -1;
    pointer-events: none;
}
body.light .ambient-glow { 
    display: none; 
}

.app-container {
    width: 100%;
    max-width: 650px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
}

/* ==========================================================================
   HEADER & TOP ACTIONS
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    flex-shrink: 0;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 3px;
}

.premium-surface {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 14px;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    width: 100%;
    transition: border-color 0.3s ease;
}

.input-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 5px;
}

.text-input-field {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-main);
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.2s ease;
}
.text-input-field:focus {
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.icon-btn {
    background-color: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    color: #818cf8;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}
.icon-btn:active {
    transform: scale(0.95);
    background-color: rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   NAVIGATION VIEWPORTS & CAROUSELS
   ========================================================================== */
.tab-bar {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    width: 100%;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #a855f7;
    border-bottom: 2.5px solid #a855f7;
}

.viewport-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 16px;
    width: 100%;
}

.suggestion-box {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    flex-shrink: 0;
    width: 100%;
}
.suggestion-box::-webkit-scrollbar { 
    display: none; 
}

.sug-chip {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 24px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}
.sug-chip:active {
    transform: scale(0.98);
    border-color: #a855f7;
}

/* ==========================================================================
   CHAT MESSAGING WORKSPACE
   ========================================================================== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    scrollbar-width: none;
    width: 100%;
}
.chat-area::-webkit-scrollbar { 
    display: none; 
}

.user-frame {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.bubble-user {
    background: var(--gradient-accent);
    color: white;
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px 20px 4px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.bubble-ai {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-premium);
    width: 100%;
}

.action-bar {
    background-color: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-btn {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.action-btn:active {
    transform: scale(0.96);
}

.action-btn.primary {
    background: var(--gradient-accent);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.ai-text-content {
    padding: 18px;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   VIDEO GENERATION CONTAINER
   ========================================================================== */
.video-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-shadow: var(--shadow-premium);
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #04060b;
    display: flex;
    align-items: center;
    justify-content: center;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   INPUT SYSTEM MECHANICS
   ========================================================================== */
.input-bar {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 10px 16px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    box-shadow: var(--shadow-premium);
    flex-shrink: 0;
    width: 100%;
    transition: border-color 0.2s ease;
}
.input-bar:focus-within {
    border-color: #a855f7;
}

textarea {
    flex: 1;
    background: none;
    border: none;
    resize: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
    padding: 8px 4px;
    max-height: 120px;
    line-height: 1.5;
    font-family: var(--font-sans);
    font-weight: 500;
}
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.send-btn {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
    transition: transform 0.2s ease;
}
.send-btn:active {
    transform: scale(0.92);
}

/* ==========================================================================
   SAVED TRANSACTION HISTORY COMPACT LOGS
   ========================================================================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    width: 100%;
    scrollbar-width: none;
}
.history-list::-webkit-scrollbar { 
    display: none; 
}

.history-card {
    background-color: var(--bg-surface);
    