/* ================================================================
   criscuolo.online — Visualizador de HTML
   Segue: manual_de_marca.md
   ================================================================ */

:root {
    --brand-gold: #D4A843;
    --brand-gold-light: #E0BE6A;
    --brand-gold-dark: #B8922F;
    --brand-gradient: linear-gradient(135deg, #D4A843, #E0BE6A, #D4A843);
    --cta-gradient: linear-gradient(135deg, #D4A843, #B8922F);

    --bg-primary: #16161E;
    --bg-secondary: #1C1C26;
    --bg-card: rgba(24, 24, 32, 0.88);
    --bg-card-border: rgba(212, 168, 67, 0.12);
    --bg-card-border-hover: rgba(212, 168, 67, 0.3);
    --bg-input: #141420;
    --bg-hover: rgba(212, 168, 67, 0.08);
    --bg-editor: #0E0E16;

    --text-primary: #F2F0EB;
    --text-secondary: #9B978E;
    --text-muted: #6B6760;
    --text-accent: #D4A843;

    --color-success: #22C55E;
    --color-error: #EF4444;

    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 40px rgba(212, 168, 67, 0.1);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-button: 0 4px 15px rgba(212, 168, 67, 0.25);
    --shadow-button-hover: 0 6px 25px rgba(212, 168, 67, 0.35);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}
a { text-decoration: none; }

/* --- Fundo --- */
.bg-effects { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.5; animation: float 25s ease-in-out infinite; }
.orb-1 { width:600px;height:600px;background:radial-gradient(circle,rgba(212,168,67,.2),transparent 70%);top:-200px;right:-150px;animation-duration:22s; }
.orb-2 { width:500px;height:500px;background:radial-gradient(circle,rgba(184,146,47,.15),transparent 70%);bottom:200px;left:-150px;animation-duration:28s;animation-delay:-8s; }
.orb-3 { width:400px;height:400px;background:radial-gradient(circle,rgba(16,185,129,.08),transparent 70%);top:60%;right:10%;animation-duration:35s;animation-delay:-15s; }
.orb-4 { width:350px;height:350px;background:radial-gradient(circle,rgba(212,168,67,.1),transparent 70%);bottom:0;right:30%;animation-duration:30s;animation-delay:-20s; }
@keyframes float {
    0%,100% { transform: translate(0,0) scale(1); }
    25%  { transform: translate(30px,-40px) scale(1.05); }
    50%  { transform: translate(-20px,20px) scale(.95); }
    75%  { transform: translate(40px,10px) scale(1.02); }
}
.grid-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(rgba(212,168,67,.02) 1px, transparent 1px),
        linear-gradient(90deg,rgba(212,168,67,.02) 1px,transparent 1px);
    background-size: 60px 60px;
}

/* --- Mouse Glow --- */
.mouse-glow {
    position: fixed; width: 700px; height: 700px; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,168,67,0.07) 0%, rgba(212,168,67,0.025) 40%, transparent 70%);
    pointer-events: none; z-index: 1; top: 0; left: 0;
    transform: translate(-50%, -50%); will-change: left, top;
    opacity: 0; transition: opacity 0.4s ease;
}
.mouse-glow.visible { opacity: 1; }

