/* --- WELUCCI STUDIO - DESIGN SYSTEM V3.0 --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Montserrat:wght@400;600;700&display=swap');

:root {
    /* Cores Oficiais */
    --w-brand: #9D1B55;      /* Vinho Welucci (Substitui o antigo --primary) */
    --w-brand-dark: #720D3A; /* Vinho Escuro */
    --w-black: #1a1a1a;
    --w-gray: #f8f9fa;
    
    /* Mantendo compatibilidade com códigos antigos que usam --primary */
    --primary: var(--w-brand); 
    --primary-dark: var(--w-brand-dark);

    /* Cores de Fundo e Texto */
    --bg-dark: #0a0a0a;
    --bg-panel: #161616;
    --border: #333333;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #020617; /* Fundo Ultra Dark */
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* --- LAYOUT GRID (SIDEBAR | EDITOR | PREVIEW) --- */
.app-container {
    display: grid;
    grid-template-columns: 60px 400px 1fr; /* Icon Menu | Painel Edição | Preview */
    height: 100vh;
}

/* 1. MINI SIDEBAR (Ícones) */
.mini-sidebar {
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 20;
}

.brand-icon {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.nav-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 10px;
    transition: 0.2s;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 0 15px rgba(99, 102, 241, 0.4); }
.nav-item.beta {
    opacity: 0.2;               /* Visibilidade baixa */
    filter: blur(1.5px);        /* Efeito turvo */
    cursor: not-allowed;        /* Cursor de proibido */
    pointer-events: none;       /* Impede cliques acidentais */
    margin-top: auto;           /* Empurra para o final se houver espaço (opcional) */
}

/* 2. PAINEL DE EDIÇÃO (Scrollável) */
.editor-panel {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.editor-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 5px;
}
.editor-header p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 25px; }

/* Formulários Modernos */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.input-modern {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 6px;
    color: white;
    font-family: 'Inter', sans-serif;
    transition: 0.3s;
}
.input-modern:focus { border-color: var(--primary); background: rgba(0,0,0,0.4); }

/* SELETOR VISUAL DE TEMAS (GALLERY) */
.theme-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.theme-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.theme-card:hover { transform: translateY(-3px); background: rgba(255,255,255,0.1); }
.theme-card.active { border-color: var(--primary); background: rgba(99, 102, 241, 0.1); }

.theme-preview {
    height: 80px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.theme-name { font-size: 0.85rem; font-weight: 600; }

/* Botão Salvar */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: auto;
    transition: 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }

