/* public/simulador-style.css - VERSÃO MODERNIZADA HEWIRE */

:root {
    --bg-main: #080809;
    --bg-panel: #111113;
    --accent: #2979ff;
    --accent-glow: rgba(41, 121, 255, 0.2);
    --text-white: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
}

/* Scrollbar Customizada Sidebar */
.sim-sidebar::-webkit-scrollbar { width: 4px; }
.sim-sidebar::-webkit-scrollbar-track { background: transparent; }
.sim-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: 'Inter', sans-serif; /* Agora a fonte será carregada corretamente */
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    
    /* Suavização de fonte para telas de alta resolução (fiel à Home) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h2, label, .logo-text {
    font-family: 'Inter', sans-serif;
}

.sim-wrapper { 
    display: flex; 
    width: 100%; 
    height: 100%; 
}

/* Sidebar: Estética Hewire Admin */
.sim-sidebar {
    width: 350px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 32px;
    z-index: 10;
    flex-shrink: 0;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}

/* ========================================================== */
/* LOGO IDENTIDADE HEWIRE (IDENTICO A HOME)                   */
/* ========================================================== */

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center; /* Mantém centralizado na sidebar */
    gap: 12px;
    margin-bottom: 40px;
    text-decoration: none;
    color: #ffffff; /* Cor fixa para garantir o branco */
}

.nav-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo-text {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.03em; /* Valor exato do seu style.css */
    color: #ffffff;
}

.dot { 
    color: #00e676; /* O verde exato da Hewire */
}

.sim-sidebar h2 { 
    font-size: 1.4rem; 
    margin-bottom: 10px; 
    font-weight: 800; 
    letter-spacing: -0.03em; /* Identico a Home */
    line-height: 1.2;
    color: #ffffff;
}

/* Efeito de Degradê Identico a Home */
.gradient-text {
    background: linear-gradient(135deg, #2979ff 0%, #00e676 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Ajuste sutil na descrição abaixo do título */
.sim-sidebar p { 
    font-size: 0.85rem; 
    color: var(--text-dim); 
    margin-bottom: 30px; 
    letter-spacing: -0.01em;
}

/* Caixa de Aviso/Alerta Modernizada */
.sim-alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(41, 121, 255, 0.08); /* Azul Hewire bem suave */
    border: 1px solid rgba(41, 121, 255, 0.2);
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.sim-alert-box i {
    color: var(--accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sim-alert-box span {
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.sim-alert-box strong {
    color: var(--accent);
    font-weight: 700;
}

/* 1. Reset e Estilização Base dos Campos */
.sim-field input[type="text"], 
.sim-field select {
    width: 100%; 
    background: rgba(255, 255, 255, 0.03); /* Efeito Glassmorphism */
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 16px; 
    border-radius: 12px; 
    color: #ffffff; 
    outline: none;
    font-size: 14px;
    font-weight: 500;
    appearance: none; /* Remove estilo padrão do sistema */
}

/* 2. Customização do Select (Seta Moderna) */
.sim-field {
    position: relative;
}

.sim-field select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232979ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 45px;
}

/* 3. Estados de Hover e Focus */
.sim-field input[type="text"]:hover, 
.sim-field select:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(41, 121, 255, 0.3);
}

.sim-field input:focus, 
.sim-field select:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(41, 121, 255, 0.15);
}

/* 4. Modernização do Input de Cor */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.sim-field input[type="color"] {
    flex: 1;
    height: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    padding: 8px;
    transition: 0.2s;
}

.sim-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sim-field input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Botão de Reset de Cor */
.btn-reset-color {
    height: 50px;
    width: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.btn-reset-color:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.3);
    color: #ff6464;
}

.btn-reset-color:active {
    transform: scale(0.95);
}

/* Animação de entrada/saída do btn-reset-color */
@keyframes slideInReset {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideOutReset {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.7);
    }
}

.btn-reset-color:not([style*="display: none"]) {
    animation: slideInReset 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-reset-color.hiding {
    animation: slideOutReset 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 5. Refinamento dos Labels */
.sim-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-top: 10px;
    margin-bottom: 10px;
    opacity: 0.8;
}

/* Upload de Logo */
.custom-upload {
    position: relative;
    width: 100%;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.01);
    transition: all 0.2s ease;
}

.custom-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* Garante que os ícones fiquem abaixo do input invisível */
.custom-upload i {
    pointer-events: none; 
}

.custom-upload:hover { border-color: var(--accent); background: rgba(41, 121, 255, 0.03); }

.custom-upload.has-file { border-color: var(--accent); border-style: solid; background: rgba(41, 121, 255, 0.05); }
.custom-upload i.main-icon { font-size: 1.3rem; margin-bottom: 4px; color: var(--accent); opacity: 0.8; }
.custom-upload span { font-size: 0.7rem; color: var(--text-dim); font-weight: 500; pointer-events: none; }