/* --- Header --- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 0 24px;
    background: rgba(22,22,30,.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212,168,67,.08);
    transition: var(--transition);
}
.header.scrolled { background: rgba(22,22,30,.95); border-bottom-color: rgba(212,168,67,.15); }
.header-inner {
    max-width: 1100px; margin: 0 auto; height: 72px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-img-wrapper {
    width: 44px; height: 44px;
    background: radial-gradient(circle,rgba(255,255,255,.95) 60%,rgba(255,255,255,.6) 80%,transparent 100%);
    border-radius: 50%; padding: 5px;
    box-shadow: 0 0 16px rgba(212,168,67,.15);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: var(--transition);
}
.logo-img-wrapper:hover { box-shadow: 0 0 24px rgba(212,168,67,.25); }
.logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.logo-text-group { display: flex; align-items: baseline; }
.logo-text { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.logo-text-accent { font-size: 1.25rem; font-weight: 800; color: var(--brand-gold); letter-spacing: -0.02em; }

.nav { display: flex; align-items: center; gap: 8px; }
.nav-link { font-size: .9rem; font-weight: 600; color: var(--text-secondary); padding: 8px 14px; border-radius: var(--border-radius-xs); transition: var(--transition); }
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link-active { color: var(--brand-gold) !important; background: rgba(212,168,67,.08); }
.nav-cta { font-size: .9rem; font-weight: 700; color: #0C0C0E; background: var(--cta-gradient); padding: 9px 18px; border-radius: var(--border-radius-sm); box-shadow: var(--shadow-button); transition: var(--transition); margin-left: 8px; }
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-button-hover); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }

/* --- Utilitários --- */
.gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-label { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-gold); margin-bottom: 6px; }

