/* ================================
   WebCraft Builder V2 - Styles Premium
   Inspired by Lovable.dev & Cursor IDE
   ================================ */

:root {
    /* Colors - WebCraft Theme */
    --primary: #4285f4;
    --primary-dark: #1a73e8;
    --primary-light: #8ab4f8;
    --secondary: #34a853;
    --accent: #00f0ff;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-orange: #4285f4; /* Remplacé par bleu pour cohérence */
    
    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #18181f;
    --bg-panel: #0d0d12;
    --bg-chat: #0c0c11;
    --bg-input: #16161d;
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;
    
    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-active: rgba(66, 133, 244, 0.4);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(66, 133, 244, 0.2);
    --shadow-glow-accent: 0 0 30px rgba(0, 240, 255, 0.15);
    
    /* Sizing */
    --top-bar-height: 52px;
    --left-panel-width: 440px;
    --right-panel-width: 380px;
    
    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.12s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.35s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: rgba(66, 133, 244, 0.3);
    color: var(--text-primary);
}

/* ================================
   Loading Screen
   ================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

.loader-logo img {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 0 20px rgba(66, 133, 244, 0.5));
}

.loader-text {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.loader-bar {
    width: 240px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto 20px;
}

.loader-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-purple));
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; background-position: 0% 0%; }
    50% { width: 80%; background-position: 100% 0%; }
    100% { width: 100%; background-position: 0% 0%; }
}

.loader-status {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 500;
}

/* ================================
   App Container
   ================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.app-container.visible {
    opacity: 1;
}

/* ================================
   Top Bar
   ================================ */
.top-bar {
    height: var(--top-bar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    flex-shrink: 0;
    z-index: 100;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-left { flex: 1; }
.top-bar-right { flex: 1; justify-content: flex-end; }

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.brand:hover {
    opacity: 0.9;
}

.brand-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.3);
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
}

/* Project Info */
.project-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.project-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
    max-width: 180px;
}

.project-name-input:hover {
    background: rgba(255, 255, 255, 0.03);
}

.project-name-input:focus {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.project-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* View & Device Switchers */
.view-switcher,
.device-switcher {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
    border: 1px solid var(--border-color);
}

.view-btn,
.device-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 5px;
}

.device-btn {
    padding: 6px 10px;
}

.view-btn:hover,
.device-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.view-btn.active,
.device-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

/* Top Buttons */
.top-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.top-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.top-btn.primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Quota Indicator */
.quota-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--radius-full);
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quota-indicator:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
    border-color: rgba(168, 85, 247, 0.3);
}

.quota-indicator i {
    color: var(--accent-pink);
}

/* Quota Warning State */
.quota-indicator.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.quota-indicator.warning i {
    color: #f59e0b;
}

/* Quota Danger State */
.quota-indicator.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    animation: pulse-danger 1.5s ease-in-out infinite;
}

.quota-indicator.danger i {
    color: #ef4444;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* Quota Unlimited State */
.quota-indicator.unlimited {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(234, 88, 12, 0.1));
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.quota-indicator.unlimited i {
    color: #f59e0b;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.user-avatar:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: var(--transition-base);
    z-index: 1000;
    overflow: hidden;
}

.user-menu:hover .user-dropdown,
.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-info {
    padding: 14px 16px;
    text-align: center;
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.05), transparent);
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 13px;
}

.user-plan {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
    border-radius: var(--radius-full);
    color: var(--accent-purple);
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ================================
   Main Content Layout
   ================================ */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ================================
   Left Panel - AI Chat (Premium Design)
   ================================ */
.left-panel {
    width: var(--left-panel-width);
    background: var(--bg-chat);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition-base);
    position: relative;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.left-panel.collapsed {
    width: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.ai-icon {
    font-size: 18px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* AI Status Indicator */
.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 500;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-indicator.connecting {
    background: #f59e0b;
    animation: blink 1s ease-in-out infinite;
}

.status-indicator.connected {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.status-indicator.disconnected {
    background: #ef4444;
}

.status-label {
    color: var(--text-tertiary);
}

.ai-status.connected .status-label {
    color: #22c55e;
}

.ai-status.disconnected .status-label {
    color: #ef4444;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.panel-toggle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.panel-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* AI Response Area - Premium */
.ai-response-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.ai-response-area::-webkit-scrollbar {
    width: 5px;
}

.ai-response-area::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

/* Welcome Message - Premium */
.welcome-message {
    text-align: center;
    padding: 50px 24px;
    max-width: 340px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 56px;
    margin-bottom: 20px;
    display: inline-block;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
    50% { transform: scale(1.1) rotate(5deg); filter: brightness(1.2); }
}

.welcome-message h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message p {
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.7;
}

/* AI Messages - Premium */
.ai-message {
    margin-bottom: 24px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message-avatar.ai {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.3);
}

.message-avatar.user {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.message-sender {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
}

.message-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-left: 38px;
    position: relative;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 12px;
    left: -6px;
    width: 10px;
    height: 10px;
    background: var(--bg-tertiary);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.message-content.user {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(66, 133, 244, 0.05));
    border-color: rgba(66, 133, 244, 0.2);
}

.message-content.user::before {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(66, 133, 244, 0.05));
    border-color: rgba(66, 133, 244, 0.2);
}

.message-content h4 {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.message-content ul {
    margin: 10px 0;
    padding-left: 18px;
}

.message-content li {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.message-content strong {
    color: var(--accent);
}

.message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* Code Preview in Messages */
.code-preview {
    background: #0d0d12;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 12px;
    overflow: hidden;
}

.code-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.code-preview-title {
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-preview-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 11px;
    transition: var(--transition-fast);
    border-radius: var(--radius-xs);
}

.code-preview-actions button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.code-preview-content {
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 180px;
    overflow-y: auto;
    color: #e0e0e0;
}

/* Typing Indicator */
.typing-indicator .message-content {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Quick Actions Bar - Premium Chips */
.quick-actions-bar {
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.quick-actions-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.quick-actions-scroll::-webkit-scrollbar {
    height: 6px;
}

.quick-actions-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.quick-actions-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.quick-actions-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.quick-action-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.quick-action-chip:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(168, 85, 247, 0.1));
    border-color: rgba(66, 133, 244, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.quick-action-chip i {
    font-size: 11px;
    color: var(--primary-light);
}

/* Chat Input Area - Premium */
.chat-input-area {
    padding: 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    transition: var(--transition-fast);
    position: relative;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1), var(--shadow-glow);
}

.input-wrapper:focus-within::before {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    opacity: 0.5;
}

.input-wrapper textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 22px;
    max-height: 140px;
    font-family: inherit;
}

.input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.input-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.input-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.4);
}

.send-btn:active {
    transform: scale(0.98);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Input Options */
.input-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-tertiary);
    user-select: none;
}

.option-toggle input {
    display: none;
}

.toggle-slider {
    width: 34px;
    height: 18px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    position: relative;
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.option-toggle input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.option-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
    background: white;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 5px;
}

.option-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Backend Section - Premium */
.backend-section {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.3));
}

.connect-backend-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    color: #22c55e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.connect-backend-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
    border-color: rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

.backend-icon {
    font-size: 16px;
}

.docs-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
    transition: var(--transition-fast);
}

.docs-link:hover {
    color: var(--text-secondary);
}

/* Plan Badge at Bottom */
.plan-badge-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.plan-badge-full {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(26, 115, 232, 0.08));
    border: 1px solid rgba(66, 133, 244, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.plan-badge-full:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(26, 115, 232, 0.12));
    border-color: rgba(66, 133, 244, 0.3);
}

.plan-badge-icon {
    font-size: 20px;
}

.plan-badge-info {
    flex: 1;
}

.plan-badge-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    display: block;
}

.plan-badge-type {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* ================================
   Center Panel - Preview
   ================================ */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: 
        radial-gradient(circle at 50% 50%, rgba(66, 133, 244, 0.03) 0%, transparent 50%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px, 24px 24px;
}

.preview-frame {
    background: #1a1a1f;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
}

.preview-frame.desktop {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: var(--radius-lg);
}

.preview-frame.tablet {
    width: 768px;
    height: 1024px;
    max-height: calc(100vh - 140px);
}

.preview-frame.mobile {
    width: 375px;
    height: 812px;
    max-height: calc(100vh - 140px);
    border-radius: 44px;
    box-shadow: 
        var(--shadow-lg),
        inset 0 0 0 3px #2a2a30,
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #252528;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.browser-dots {
    display: flex;
    gap: 6px;
}

.browser-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.browser-url {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--text-tertiary);
    flex: 1;
    max-width: 300px;
    margin: 0 14px;
}

