/* 
 * CRIODS Workspace - NamePros Inspired Professional Hub
 * High-Density / High-Activity Domain Marketplace Theme
 */

:root {
    /* Palette: Vibrant Orange & Warm Neutrals */
    --primary: #F97316;
    --primary-light: #FFF7ED;
    --primary-dark: #EA580C;
    --sidebar-bg: #271710;
    --bg-canvas: #FFFAF5;
    --bg-card: #FFFFFF;
    
    --studio-bg: #050505;
    
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-on-dark: #F8FAFC;
    --border: #E2E8F0;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    --transition: all 0.2s ease;
    --sidebar-width: 220px;
    --pulse-width: 280px;
    --font-size-base: 13px; /* Smaller base font for high density */

    /* LUXURY STUDIO TOKENS */
    --luxury-pearl: #FAF9F6;
    --luxury-gold: #C5A059;
    --luxury-gold-soft: #F7E7CE;
    --luxury-sage: #C1CDC1;
    --luxury-charcoal: #2C3E50;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* --- LUXURY STUDIO SYSTEM --- */
.studio-glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.03);
}

.style-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.style-card:hover {
    transform: translateY(-4px);
    border-color: var(--luxury-gold);
}

.style-card.active {
    border-color: var(--luxury-gold);
    background: var(--luxury-gold-soft);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.1);
}

.style-card.active::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--luxury-gold);
}

.studio-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--luxury-charcoal);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.luxury-btn {
    background: var(--luxury-charcoal);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.luxury-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.4;
    display: flex;
    font-size: var(--font-size-base);
    overflow-x: hidden !important;
}

html { overflow-x: hidden !important; width: 100%; position: relative; }

a { color: inherit; text-decoration: none; transition: var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; outline: none; transition: var(--transition); }
button:active { transform: scale(0.96); }
input, textarea, select { 
    font-family: inherit; 
    outline: none; 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    font-size: 1rem; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: var(--bg-canvas);
    border: 1.5px solid var(--border);
    font-weight: 500;
}

.form-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
    transform: translateY(-1px);
}

textarea.form-input {
    height: auto;
    padding: 16px;
}

/* Responsive Grid System */
.responsive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* --- Layout Structure (Three-Column) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0; top: 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    color: var(--text-on-dark);
}

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    min-height: 100vh;
}

#app-container {
    flex: 1;
    padding: 24px 32px;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

/* Right Side Activity Panel */
.pulse-sidebar {
    width: var(--pulse-width);
    border-left: 1px solid var(--border);
    background: white;
    padding: 24px 16px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

/* --- Typography & Headers --- */
h1, h2, h3 { color: var(--slate-900); letter-spacing: -0.02em; font-weight: 800; }
.section-header { margin-bottom: 32px; display: flex; justify-content: space-between; align-items: center; }
.section-header h2 { font-size: 1.5rem; }

/* --- Sidebar Components --- */
.sidebar-logo {
    font-size: 1.2rem;
    font-weight: 900;
    color: white;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo i {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 8px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--slate-400);
    font-size: 0.95rem;
    font-weight: 600;
}
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); transform: translateX(4px); }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2); }

/* --- High-Density Domain Rows (NamePros Style) --- */
.domain-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.domain-row {
    background: white !important;
    padding: 16px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 24px;
    transition: var(--transition);
    border-bottom: 1px solid var(--slate-100);
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
}

.domain-row .row-asset-info { flex: 4 1 0% !important; }
.domain-row .row-price { flex: 1.2 1 0% !important; text-align: right !important; display:flex !important; align-items:center; justify-content:flex-end; font-weight: 800; }
.domain-row .row-stats { flex: 1 1 0% !important; text-align: center !important; display:flex !important; align-items:center; justify-content:center; }
.domain-row .row-actions { flex: 2 1 0% !important; display: flex !important; justify-content: flex-end !important; gap: 12px; }

/* Desktop-Only High Density Locking */
@media (min-width: 1025px) {
    .domain-row .row-asset-info { min-width: 250px; }
    .domain-row .row-price { min-width: 90px; }
    .domain-row .row-stats { min-width: 110px; }
    .domain-row .row-actions { min-width: 170px; }
}
.domain-row:hover { background: var(--slate-50); }