/* --- Animações --- */
@keyframes fadeDown { from{opacity:0;transform:translateY(-15px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeUp   { from{opacity:0;transform:translateY(20px)}  to{opacity:1;transform:translateY(0)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* --- Breadcrumb --- */
.breadcrumb {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .82rem; font-weight: 600; color: var(--text-muted);
    padding: 4px 0; margin-bottom: 8px;
    transition: var(--transition);
}
.breadcrumb:hover { color: var(--brand-gold); }

/* ================================================================
   PAGE MAIN — viewer ocupa toda a altura disponível
   ================================================================ */
.viewer-main {
    padding-top: 72px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* --- Hero Compacto --- */
.page-hero-compact {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--bg-card-border);
    flex-shrink: 0;
    animation: fadeDown .5s ease both;
}
.hero-inner-row {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.hero-left { display: flex; flex-direction: column; }
.hero-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-title {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}
.hero-subtitle-sm {
    font-size: .88rem;
    color: var(--text-secondary);
    max-width: 360px;
    line-height: 1.5;
    flex-shrink: 0;
}

/* ================================================================
   VIEWER SECTION
   ================================================================ */
.viewer-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.viewer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 100%;
}

/* --- Toolbar --- */
.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-card-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 6px; }

.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(242,240,235,.05);
    border: 1px solid rgba(242,240,235,.1);
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-tool:hover { color: var(--text-primary); background: rgba(242,240,235,.1); border-color: rgba(242,240,235,.18); }
.btn-tool-primary { color: #0C0C0E; background: var(--cta-gradient); border-color: transparent; box-shadow: var(--shadow-button); font-weight: 700; }
.btn-tool-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-button-hover); color: #0C0C0E; background: var(--cta-gradient); }
.btn-tool-icon { padding: 7px 10px; }
.btn-tool.copied { color: var(--color-success); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }

/* Mobile tabs */
.view-tabs {
    display: none;
    background: rgba(22,22,30,.6);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-sm);
    padding: 3px;
    gap: 2px;
}
.view-tab {
    padding: 5px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}
.view-tab.active { color: var(--text-primary); background: rgba(212,168,67,.12); }

/* --- Painel duplo --- */
.viewer-panes {
    display: flex;
    flex: 1;
    min-height: 0;
}
.pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* --- Cabeçalho do painel --- */
.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(22,22,30,.7);
    border-bottom: 1px solid var(--bg-card-border);
    flex-shrink: 0;
}
.pane-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.pane-title svg { color: var(--brand-gold); opacity: .7; }
.pane-live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
}
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}
.live-dot.active {
    background: var(--color-success);
    animation: pulse 1.5s ease-in-out infinite;
}
.pane-status {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Editor --- */
.pane-editor {
    border-right: 1px solid var(--bg-card-border);
}
.code-editor {
    flex: 1;
    min-height: 0;
    width: 100%;
    background: var(--bg-editor);
    color: #E0D9C8;
    font-family: var(--font-mono);
    font-size: .88rem;
    line-height: 1.7;
    padding: 16px 20px;
    border: none;
    outline: none;
    resize: none;
    tab-size: 2;
    -webkit-tab-size: 2;
    caret-color: var(--brand-gold);
}
.code-editor::placeholder { color: var(--text-muted); }
.code-editor:focus { background: #0B0B12; }
.pane-footer {
    padding: 6px 16px;
    background: rgba(14,14,22,.8);
    border-top: 1px solid var(--bg-card-border);
    flex-shrink: 0;
}
.line-info {
    font-size: .72rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Divisor arrastável --- */
.pane-divider {
    width: 6px;
    background: var(--bg-card-border);
    cursor: col-resize;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
    position: relative;
}
.pane-divider:hover,
.pane-divider.dragging { background: rgba(212,168,67,.25); }
.divider-handle {
    width: 2px;
    height: 32px;
    border-radius: 2px;
    background: rgba(212,168,67,.3);
    transition: var(--transition);
}
.pane-divider:hover .divider-handle,
.pane-divider.dragging .divider-handle { background: var(--brand-gold); height: 48px; }

/* --- Preview --- */
.preview-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #fff;
}
#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-primary);
    color: var(--text-muted);
    text-align: center;
    padding: 32px;
    transition: opacity .3s ease;
}
.preview-empty.hidden { opacity: 0; pointer-events: none; }
.preview-empty svg { opacity: .25; }
.preview-empty p { font-size: .9rem; line-height: 1.6; }
.btn-empty-sample {
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    color: var(--brand-gold);
    background: rgba(212,168,67,.1);
    border: 1px solid rgba(212,168,67,.2);
    border-radius: var(--border-radius-xs);
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-empty-sample:hover { background: rgba(212,168,67,.18); border-color: rgba(212,168,67,.35); }

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(34,197,94,.95);
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 8px 30px rgba(34,197,94,.3);
    z-index: 200;
    opacity: 0;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* --- Footer --- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--bg-card-border); padding: 32px 24px; flex-shrink: 0; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.footer-logo { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; transition: var(--transition); }
.footer-logo:hover { color: var(--brand-gold); }
.footer-accent { color: var(--brand-gold); }
.footer-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { font-size: .85rem; font-weight: 500; color: var(--text-muted); padding: 4px 10px; border-radius: var(--border-radius-xs); transition: var(--transition); }
.footer-nav a:hover { color: var(--text-primary); }
.footer-copy { font-size: .78rem; color: var(--text-muted); }

/* ================================================================
   RESPONSIVIDADE
   ================================================================ */
@media (max-width: 900px) {
    .hero-subtitle-sm { display: none; }
}

@media (max-width: 640px) {
    .nav { display: none; flex-direction: column; position: fixed; top: 72px; left: 0; right: 0; background: rgba(22,22,30,.97); backdrop-filter: blur(20px); padding: 16px; gap: 4px; border-bottom: 1px solid var(--bg-card-border); z-index: 99; }
    .nav.open { display: flex; }
    .nav-cta { margin-left: 0; text-align: center; }
    .nav-toggle { display: flex; }

    .page-hero-compact { padding: 14px 16px 12px; }
    .hero-inner-row { gap: 8px; }

    .viewer-toolbar { padding: 8px 12px; gap: 6px; }
    .btn-tool span { display: none; }
    .btn-tool { padding: 7px 10px; }
    .btn-tool-primary span { display: inline; }
    .view-tabs { display: flex; }

    /* Mobile: empilha os painéis verticalmente, toggle por aba */
    .viewer-panes { flex-direction: column; }
    .pane-divider { display: none; }
    .pane-editor { flex: 0 0 50%; border-right: none; border-bottom: 1px solid var(--bg-card-border); }
    .pane-preview { flex: 0 0 50%; }
    .pane.pane-hidden { display: none; }
}

@media (max-width: 420px) {
    .page-title { font-size: 1.2rem; }
    .footer { padding: 24px 16px; }
}
