:root {
    --bg-dark: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --border: #1e293b;
    --text: #e2e8f0;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --green: #22c55e;
    --yellow: #eab308;
    --orange: #f97316;
    --red: #ef4444;
    --critical: #dc2626;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 24px;
    font-size: 0.9rem;
    transition: color 0.2s;
}
nav a:hover { color: var(--text); }

/* Hero */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Scan Form */
.scan-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 12px;
}

.scan-form input {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.scan-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.scan-form input::placeholder { color: var(--text-muted); }

.btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Status */
.scan-status {
    display: none;
    max-width: 600px;
    margin: 30px auto 0;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.status-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Results */
.results {
    display: none;
    padding: 40px 0 80px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* Grade */
.grade-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    border: 3px solid;
}

.grade-A, .grade-A\+ { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.1); }
.grade-B { border-color: var(--yellow); color: var(--yellow); background: rgba(234,179,8,0.1); }
.grade-C { border-color: var(--orange); color: var(--orange); background: rgba(249,115,22,0.1); }
.grade-D, .grade-F { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.1); }

/* Severity Cards */
.severity-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.severity-item {
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    flex: 1;
    min-width: 100px;
}

.severity-count {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
}

.severity-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sev-critical .severity-count { color: var(--critical); }
.sev-high .severity-count { color: var(--red); }
.sev-medium .severity-count { color: var(--orange); }
.sev-low .severity-count { color: var(--yellow); }
.sev-info .severity-count { color: var(--accent); }

/* Module Cards */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s;
}

.module-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.module-name {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-score {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.score-good { background: rgba(34,197,94,0.15); color: var(--green); }
.score-warn { background: rgba(234,179,8,0.15); color: var(--yellow); }
.score-bad { background: rgba(239,68,68,0.15); color: var(--red); }

.module-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.module-details dt { color: var(--text); font-weight: 500; margin-top: 8px; }
.module-details dd { margin-left: 0; }

/* Findings */
.findings-section h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.finding {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 8px;
    border-left: 4px solid;
}

.finding-critical { border-left-color: var(--critical); }
.finding-high { border-left-color: var(--red); }
.finding-medium { border-left-color: var(--orange); }
.finding-low { border-left-color: var(--yellow); }
.finding-info { border-left-color: var(--accent); }

.finding-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.finding-severity {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-critical { background: var(--critical); color: white; }
.badge-high { background: var(--red); color: white; }
.badge-medium { background: var(--orange); color: white; }
.badge-low { background: var(--yellow); color: #000; }
.badge-info { background: var(--accent); color: white; }

.finding-title { font-weight: 600; font-size: 0.95rem; }
.finding-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 4px; }
.finding-target { color: var(--accent); font-size: 0.8rem; font-family: monospace; }
.finding-recommendation { color: var(--green); font-size: 0.8rem; margin-top: 4px; }

.finding-guide-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.finding-guide-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Subdomain Section */
.subdomains-section {
    margin-bottom: 40px;
}

.subdomains-section h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.sub-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sub-stat {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
}

.sub-stat strong { color: var(--accent); margin-right: 4px; }

.sub-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sub-filter-btn {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-filter-btn:hover,
.sub-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.sub-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sub-table thead {
    background: var(--bg-card);
}

.sub-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.sub-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.sub-table tbody tr {
    transition: background 0.15s;
}

.sub-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.sub-table tbody tr:last-child td {
    border-bottom: none;
}

.sub-table .subdomain-name {
    font-weight: 500;
    color: var(--text);
    font-family: monospace;
    font-size: 0.82rem;
}

.sub-table .ip-cell {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sub-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.sub-badge-ok { background: rgba(34,197,94,0.15); color: var(--green); }
.sub-badge-warn { background: rgba(234,179,8,0.15); color: var(--yellow); }
.sub-badge-bad { background: rgba(239,68,68,0.15); color: var(--red); }
.sub-badge-off { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.sub-ports {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.sub-port-tag {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-family: monospace;
    background: rgba(59,130,246,0.1);
    color: var(--accent);
}

.sub-port-tag.risky {
    background: rgba(239,68,68,0.1);
    color: var(--red);
}

.sub-score-bar {
    width: 50px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.sub-score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.sub-row-dead { opacity: 0.4; }

.sub-detail-row td {
    padding: 0 14px 12px 14px;
    background: var(--bg-card);
}

.sub-detail-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    font-size: 0.8rem;
    padding: 12px 0;
}

.sub-detail-content dt { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; }
.sub-detail-content dd { color: var(--text); margin: 0 0 8px 0; }

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 40px 0 80px;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.feature:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature h3 { font-size: 1rem; margin-bottom: 8px; }
.feature p { font-size: 0.85rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.8rem; }
    .scan-form { flex-direction: column; }
    .btn { width: 100%; }
    .modules-grid { grid-template-columns: 1fr; }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toggle Switch */
.toggle-switch {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

#pentest-toggle:checked + .toggle-switch {
    background: var(--red);
}

#pentest-toggle:checked + .toggle-switch::after {
    left: 23px;
    background: white;
}

#deep-toggle:checked + .toggle-switch {
    background: #8b5cf6;
}

#deep-toggle:checked + .toggle-switch::after {
    left: 23px;
    background: white;
}

.module-card-deep {
    border: 1px solid #8b5cf6;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.08) 100%);
}

#advpentest-toggle:checked + .toggle-switch {
    background: #f43f5e;
}

#advpentest-toggle:checked + .toggle-switch::after {
    left: 23px;
    background: white;
}

.module-card-advpentest {
    border: 1px solid #f43f5e;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(244, 63, 94, 0.08) 100%);
}

/* Hacker Console */
.hacker-console {
    display: none;
    max-width: 800px;
    margin: 24px auto 0;
    background: #0c0c0c;
    border: 1px solid #1a3a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.08), inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.console-header {
    background: #111;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #1a3a1a;
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.console-dot.red { background: #ff5f57; }
.console-dot.yellow { background: #febc2e; }
.console-dot.green { background: #28c840; }

.console-title {
    flex: 1;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 1px;
}

.console-body {
    height: 320px;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    scrollbar-width: thin;
    scrollbar-color: #1a3a1a #0c0c0c;
}

.console-body::-webkit-scrollbar {
    width: 6px;
}

.console-body::-webkit-scrollbar-track {
    background: #0c0c0c;
}

.console-body::-webkit-scrollbar-thumb {
    background: #1a3a1a;
    border-radius: 3px;
}

.console-line {
    white-space: pre-wrap;
    word-break: break-all;
    animation: consoleFadeIn 0.15s ease-out;
}

@keyframes consoleFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.c-green { color: #00ff41; }
.c-red { color: #ff3333; }
.c-yellow { color: #ffcc00; }
.c-cyan { color: #00e5ff; }
.c-blue { color: #4488ff; }
.c-purple { color: #bb77ff; }
.c-gray { color: #555; }
.c-white { color: #ccc; }
.c-orange { color: #ff8800; }
.c-dim { color: #333; }
.c-bold { font-weight: bold; }

.console-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #00ff41;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.console-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 255, 65, 0.05);
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}
