/* style.css - Design System Premium */
:root {
    --bg-color: #0d0d0f;
    --surface: #18181c;
    --surface-hover: #212126;
    --border: #2c2c34;
    --primary: #00e5ff;
    --primary-glow: rgba(0, 229, 255, 0.4);
    --secondary: #6200ea;
    --danger: #ff3d00;
    --text-main: #f0f0f4;
    --text-muted: #8e8e9c;
    --font-family: 'Inter', sans-serif;
    --radius: 12px;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --success: #00e676;
    --warning: #ffd600;
    --shadow-premium: 0 20px 40px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-color); color: var(--text-main); font-family: var(--font-family); min-height: 100vh; display: flex; flex-direction: column; }

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 2rem; background: rgba(24, 24, 28, 0.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 800; color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); }

.marquee-container { flex: 1; margin: 0 3rem; overflow: hidden; position: relative; white-space: nowrap; border-radius: 20px; background: rgba(0, 229, 255, 0.05); border: 1px solid rgba(0, 229, 255, 0.2); padding: 0.4rem 1rem; display: flex; align-items: center; }
.marquee-text { display: inline-block; animation: marqueeAnimation var(--marquee-speed, 60s) linear infinite; color: var(--marquee-color, var(--primary)); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1.5px; }
@keyframes marqueeAnimation { 0% { transform: translateX(100%); } 100% { transform: translateX(-110%); } }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { 
    color: var(--text-muted); 
    text-decoration: none; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.75rem; 
    letter-spacing: 0.5px;
    transition: all 0.3s ease; 
}
.nav-links a i { width: 16px; height: 16px; }
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }
.cart-trigger, .user-trigger, .logout-btn { cursor: pointer; display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); position: relative; }
.badge { position: absolute; top: -8px; right: -10px; background: var(--primary); color: var(--bg-color); font-size: 0.75rem; font-weight: 700; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

main { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; min-height: 500px; }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.5rem; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; transition: all 0.3s ease; font-family: var(--font-family); }
.btn-primary { background: var(--primary); color: var(--bg-color); box-shadow: 0 0 15px var(--primary-glow); }
.btn-secondary { background: var(--surface); color: var(--text-main); border: 1px solid var(--border); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: all 0.3s ease; }
.product-image { height: 180px; background: #111; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.product-info { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.8rem; }
.product-price { font-size: 1.4rem; font-weight: 700; color: var(--primary); }

.cart-sidebar { position: fixed; top: 0; right: -400px; width: 400px; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1000; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.5); }
.cart-sidebar.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.cart-items { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-footer { padding: 1.5rem; border-top: 1px solid var(--border); background: var(--surface-hover); }

.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 600px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-muted); cursor: pointer; }

#ai-chat-wrapper { position: fixed; bottom: 100px; right: 25px; width: 350px; height: 450px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; z-index: 1002; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.6); transition: all 0.4s ease; }
.ai-chat-minimized { opacity: 0; pointer-events: none; transform: translateY(20px) scale(0.9); }
#ai-chat-header { background: linear-gradient(135deg, var(--primary), #00bfa5); padding: 15px; color: #000; display: flex; justify-content: space-between; align-items: center; }
#ai-chat-body { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; background: #0b0b0b; }
.ai-msg { padding: 10px 14px; border-radius: 12px; font-size: 0.85rem; max-width: 85%; }
.ai-msg.bot { background: var(--surface); color: var(--text-main); align-self: flex-start; }
.ai-msg.user { background: var(--primary); color: #000; align-self: flex-end; }
#ai-chat-footer { padding: 10px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 8px; }

#ai-trigger { position: fixed; bottom: 25px; right: 25px; width: 65px; height: 65px; border-radius: 16px; cursor: pointer; z-index: 10001; }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 0; margin-top: auto; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; padding: 0 2rem; }
.footer-bottom { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 2rem; }

.fadeIn { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Simplified table for demo */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }

/* --- PLOTTER STUDIO PREMIUM LAYOUT --- */
.plotter-studio-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0b0b0d; color: #fff; z-index: 99999;
    display: flex; flex-direction: column; font-family: 'Inter', sans-serif;
}

.plotter-studio-overlay .header {
    height: 60px; background: #131316; border-bottom: 1px solid #2c2c34;
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}

.plotter-studio-overlay .main-layout {
    flex: 1; display: flex; overflow: hidden;
}

.plotter-studio-overlay .sidebar {
    width: 320px; background: #131316; border-right: 1px solid #2c2c34;
    display: flex; flex-direction: column; overflow: hidden;
}