.btn-remove-logo {
    position: absolute; top: -8px; right: -8px; background: #ff4d4d; color: white;
    border: none; border-radius: 50%; width: 22px; height: 22px;
    display: none; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Área de Visualização com Fundo Estilizado */
.sim-preview-area {
    flex: 1;
    background-color: #080808;
    background-image: radial-gradient(circle at 1px 1px, rgba(100, 100, 100, 0.3) 1px, transparent 0);
    background-size: 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Header de Controle "Flutuante" */
.preview-header {
    width: auto;
    background: rgba(18, 18, 20, 0.8);
    border: 1px solid var(--border);
    padding: 6px 15px;
    border-radius: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    z-index: 5;
}

/* Container do Toggle Modernizado */
.device-toggle {
    position: relative; /* Necessário para o indicador se mover lá dentro */
    display: flex; 
    background: rgba(255,255,255,0.05); 
    padding: 4px; 
    border-radius: 100px; 
    gap: 0; /* Tiramos o gap para o deslizamento ser contínuo */
    width: 240px; /* Largura fixa para precisão no cálculo */
}

/* O Indicador que desliza (A Pílula) */
.device-toggle-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px); /* Metade do container menos o padding */
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #2979ff 0%, #00e676 100%);
    border-radius: 100px;
    transition: transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* Efeito elástico sutil */
    z-index: 1;
}

/* Ajuste nos Botões */
.device-btn {
    position: relative;
    z-index: 2; /* Fica em cima da pílula */
    flex: 1;
    background: transparent !important; /* Removemos o fundo do botão */
    border: none; 
    color: var(--text-dim);
    padding: 8px 0; 
    border-radius: 100px; 
    cursor: pointer;
    font-size: 0.7rem; 
    font-weight: 700; 
    text-transform: uppercase;
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    transition: color 0.3s ease;
}

/* Cor do texto quando ativo */
.device-btn.active { 
    color: white; 
}

/* Estado de Mobile - Movemos o indicador para a direita */
.device-toggle.is-mobile #toggle-indicator {
    transform: translateX(100%);
}

.no-transition {
    transition: none !important;
}

.preview-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

/* ========================================================== */
/* BLOCO DO IFRAME (MANTIDO EXATAMENTE COMO SOLICITADO)       */
/* ========================================================== */

.iframe-container {
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

#preview-iframe {
    width: 1600px !important;
    height: 900px !important;
    border: none;
    border-radius: 20px;
    border: 2px solid #86868683;
    transform-origin: top center;
    opacity: 0;
}

.iframe-container.mobile #preview-iframe {
    width: 390px !important;
    height: 844px !important;
}

/* ========================================================== */

.preview-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(41, 121, 255, 0.2);
    border-top-color: rgba(18, 179, 228, 1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.com-transicao {
    transition: opacity 0.5s ease;
}

/* Container do Rodapé da Sidebar */
.sim-footer-cta {
    margin-top: auto; /* Empurra para o final da sidebar se houver espaço */
    padding-top: 30px;
    text-align: center;
}

/* Texto de Chamada para Orçamento */
.sim-cta-description {
    font-size: 0.85rem;
    color: var(--text-white);
    margin-bottom: 20px;
    line-height: 1.5;
    opacity: 0.9;
}

.sim-cta-description strong {
    color: var(--accent); /* Cor destaque no orçamento gratuito */
    display: block; /* Dá ênfase colocando em uma nova linha */
    font-size: 1rem;
}

/* Botão WhatsApp Modernizado */
.btn-whatsapp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #2979ff 0%, #00e676 100%);
    color: white;
    text-decoration: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(41, 121, 255, 0.2);
}

.btn-whatsapp-cta i {
    font-size: 1.4rem;
}

.btn-whatsapp-cta:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 10px 25px rgba(41, 121, 255, 0.4);
}

/* BOTÕES MOBILE */
.mobile-menu-btn { display: none; }
.btn-close-sidebar { display: none; }

/* RESPONSIVIDADE MOBILE (DESIGN DA SIDEBAR) */
@media (max-width: 768px) {
    .sim-wrapper { flex-direction: column; }

    .sim-sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        z-index: 2000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: none;
        padding-top: 20px;
    }

    .sim-sidebar.active { transform: translateY(0); }

    .btn-close-sidebar {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border);
        color: white; padding: 12px; width: 100%;
        border-radius: 8px; margin-bottom: 20px;
        cursor: pointer; font-weight: 600;
    }

    .sim-preview-area { width: 100%; height: 100vh; padding: 10px; }

    .preview-header { position: relative; z-index: 10; margin-bottom: 10px; padding: 5px 10px; }

    .preview-badge { display: none; }

    .mobile-menu-btn {
        display: flex; align-items: center; gap: 6px;
        background: var(--bg-panel); border: 1px solid var(--border);
        color: var(--accent); padding: 6px 12px; border-radius: 100px;
        cursor: pointer; font-weight: 600; font-size: 0.75rem;
    }

    .sim-footer-cta {
        margin-top: 20px;
        padding-bottom: 20px;
    }
}