/* 3. PREVIEW AREA (O Palco) */
.preview-area {
    background: #290018;
    background-image: radial-gradient(#1e293b 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Toolbar do Preview (Mobile/Desktop) */
.preview-toolbar {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 30px;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.device-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 50%;
    transition: 0.2s;
}
.device-btn.active { color: white; background: rgba(255,255,255,0.1); }

/* O Iframe (Site Real) */
.device-frame {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.5);
    border-radius: 8px;
    border: 4px solid #333;
    background: white;
}

.device-frame.desktop { width: 90%; height: 85%; }
.device-frame.mobile { width: 375px; height: 80%; border-radius: 30px; border: 8px solid #333; }

iframe { width: 100%; height: 100%; border: none; border-radius: inherit; }

/* LOADING EFFECT */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.loading-overlay.visible { opacity: 1; pointer-events: auto; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* CLASSES UTILITÁRIAS PARA JS */
.hidden { display: none !important; }

/* --- BOTÕES DE AÇÃO DO SLUG --- */
.slug-actions {
    display: flex;
    gap: 10px;
}

.slug-actions input {
    flex-grow: 1; /* O input ocupa o máximo de espaço */
}

.btn-icon {
    width: 44px; /* Altura igual ao input */
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.btn-icon.highlight {
    background: rgba(157, 27, 85, 0.2); /* Tom avermelhado Welucci */
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon.highlight:hover {
    background: var(--primary);
    color: white;
}

/* --- 📱 MOBILE RESPONSIVENESS (WELUCCI OS) --- */

@media (max-width: 900px) {
    /* 1. LAYOUT GERAL (Builder & Dashboard) */
    .app-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    /* 2. SIDEBAR -> BOTTOM NAV */
    .mini-sidebar {
        order: 3; /* Vai para baixo */
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        background: #0a0a0a;
        z-index: 100;
    }
    .mini-sidebar .brand-icon, 
    .mini-sidebar .nav-item.beta { display: none; } /* Esconde logo e itens extras */
    
    .nav-item {
        margin-bottom: 0;
        width: auto;
        flex: 1;
        height: 100%;
        border-radius: 0;
    }

    /* 3. PAINÉIS DE EDIÇÃO */
    .editor-panel {
        order: 2;
        width: 100%;
        height: 50%; /* Divide a tela */
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 15px;
    }
    
    /* 4. PREVIEW AREA */
    .preview-area {
        order: 1;
        height: 50%; /* Divide a tela */
        width: 100%;
        padding: 10px;
        background-size: 10px 10px; /* Grid menor */
    }
    
    /* Esconde botões de dispositivo no mobile (já é mobile) */
    .preview-toolbar { display: none; }
    
    /* Frame ocupa 100% da área disponível */
    .device-frame.desktop, .device-frame.mobile {
        width: 100% !important;
        height: 100% !important;
        border: none;
        border-radius: 8px;
        box-shadow: none;
    }

    /* 5. DASHBOARD RESPONSIVO */
    .sidebar { display: none; } /* Esconde sidebar desktop */
    .main-content { margin-left: 0; width: 100%; padding: 20px; padding-bottom: 80px; }
    .mobile-header { display: flex; } /* Mostra header mobile */
    
    .services-grid { grid-template-columns: 1fr; } /* Cards empilhados */
    
    /* Ajuste de Modais para Mobile */
    .admin-modal, .checkout-modal {
        width: 95% !important;
        max-height: 85vh;
    }
}

/* --- NEW ONBOARDING WIZARD (CLEAN) --- */
.wizard-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    z-index: 3000;
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.wizard-overlay.active { display: flex; opacity: 1; }

.wizard-card {
    background: #fff;
    width: min(500px, 95%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    display: flex; flex-direction: column;
}

/* Header com Barra de Progresso */
.wizard-header {
    padding: 30px 40px 10px;
    text-align: center;
}
.wizard-logo { height: 30px; opacity: 0.8; margin-bottom: 15px; }
.wizard-progress {
    display: flex; justify-content: center; gap: 8px; margin-bottom: 20px;
}
.p-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #eee;
    transition: 0.3s ease;
}
.p-dot.active { background: var(--w-brand); transform: scale(1.2); }
.p-dot.done { background: var(--w-brand); opacity: 0.5; }

/* Corpo do Wizard */
.wizard-body {
    padding: 10px 40px 30px;
    flex: 1;
}
.step-container { display: none; animation: fadeInRight 0.4s ease; }
.step-container.active { display: block; }

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.wizard-title {
    font-family: 'Playfair Display', serif; font-size: 1.8rem; color: #1a1a1a;
    margin-bottom: 10px; text-align: center;
}
.wizard-desc {
    color: #666; font-size: 0.9rem; text-align: center; margin-bottom: 30px; line-height: 1.5;
}

/* Inputs Elegantes */
.input-floating { margin-bottom: 20px; position: relative; }
.input-floating label {
    font-size: 0.75rem; font-weight: 700; color: var(--w-brand);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block;
}
.input-clean {
    width: 100%; padding: 14px 16px;
    border: 1px solid #e0e0e0; border-radius: 12px;
    font-size: 1rem; color: #333; background: #fafafa;
    transition: 0.3s;
}
.input-clean:focus {
    border-color: var(--w-brand); background: #fff;
    box-shadow: 0 0 0 4px rgba(157, 27, 85, 0.1);
}

/* Link Preview Card */
.link-preview {
    background: #f8f9fa; border: 1px dashed #ccc; border-radius: 12px;
    padding: 15px; display: flex; align-items: center; gap: 10px;
    color: #555; font-size: 0.9rem; margin-top: -10px; margin-bottom: 20px;
}
.link-preview i { color: var(--w-brand); }

/* Theme Selection Grid */
.theme-select-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
}
.theme-opt {
    border: 2px solid transparent; border-radius: 12px;
    cursor: pointer; overflow: hidden; transition: 0.2s;
    background: #f9f9f9; text-align: center; padding-bottom: 10px;
}
.theme-opt:hover { transform: translateY(-3px); }
.theme-opt.selected { border-color: var(--w-brand); background: #fff; box-shadow: 0 10px 30px rgba(157, 27, 85, 0.1); }
.theme-color { height: 60px; width: 100%; margin-bottom: 10px; }
.theme-opt h5 { font-size: 0.9rem; margin: 0; color: #333; }

/* Footer Actions */
.wizard-footer {
    padding: 20px 40px 30px;
    display: flex; justify-content: space-between; align-items: center;
}
.btn-text { background: none; border: none; color: #999; cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.btn-text:hover { color: #666; }

.btn-brand {
    background: var(--w-brand); color: white; border: none;
    padding: 12px 30px; border-radius: 50px; font-weight: 600; font-size: 1rem;
    cursor: pointer; transition: 0.3s; box-shadow: 0 5px 20px rgba(157, 27, 85, 0.3);
    display: flex; align-items: center; gap: 8px;
}
.btn-brand:hover { transform: translateY(-2px); background: #720D3A; }
.btn-brand:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }