/* Localização: /scanner/assets/css/scanner.css */
/* Nome: scanner.css */
/* Linguagem: CSS, Bootstrap 5 */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-family-base);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

/* NAVBAR */
.brand-icon {
    width: 40px; height: 40px;
    background: var(--primary-500);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff;
}
.brand-name { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--text-inverse); }
.brand-sub  { font-size: var(--font-size-xs); color: var(--primary-300); line-height:1; }

.status-pill {
    display: flex; align-items: center; gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--secondary-300);
    background: rgba(74,148,104,0.12);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(74,148,104,0.3);
}
.status-pill .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--secondary-400);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { opacity:1; } 50% { opacity:0.4; }
}

.btn-offcanvas-toggle {
    background: transparent; border: 1px solid rgba(255,255,255,0.2);
    color: #fff; border-radius: var(--radius-md);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer;
    transition: background 0.2s;
}
.btn-offcanvas-toggle:hover { background: rgba(255,255,255,0.1); }

/* OFFCANVAS MENU */
.nav-link-menu {
    display: flex; align-items: center; gap: 10px;
    padding: var(--space-3) var(--space-4);
    color: var(--primary-300);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: background 0.15s, color 0.15s;
}
.nav-link-menu:hover, .nav-link-menu.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-inverse);
}
.nav-link-menu.text-danger { color: #f87171 !important; }
.nav-link-menu.text-danger:hover { background: rgba(248,113,113,0.1); }

/* HERO */
.scan-hero {
    background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-800) 60%, #0f2d1a 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-12);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.scan-hero::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31,95,153,0.25) 0%, transparent 70%);
}
.scan-hero::after {
    content: '';
    position: absolute; bottom: -40px; left: 30%;
    width: 300px; height: 150px;
    background: radial-gradient(ellipse, rgba(74,148,104,0.12) 0%, transparent 70%);
}
.scan-hero-inner { position: relative; z-index: 1; }

.scan-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-inverse);
    margin: 0 0 var(--space-1);
}
.scan-subtitle {
    font-size: var(--font-size-sm);
    color: var(--primary-300);
    margin: 0;
}

.scan-input-prefix {
    background: var(--primary-700);
    border: 1px solid var(--primary-600);
    border-right: none;
    color: var(--primary-300);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.scan-input {
    background: var(--primary-700);
    border: 1px solid var(--primary-600);
    border-left: none; border-right: none;
    color: var(--text-inverse);
    font-size: var(--font-size-md);
    font-family: 'Courier New', monospace;
}
.scan-input:focus {
    background: var(--primary-600);
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--focus-ring);
    color: var(--text-inverse);
}
.scan-input::placeholder { color: var(--primary-400); }