.row-asset-info { display: flex; flex-direction: column; gap: 2px; }
.row-name { font-weight: 800; font-size: 1rem; color: var(--primary); }
.row-category { font-size: 0.7rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; }

.row-price { font-weight: 800; font-size: 1.1rem; color: var(--slate-900); }
.row-stats { font-size: 0.8rem; color: var(--slate-500); }

/* --- Pulse / Activity sidebar item --- */
.pulse-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--slate-100);
}
.pulse-user { font-weight: 700; color: var(--slate-900); font-size: 0.85rem; }
.pulse-action { font-size: 0.85rem; color: var(--slate-500); margin: 4px 0; }
.pulse-asset { font-weight: 800; color: var(--primary); }
.pulse-time { font-size: 0.75rem; color: var(--slate-400); }

/* --- Badges & Buttons --- */
.badge {
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-verified { background: #DCFCE7; color: #166534; }
.badge-tld { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }

.btn {
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(0.96); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3); }
.btn-secondary { background: white; border: 1px solid var(--border); color: var(--slate-700); }

.pulse-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
@media (max-width: 640px) {
    .pulse-panel { padding: 24px 16px !important; }
}

/* --- Modals & Overlays --- */
/* --- Support AI Widget --- */
.support-widget {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 2000;
}

.support-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items:center;
    justify-content:center;
    transition: var(--transition);
}

.support-btn:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

.support-chat {
    position: absolute;
    bottom: 56px;
    right: 0;
    width: 280px;
    height: 360px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.support-chat.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.support-header {
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
}

.support-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.support-send-btn {
    width: 32px;
    height: 32px;
    padding: 0 !important;
}

.support-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 12px;
    display: flex;
    flex-direction: column;
}

.msg { margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; max-width: 90%; line-height: 1.4; }
.msg.ai { background: var(--slate-100); color: var(--slate-800); align-self: flex-start; border-bottom-left-radius: 2px; }
.msg.user { background: var(--primary-light); color: var(--primary); align-self: flex-end; border-bottom-right-radius: 2px; }
.msg.typing { font-style: italic; opacity: 0.7; font-size: 0.75rem; }

.support-quick-actions {
    padding: 0 12px 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-btn {
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--slate-600);
    white-space: nowrap;
}

.quick-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.support-input-area {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
}

.support-input-area input {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Fix backdrop-filter lint */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.modal-card {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%; max-width: 480px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1280px) {
    .pulse-sidebar { display: none; }
    .main-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); }
}

@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 32px 10px; }
    .sidebar-logo span, .nav-item span { display: none; }
    .main-content { margin-left: 80px; }
}