.browser-url i {
    font-size: 9px;
    color: var(--secondary);
}

.browser-actions {
    display: flex;
    gap: 4px;
}

.browser-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.browser-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

#previewIframe {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

/* ================================
   Right Panel - Code Editor
   ================================ */
.right-panel {
    width: var(--right-panel-width);
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition-base);
}

.right-panel.hidden {
    display: none;
}

.right-panel.expanded {
    width: 55%;
}

.code-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    min-height: 40px;
}

.file-tabs {
    display: flex;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}

.file-tabs::-webkit-scrollbar {
    display: none;
}

.file-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-tertiary);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.file-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.file-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
}

.file-tab .fab,
.file-tab .fas {
    font-size: 13px;
}

.file-tab .fa-html5 { color: #e34c26; }
.file-tab .fa-css3-alt { color: #264de4; }
.file-tab .fa-js { color: #f0db4f; }

.code-editor-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* File Explorer */
.file-explorer {
    width: 200px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.explorer-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.explorer-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.explorer-tab:hover {
    color: var(--text-secondary);
}

.explorer-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
}

.explorer-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.file-tree {
    font-size: 12px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.tree-item.active {
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary-light);
}

.tree-item.folder {
    font-weight: 500;
}

.tree-item .icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.tree-children {
    padding-left: 16px;
}

/* Enhanced File Tree Styles */
.tree-folder {
    margin-bottom: 2px;
}

.tree-folder.collapsed > .tree-children {
    display: none;
}

.tree-folder.collapsed .folder-arrow {
    transform: rotate(-90deg);
}

.folder-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    color: var(--text-tertiary);
}

.tree-folder-toggle {
    user-select: none;
}

.tree-folder-toggle:hover .folder-arrow {
    color: var(--text-primary);
}

.folder-name {
    flex: 1;
}

.file-count {
    font-size: 10px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--text-tertiary);
    margin-left: auto;
}

.tree-item.folder:hover .file-count {
    background: rgba(255, 255, 255, 0.1);
}

/* Backend/Frontend folder colors */
.tree-folder[data-folder="backend"] > .tree-item > .folder-name {
    color: #34d399;
}

.tree-folder[data-folder="frontend"] > .tree-item > .folder-name {
    color: #60a5fa;
}

/* Animation for new files */
@keyframes fileAdded {
    0% {
        background: rgba(16, 185, 129, 0.3);
        transform: translateX(-10px);
        opacity: 0;
    }
    100% {
        background: transparent;
        transform: translateX(0);
        opacity: 1;
    }
}

.tree-item.new-file {
    animation: fileAdded 0.5s ease-out;
}

/* Files Popup */
.files-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.files-popup {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.files-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.files-popup-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.files-popup-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.files-popup-header button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.files-popup-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.files-popup-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.files-popup-item:hover {
    background: rgba(66, 133, 244, 0.1);
    color: var(--text-primary);
}

.files-popup-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* More files tab button */
.file-tab.more-files {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px dashed var(--border-color) !important;
    color: var(--text-tertiary) !important;
}

.file-tab.more-files:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-secondary) !important;
}

/* Editor Area */
.editor-area {
    flex: 1;
    overflow: hidden;
}

#monacoEditor {
    width: 100%;
    height: 100%;
}

/* ================================
   Modals - Premium Design
   ================================ */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content.large {
    max-width: 860px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.05), transparent);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
}

/* Templates Grid */
.template-categories {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.template-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.template-preview {
    aspect-ratio: 16/10;
    background: var(--bg-panel);
    position: relative;
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-info {
    padding: 12px 14px;
}

.template-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
}

.template-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Export Options */
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.export-option:hover {
    border-color: var(--primary);
    background: rgba(66, 133, 244, 0.05);
    transform: translateY(-2px);
}

.export-option i {
    font-size: 26px;
    color: var(--primary);
}

.export-option span {
    font-weight: 600;
    font-size: 13px;
}

.export-option small {
    font-size: 10px;
    color: var(--text-muted);
}

/* Quota Modal */
.quota-message {
    text-align: center;
    padding: 20px 0;
}

.quota-icon {
    font-size: 50px;
    margin-bottom: 16px;
}

.quota-message h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.quota-message p {
    color: var(--text-secondary);
    font-size: 13px;
}

.plan-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 22px;
}