.btn-scan {
    background: var(--primary-500);
    border: 1px solid var(--primary-400);
    color: #fff;
    font-weight: var(--font-weight-semibold);
    padding: 0 var(--space-6);
    display: flex; align-items: center; gap: 8px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-scan:hover { background: var(--primary-400); color: #fff; }
.btn-scan:disabled { background: var(--primary-800); border-color: var(--primary-700); color: var(--primary-600); cursor: not-allowed; }

.scan-meta {
    display: flex; gap: var(--space-5);
    flex-wrap: wrap;
    font-size: var(--font-size-xs);
    color: var(--primary-400);
}
.scan-meta span { display: flex; align-items: center; gap: 5px; }

/* PROGRESS */
.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}
.progress-track {
    height: 6px;
    background: var(--neutral-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}
.progress-steps {
    display: flex; gap: var(--space-3); flex-wrap: wrap;
}
.step-item {
    display: flex; align-items: center; gap: 6px;
    font-size: var(--font-size-xs);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    transition: all 0.3s;
}
.step-item.done    { background: var(--secondary-50); color: var(--status-success); border-color: var(--secondary-200); }
.step-item.running { background: var(--primary-50);   color: var(--primary-500);   border-color: var(--primary-200);   }
.step-item.error   { background: #fff1f1;              color: var(--status-error);  border-color: #fecaca; }

.scan-spinner { font-size: 1.4rem; color: var(--primary-500); }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* SCORE */
.score-card {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-align: center;
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 160px;
}
.score-label { font-size: var(--font-size-xs); color: var(--primary-300); text-transform: uppercase; letter-spacing: 0.08em; }
.score-value { font-size: 3.5rem; font-weight: var(--font-weight-bold); color: #fff; line-height: 1.1; }
.score-grade { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
.score-target { font-size: var(--font-size-xs); color: var(--primary-400); margin-top: 4px; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100px;
    box-shadow: var(--shadow-xs);
}
.stat-icon { font-size: 1.4rem; margin-bottom: var(--space-2); }
.stat-number { font-size: 1.8rem; font-weight: var(--font-weight-bold); line-height: 1; }
.stat-label { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-top: 4px; }

.stat-critical .stat-icon, .stat-critical .stat-number { color: #dc2626; }
.stat-critical { border-top: 3px solid #dc2626; }
.stat-high .stat-icon, .stat-high .stat-number { color: var(--status-warning); }
.stat-high { border-top: 3px solid var(--status-warning); }
.stat-medium .stat-icon, .stat-medium .stat-number { color: #d97706; }
.stat-medium { border-top: 3px solid #d97706; }
.stat-low .stat-icon, .stat-low .stat-number { color: var(--status-info); }
.stat-low { border-top: 3px solid var(--status-info); }

/* SECTION TITLE */
.section-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* RESULT CATEGORIES */
.result-category {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.category-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    transition: background 0.15s;
}
.category-header:hover { background: var(--neutral-50); }

.cat-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.cat-icon-blue   { background: var(--primary-50);   color: var(--primary-500); }
.cat-icon-green  { background: var(--secondary-50); color: var(--secondary-600); }
.cat-icon-purple { background: #f3e8ff; color: #7c3aed; }
.cat-icon-orange { background: #fff7ed; color: #ea580c; }
.cat-icon-red    { background: #fff1f1; color: #dc2626; }
.cat-icon-dark   { background: var(--neutral-100); color: var(--neutral-700); }

.cat-name { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--text-primary); }
.cat-desc { font-size: var(--font-size-xs); color: var(--text-tertiary); }

.cat-badge {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--neutral-100);
    color: var(--text-secondary);
}
.cat-badge.badge-ok       { background: var(--secondary-50); color: var(--status-success); }
.cat-badge.badge-warn     { background: #fff7ed; color: var(--status-warning); }
.cat-badge.badge-critical { background: #fff1f1; color: var(--status-error); }

.cat-toggle { font-size: 0.75rem; color: var(--text-tertiary); transition: transform 0.2s; }
.cat-toggle.open { transform: rotate(180deg); }

.category-body {
    border-top: 1px solid var(--border-subtle);
    display: none;
    padding: var(--space-4) var(--space-6);
}
.category-body.open { display: block; }

/* VULN ITEMS */
.vuln-item {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    margin-bottom: var(--space-3);
    background: var(--neutral-50);
}
.vuln-item:last-child { margin-bottom: 0; }

.vuln-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.vuln-name { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--text-primary); }
.vuln-desc { font-size: var(--font-size-xs); color: var(--text-secondary); margin-top: 2px; }

.severity-badge {
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
}
.sev-critical { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.sev-high     { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.sev-medium   { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.sev-low      { background: var(--primary-50); color: var(--primary-600); border: 1px solid var(--primary-200); }
.sev-ok       { background: var(--secondary-50); color: var(--secondary-700); border: 1px solid var(--secondary-200); }
.sev-info     { background: var(--neutral-50); color: var(--text-secondary); border: 1px solid var(--border-default); }

.vuln-fix {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-400);
}
.vuln-fix-label { font-size: 10px; font-weight: var(--font-weight-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-500); margin-bottom: 4px; }
.vuln-fix-text  { font-size: var(--font-size-xs); color: var(--text-secondary); line-height: 1.5; }
.vuln-fix-code  {
    font-size: 11px; font-family: 'Courier New', monospace;
    background: var(--neutral-900); color: #86efac;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
    overflow-x: auto; white-space: pre;
}

.found-value {
    font-size: 11px; font-family: 'Courier New', monospace;
    background: var(--neutral-100);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    display: inline-block;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* RELATÓRIO I.A. */
.ai-report-textarea {
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.45;
    background: var(--neutral-900);
    color: var(--secondary-200);
    border-color: var(--neutral-600);
    resize: vertical;
    min-height: 280px;
}
.ai-report-textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    color: var(--text-inverse);
}

/* PRINT */
@media print {
    .navbar, .btn-offcanvas-toggle, .btn-scan, .scan-hero, .scan-meta,
    [data-bs-toggle], button, #scan_ai_report { display: none !important; }
    .category-body { display: block !important; }
    .result-category { box-shadow: none; border: 1px solid #ddd; }
    body { background: #fff; }
}

@media (max-width: 768px) {
    .scan-hero { padding: var(--space-6) var(--space-4); }
    .scan-title { font-size: var(--font-size-xl); }
    .btn-scan span { display: none; }
    .scan-meta { gap: var(--space-3); }
    .status-pill { display: none; }
}