@media (max-width: 768px) {
    body { flex-direction: column; padding-top: 60px; padding-bottom: 70px; }
    
    .sidebar {
        position: fixed;
        bottom: 0; left: 0; top: auto;
        width: 100%; height: 64px;
        flex-direction: row;
        justify-content: flex-start; align-items: stretch;
        padding: 0; margin: 0;
        z-index: 10000;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-radius: 0;
        background: var(--sidebar-bg); /* Enforce solid block */
        display: block; /* Release flex layout for child scroll */
    }
    
    .sidebar-logo {
        position: fixed; top: 0; left: 0; width: 100%; height: 60px;
        background: var(--sidebar-bg); z-index: 9999;
        margin: 0; padding: 0 20px;
        display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .sidebar-logo span { display: inline-block !important; font-size: 1.1rem; }
    
    .sidebar-nav {
        display: flex; flex-direction: row; width: 100%; height:100%; justify-content: flex-start;
        padding: 0; margin: 0; gap: 0; align-items: center;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    
    .nav-item {
        flex-direction: column; gap: 4px; padding: 0; justify-content: center; align-items: center;
        border-radius: 0; font-size: 0.65rem; text-align: center; height: 100%;
        min-width: 76px; flex-shrink: 0;
    }
    .nav-item span { display: block !important; margin: 0; font-size: 0.65rem; }
    .nav-item i { width: 22px; height: 22px; margin: 0 auto; display: block; }

    .sidebar > div:last-child {
        position: fixed; top: 12px; right: 16px; z-index: 10001;
        margin: 0 !important; padding: 0 !important; border: none !important;
        display: flex; flex-direction: row; gap: 8px; align-items: center;
    }
    .sidebar > div:last-child > div:first-child {
        background: rgba(255,255,255,0.1) !important; margin: 0 !important; padding: 6px 12px !important;
        border-radius: var(--radius-full) !important; height: 36px;
    }
    .sidebar > div:last-child > div:first-child span { display: none; }
    .sidebar > div:last-child > div:first-child i[data-lucide="chevron-down"] { display: none; }
    
    #profile-dropdown {
        position: fixed; top: 60px; right: 16px;
        background: var(--sidebar-bg);
        border: 1px solid rgba(255,255,255,0.1);
        width: auto; min-width: 140px; margin: 0;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar > div:last-child a.nav-item {
        flex-direction: row; padding: 0 16px; border-radius: var(--radius-full);
        font-size: 0.8rem; height: 36px; color: white !important; background: rgba(255,255,255,0.1);
    }
    .sidebar > div:last-child a.nav-item i { display: none; }
    .sidebar > div:last-child a.nav-item span { font-size: 0.8rem; font-weight: 700; display: block !important; }

    .main-content { margin-left: 0; width: 100%; min-height: 100vh; }
    #app-container { padding: 12px; margin-top: 0; }
    
    /* Override grid layouts */
    .domain-row { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 16px; 
        padding: 20px;
    }
    .domain-row > div { 
        width: 100% !important; 
        text-align: left !important; 
        flex: none !important; 
        min-width: 0 !important;
        padding: 4px 0;
    }
    .domain-row .row-price {
        justify-content: flex-start !important;
        font-size: 1.2rem;
        color: var(--primary);
    }
    .domain-row .row-stats {
        justify-content: flex-start !important;
    }
    .domain-row .row-actions {
        justify-content: flex-start !important;
        border-top: 1px solid var(--slate-100);
        padding-top: 16px;
        margin-top: 8px;
    }
    .domain-row .row-name { font-size: 1.25rem; }
    
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    
    [style*="grid-template-columns: 1fr 1.5fr"] {
        grid-template-columns: 1fr !important;
    }

    .section-header { flex-direction: column; align-items: flex-start; gap: 16px; overflow: hidden; width: 100%; }
    .section-header div:last-child { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
    .section-header button { flex: 1; height: 44px; }

    #onboarding-widget { top: 80px; right: 10px; width: calc(100% - 20px); left: 10px; }
    .pulse-sidebar { display: none; }
    
    /* Support Chat */
    .support-widget { bottom: 86px; }
    .support-chat { right: -10px; bottom: 60px; width: calc(100vw - 32px); }
    
    /* Native Chat Subsystem */
    .chat-layout { flex-direction: column !important; }
    .chat-sidebar { 
        width: 100% !important; 
        border-right: none !important; 
        border-bottom: 1px solid var(--slate-200);
        height: 35vh;
        flex-shrink: 0;
    }
    .chat-sidebar #inbox-list {
        max-height: calc(35vh - 75px);
    }
}

.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- Toast Notification System --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 11000; /* Must be higher than modal-overlay (10000) */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    color: var(--slate-900);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    font-weight: 600;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: opacity 0.3s ease;
    min-width: 300px;
    display: flex;
    align-items: center;
}

.toast.error {
    border-left-color: #ef4444;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Quest / Onboarding Widget --- */
#onboarding-widget {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    z-index: 1000;
    overflow: hidden;
    animation: slideInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.quest-header {
    background: var(--slate-900);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-header h4 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.quest-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.quest-item:hover {
    background: var(--slate-50);
}

.quest-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quest-icon.pending {
    border: 2px solid var(--slate-200);
    border-radius: 50%;
}

.quest-icon.completed {
    color: #10b981;
}

.quest-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate-600);
}

.quest-item.completed .quest-text {
    color: var(--slate-400);
    text-decoration: line-through;
}

/* --- Side-Specific Toasts --- */
.toast-container.left {
    right: auto;
    left: 24px;
}

.toast.error-gate {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.1);
}


/* CACC Command Center Styles */
/* --- Chat Subsystem Overrides --- */
.chat-layout {
    display: flex;
    flex-direction: row;
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--slate-200);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* User Profile Nav elements */
.cacc-tab {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    width: 100%;
    color: var(--slate-600);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-align: left;
}