.plotter-studio-overlay .canvas-area {
    flex: 1; background: #0b0b0d; position: relative;
    display: flex; flex-direction: column;
}

.plotter-studio-overlay .canvas-container {
    flex: 1; position: relative; overflow: auto;
    display: flex; align-items: center; justify-content: center;
    background: #0f172a;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.plotter-frame {
    background: #fff; position: relative; transition: all 0.2s ease;
    box-shadow: 0 0 50px rgba(0,0,0,0.5); border: 2px solid #334;
}

.piece-card {
    transition: all 0.2s ease; user-select: none;
}
.piece-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.piece-card.selected { border-color: var(--primary); background: rgba(0,229,255,0.05); }

.exit-studio-btn {
    background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 700;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

.spin { animation: spin 1s linear infinite; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0d0d0f; }
::-webkit-scrollbar-thumb { background: #2c2c34; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f4a; }

/* --- Barra de Busca / Filtros --- */
.search-bar { 
    background: var(--glass); 
    backdrop-filter: blur(20px); 
    padding: 1.5rem; 
    border-radius: 20px; 
    border: 1px solid var(--glass-border); 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 2rem; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
}

.search-bar select { 
    background: #d1d5db; 
    border: 1px solid #9ca3af; 
    color: #111827; 
    padding: 0.8rem; 
    border-radius: 12px; 
    font-size: 0.85rem; 
    font-weight: 700;
    outline: none; 
    transition: all 0.3s ease; 
    width: 100%;
}
.search-bar select option { background: #fff; color: #000; }

.search-bar select:hover { border-color: rgba(0,229,255,0.5); background: rgba(0,229,255,0.05); }
.search-bar select:focus { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }

.form-control {
    background: #f3f4f6;
    color: #111;
    border: 1px solid #d1d5db;
    padding: 10px;
    border-radius: 8px;
}
.filter-label { 
    font-size: 0.7rem; 
    font-weight: 800; 
    color: var(--primary); 
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
    text-transform: uppercase; 
    margin-bottom: 12px; 
    display: block; 
    letter-spacing: 2px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

/* Impressão de Relatórios Profissionais (Ordem de Serviço A4) */
@media print {
    /* Forçar cores e fontes para impressão */
    * { 
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important; 
        text-shadow: none !important;
        box-shadow: none !important;
    }

    /* Esconder elementos de UI que não pertencem ao documento */
    .navbar, .site-footer, .no-print, #ai-trigger, #ai-chat-wrapper, .marquee-container, 
    .modal-close, #sidebar-overlay, .cart-sidebar, main#app-container, .btn, .btn-primary, .btn-secondary { 
        display: none !important; 
    }

    /* Resetar body e html para ocupar toda a página branca */
    html, body { 
        background-color: #fff !important; 
        color: #000 !important; 
        height: auto !important; 
        overflow: visible !important; 
        margin: 0 !important; 
        padding: 0 !important;
        font-family: 'Inter', 'Serif', sans-serif !important;
    }

    /* Garantir que o modal não corte o conteúdo */
    .modal {
        position: static !important;
        display: block !important;
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        backdrop-filter: none !important;
    }

    .modal-content { 
        border: none !important; 
        background: #fff !important; 
        width: 100% !important; 
        max-width: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important; 
        max-height: none !important; 
        overflow: visible !important; 
        display: block !important;
    }

    /* Layout da Área de Impressão */
    #print-area { 
        display: block !important;
        width: 210mm !important; /* Largura padrão A4 */
        min-height: 297mm !important;
        margin: 0 auto !important;
        padding: 15mm !important;
        background: #fff !important;
        color: #000 !important;
    }

    /* Tabelas e Dados */
    table { 
        width: 100% !important; 
        border-collapse: collapse !important; 
        margin-bottom: 20pt !important;
        background: #fff !important;
    }
    th, td { 
        border: 1pt solid #000 !important; 
        padding: 8pt !important; 
        font-size: 9pt !important;
        color: #000 !important;
    }
    th { background: #f0f0f0 !important; font-weight: bold !important; }

    /* Galeria de Fotos na Impressão */
    .print-photo-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10pt !important;
        margin-top: 10pt !important;
    }
    .print-photo-item {
        width: 100% !important;
        aspect-ratio: 1.2 !important;
        border: 1pt solid #000 !important;
        object-fit: cover !important;
        border-radius: 4pt !important;
    }

    /* Forçar quebras de página controladas */
    .page-break-avoid { break-inside: avoid !important; }
    .page-break-before { break-before: page !important; }

    /* Footer de Impressão */
    .print-footer {
        margin-top: 30pt !important;
        padding-top: 10pt !important;
        border-top: 1pt dashed #000 !important;
        font-size: 8pt !important;
        text-align: center !important;
        opacity: 0.6 !important;
    }
}

/* --- CLIENT DASHBOARD ENHANCEMENTS --- */
.dashboard-client-header { margin-bottom: 2.5rem; }
.dashboard-client-header h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }

.stat-card-premium {
    background: linear-gradient(145deg, #18181c, #131316);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.stat-card-premium::after {
    content: ''; position: absolute; top: 0; right: 0; width: 100px; height: 100px;
    background: var(--primary); opacity: 0.03; filter: blur(40px);
}

.recent-activity-header { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; margin-bottom: 1.5rem; }

.activity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.2rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s ease;
}
.activity-card:hover { border-color: var(--primary); transform: translateX(5px); background: var(--surface-hover); }

.activity-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: rgba(0, 229, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}

.support-banner {
    margin-top: 4rem;
    background: linear-gradient(90deg, rgba(98,0,234,0.1), rgba(0,229,255,0.05));
    border: 1px solid rgba(0,229,255,0.1);
    padding: 2.5rem;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

/* --- STORE PRODUCT CARD (DETAIL VIEW) --- */
.product-card-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(145deg, #18181c, #111114);
}
.product-card-detail:hover { border-color: var(--primary); transform: translateY(-10px); box-shadow: var(--shadow-premium); }

.product-image-container {
    height: 220px;
    background: #000;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--border);
}
.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card-detail:hover .product-image-container img {
    transform: scale(1.05);
}

.thermometer-container {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}
.thermometer-liquid {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

.filter-step {
    position: relative;
    display: flex;
    flex-direction: column;
}
/* Categorização sem números - solicitado pelo usuário */

.price-tag-premium {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.product-image-container {
    height: 240px;
    background: #000;
    position: relative;
    overflow: hidden;
}
.product-image-container img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: transform 0.5s; }
.product-card-detail:hover .product-image-container img { transform: scale(1.1); opacity: 1; }

.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 1rem 0;
}
.spec-item {
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.spec-label { display: block; font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; font-weight: 800; margin-bottom: 4px; }
.spec-value { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }

.paused-alert {
    background: rgba(255, 61, 0, 0.1);
    border: 1px solid rgba(255, 61, 0, 0.3);
    color: #ff3d00;
    padding: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-add-cart-large {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #000;
    font-weight: 900;
    letter-spacing: 1px;
    border-radius: 14px;
    box-shadow: 0 10px 20px var(--primary-glow);
    margin-top: auto;
}
.btn-add-cart-large:disabled { background: var(--border); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }

/* CRM Styles */
.crm-table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}



/* CRM Checklist Styles */
.checklist-section { border-top: 1px dashed var(--border); margin-top: 2rem; padding-top: 1.5rem; }
.checklist-windows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.window-btn { 
    background: var(--surface); border: 1px solid var(--border); padding: 8px; border-radius: 8px; 
    font-size: 0.7rem; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: 0.3s;
}
.window-btn.active { border-color: var(--success); background: rgba(0,230,118,0.1); color: var(--success); }
.window-btn.fail { border-color: var(--danger); background: rgba(255,61,0,0.1); color: var(--danger); }

.fuel-selector { display: flex; gap: 5px; margin-top: 5px; }
.fuel-opt { 
    flex: 1; text-align: center; font-size: 0.6rem; padding: 6px; border: 1px solid var(--border); border-radius: 6px; 
    cursor: pointer; background: var(--surface); color: var(--text-muted); font-weight: 700;
}
.fuel-opt.active { background: var(--primary); color: #000; border-color: var(--primary); }

.photo-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.photo-preview-item { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }


/* --- RESPONSIVIDADE E AJUSTES PREMIUM --- */
@media (max-width: 900px) {
    .navbar { padding: 1rem; flex-direction: column; gap: 15px; }
    .marquee-container { margin: 0; width: 100%; order: 3; }
    .nav-links { width: 100%; justify-content: space-around; font-size: 0.8rem; }
}

@media (max-width: 600px) {
    .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .user-trigger span { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
}

.product-card-detail {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, #18181c, #0f0f12);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.product-card-detail:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.price-tag-premium {
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Melhoria no scroll e transições */
* { transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease; }