.plan-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
}

.plan-card.recommended {
    border-color: var(--primary);
    position: relative;
    box-shadow: var(--shadow-glow);
}

.recommended-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: white;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
}

.plan-card h4 {
    color: var(--text-tertiary);
    font-size: 11px;
    margin-bottom: 6px;
}

.plan-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.plan-quota {
    font-size: 12px;
    color: var(--text-muted);
}

.plan-price {
    font-size: 30px;
    font-weight: 800;
    margin: 12px 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plan-price small {
    font-size: 13px;
    font-weight: 500;
}

.plan-features {
    list-style: none;
    text-align: left;
    margin: 14px 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features i {
    color: var(--secondary);
    font-size: 11px;
}

.upgrade-plan-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.upgrade-plan-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Wizard Styles */
.shopify-wizard {
    min-height: 280px;
}

.wizard-step {
    display: none;
    animation: messageIn 0.3s ease;
}

.wizard-step.active {
    display: block;
}

.wizard-step h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.wizard-step p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 18px;
}

.product-input-area {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.product-list {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}

.product-item input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.product-item button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition-fast);
}

.product-item button:hover {
    color: #ef4444;
}

.add-product-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-product-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.style-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.style-option {
    cursor: pointer;
}

.style-option input {
    display: none;
}

.style-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    font-size: 12px;
}

.style-option input:checked + .style-preview {
    border-color: var(--primary);
    background: rgba(66, 133, 244, 0.08);
}

.style-preview i {
    font-size: 22px;
    color: var(--primary);
}

.features-checklist {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.feature-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

.feature-check:hover {
    background: rgba(255, 255, 255, 0.03);
}

.feature-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.wizard-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.wizard-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
}

.wizard-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wizard-btn.generate {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
}

.wizard-btn.generate:hover {
    box-shadow: var(--shadow-glow);
}

.wizard-btn.hidden {
    display: none;
}

.wizard-progress {
    display: flex;
    gap: 6px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: var(--transition-fast);
}

.progress-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

/* ================================
   Toast Notifications
   ================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 260px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success { border-color: var(--secondary); }
.toast.error { border-color: #ef4444; }
.toast.warning { border-color: #f59e0b; }
.toast.info { border-color: var(--primary); }

.toast-icon {
    font-size: 16px;
}

.toast.success .toast-icon { color: var(--secondary); }
.toast.error .toast-icon { color: #ef4444; }
.toast.warning .toast-icon { color: #f59e0b; }
.toast.info .toast-icon { color: var(--primary); }

.toast-message {
    font-size: 12px;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ================================
   Scrollbar Styling
   ================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ================================
   Quick Action Special Buttons
   ================================ */
.quick-action-chip.template-btn {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    border-color: #4285f4;
    color: white;
    font-weight: 600;
}

.quick-action-chip.template-btn:hover {
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.4);
    transform: translateY(-2px);
}

.quick-action-chip.shop-btn {
    background: linear-gradient(135deg, #34a853, #1e8e3e);
    border-color: #34a853;
    color: white;
    font-weight: 600;
}

.quick-action-chip.shop-btn:hover {
    box-shadow: 0 4px 20px rgba(52, 168, 83, 0.4);
    transform: translateY(-2px);
}

/* ================================
   Templates Grid Enhanced
   ================================ */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 10px;
}

.template-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(66, 133, 244, 0.2);
}

.template-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 0 10px;
}

.category-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ================================
   Panel Collapsed States
   ================================ */
.left-panel.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
}

.left-panel.collapsed * {
    visibility: hidden;
}

.right-panel.expanded {
    width: 60%;
    max-width: 800px;
}

/* ================================
   Dropdown Menu Enhanced
   ================================ */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

.user-info {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-plan {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 1200px) {
    :root {
        --left-panel-width: 380px;
    }
}

@media (max-width: 992px) {
    .left-panel {
        position: fixed;
        top: var(--top-bar-height);
        left: 0;
        height: calc(100vh - var(--top-bar-height));
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    
    .left-panel.open {
        transform: translateX(0);
    }
    
    .left-panel.collapsed {
        transform: translateX(-100%);
    }
    
    .device-switcher {
        display: none;
    }
    
    .project-info {
        display: none;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