.cacc-tab:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.cacc-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.cacc-tab i {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.cacc-tab.active i {
    opacity: 1;
}

/* Modal Overlay fix for deep immersion */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

/* --- GUEST GATE & NEW SECTIONS --- */
body.gate-open .sidebar, 
body.gate-open .pulse-sidebar {
    display: none !important;
}
body.gate-open .main-content {
    margin-left: 0;
    width: 100%;
    background: var(--bg-canvas);
    color: var(--text-main);
}

.ai-tpl-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Marketplace Storefront */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.domain-card {
    background: white;
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}
.domain-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.05);
    border-color: var(--primary);
}

.domain-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.domain-price {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
#app-container > div {
    animation: fadeIn 0.4s ease forwards;
}
/* --- AI STUDIO CREATIVE WORKSPACE --- */
body.studio-mode .main-content {
    margin-left: 0 !important;
    width: 100% !important;
}

body.studio-mode #app-container {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.studio-layout {
    background: var(--studio-bg) !important;
    color: #f8fafc !important;
    min-height: 100vh;
    padding: 60px 80px !important;
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
}

.studio-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px;
    position: sticky;
    top: 40px;
}

.studio-input-group {
    margin-bottom: 32px;
}

.studio-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

.studio-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    height: 52px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
}
.studio-input:focus {
    border-color: var(--primary) !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

.template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.template-card {
    height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    background: rgba(0,0,0,0.3);
}

.template-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.template-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

.template-card .preview-thumb {
    width: 100%;
    height: 100%;
    opacity: 0.6;
    background-size: cover;
    background-position: center;
}

.template-card .label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
}

/* Stage Environment */
.stage-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 700px;
}

.canvas-frame {
    padding: 24px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 32px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    position: relative;
}

.canvas-frame::before {
    content: '';
    position: absolute;
    top: -20px; left: -20px; right: -20px; bottom: -20px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

#ai-canvas {
    border-radius: 12px;
    display: block;
    max-width: 100%;
    height: auto;
}

/* Transitions */
.studio-enter {
    animation: studioFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes studioFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Hide navigation in Studio Mode */
body.studio-mode .sidebar,
body.studio-mode .pulse-sidebar {
    display: none !important;
}

body.studio-mode .main-content {
    margin-left: 0 !important;
    width: 100% !important;
}

/* --- STUDIO TABS & LAYER MANAGEMENT --- */
.studio-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 24px;
    padding: 4px;
}

.studio-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.studio-tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.studio-tab-content {
    display: none;
}
.studio-tab-content.active {
    display: block;
}

.layer-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.layer-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.layer-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0,0,0,0.2);
}

.magic-ai-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(79, 70, 229, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
}

.btn-magic {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white !important;
    border: none;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.btn-magic:hover {
    transform: translateY(-2px) scale(1.02);
}

.scale-slider {
    width: 100%;
    accent-color: var(--primary);
    margin-top: 8px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    appearance: none;
}

/* Mouse cursor for canvas */
#ai-canvas.dragging {
    cursor: grabbing !important;
}

.layer-card .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.font-selector {
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: white !important;
    height: 40px;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 0.8rem;
    flex: 1;
}

.text-input-hybrid {
    position: relative;
    width: 100%;
}

.text-input-hybrid input {
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: white !important;
    height: 52px;
    padding: 0 16px;
    border-radius: 12px;
    width: 100%;
}

#ai-canvas.text-active {
    cursor: text;
}

.studio-tab-btn i {
    width: 16px;
    height: 16px;
}

/* --- PREMIUM STOREFRONT TEMPLATES --- */

/* 1. THE VISIONARY (GoPro/Tech Inspired) */
.tpl-visionary { background: #020617; color: white; }
.tpl-visionary .marketplace-hero {
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent),
                linear-gradient(135deg, #020617 0%, #1e1b4b 100%) !important;
    border-radius: 0 0 60px 60px;
    padding: 12vw 5% !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tpl-visionary h1 {
    font-size: clamp(3rem, 8vw, 6rem) !important;
    text-transform: uppercase;
    letter-spacing: -0.06em !important;
    color: white;
    text-shadow: 0 20px 50px rgba(0,0,0,0.5);
    font-weight: 900 !important;
}
.tpl-visionary #store-logo-main {
    border: 3px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6) !important;
}
.tpl-visionary .domain-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    border-radius: 20px;
}
.tpl-visionary .domain-card:hover { border-color: var(--primary); transform: translateY(-8px); }
.tpl-visionary .domain-name { color: white !important; font-family: 'Inter', sans-serif; }
.tpl-visionary .domain-price { color: var(--primary) !important; }

/* 2. ORGANIC MINIMALISM (Luxury/Skincare Inspired) */
.tpl-organic { background: #FFFAF5; color: #1e293b; }
.tpl-organic .marketplace-hero {
    background: #f8fafc !important;
    color: #1e293b !important;
    padding: 10vw 5% !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border);
}
.tpl-organic h1 {
    letter-spacing: -0.04em !important;
    color: #1e293b;
    font-weight: 300 !important;
    font-style: italic;
    font-family: 'Serif', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem) !important;
}
.tpl-organic #store-logo-main {
    border: 1px solid var(--border) !important;
    background: white !important;
    color: var(--slate-900) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03) !important;
    border-radius: 50% !important;
}
.tpl-organic .domain-card {
    border: 1px solid rgba(0,0,0,0.03);
    background: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.02);
    border-radius: 32px;
}
.tpl-organic .domain-card:hover { box-shadow: 0 30px 60px rgba(0,0,0,0.05); }

/* 3. DYNAMIC FLOW (Sport/Energy Inspired) */
.tpl-dynamic { background: white; }
.tpl-dynamic .marketplace-hero {
    background: linear-gradient(115deg, #4f46e5 0%, #7c3aed 100%) !important;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    padding: 12vw 5% 18vw !important;
    border-radius: 0 !important;
}
.tpl-dynamic h1 {
    font-style: italic;
    font-weight: 950 !important;
    letter-spacing: -0.05em !important;
    transform: skewX(-6deg);
    font-size: clamp(3rem, 10vw, 7rem) !important;
    color: white;
}
.tpl-dynamic .domain-card {
    border: 3px solid #f1f5f9;
    border-radius: 0;
    transform: skewX(-2deg);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tpl-dynamic .domain-card:hover { 
    transform: skewX(-2deg) scale(1.05); 
    border-color: var(--primary); 
    box-shadow: 20px 20px 0 var(--primary-light);
}

/* 4. GLOSSY PREMIUM (Retail/Modern Inspired) */
.tpl-glossy { background: #f1f5f9; }
.tpl-glossy .marketplace-hero {
    background: radial-gradient(circle at center, #3b82f6 0%, #1d4ed8 100%) !important;
    border-radius: 0 0 100px 100px;
    padding: 14vw 5% !important;
}
.tpl-glossy .marketplace-hero::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/glass.png');
    opacity: 0.2; pointer-events: none;
}
.tpl-glossy h1 {
    font-weight: 900;
    font-size: clamp(2.5rem, 7vw, 5.5rem) !important;
    color: white;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.2));
}
.tpl-glossy .domain-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border-radius: 24px;
}
.tpl-glossy .domain-card:hover { 
    background: white; 
    border-color: var(--primary);
    transform: scale(1.02);
}

/* --- THEME SELECTOR UI --- */
.template-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 12px;
}
.template-option {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: white;
}
.template-option:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.template-option.active { border-color: var(--primary); background: var(--slate-50); box-shadow: 0 10px 15px -3px rgba(99,102,241,0.1); }
.template-option .preview-swatch { 
    width: 100%; height: 60px; border-radius: 8px; margin-bottom: 12px; 
    display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 0.8rem;
}
.template-option .label { font-size: 0.75rem; font-weight: 800; text-align: center; display: block; color: var(--slate-600); }
.template-option.active .label { color: var(--primary); }

/* --- Mobile Optimizations for Marketplace Storefronts --- */
@media (max-width: 768px) {
    .marketplace-hero { padding: 60px 20px !important; border-radius: 0 0 30px 30px !important; }
    .tpl-visionary h1, .tpl-organic h1, .tpl-dynamic h1, .tpl-glossy h1 { font-size: 2.5rem !important; letter-spacing: -1px !important; }
    #store-logo-main { width: 80px !important; height: 80px !important; font-size: 2rem !important; }
    .domain-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .tpl-dynamic .marketplace-hero { clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); }
    .tpl-glossy .marketplace-hero { border-radius: 0 0 50px 50px !important; }
}
