:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1a2744;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --accent: #4fc3f7;
    --accent-hover: #29b6f6;
    --green: #4caf50;
    --yellow: #ffc107;
    --red: #f44336;
    --critical: #f44336;
    --warning: #ffc107;
    --info: #4fc3f7;
    --border: #2a2a4a;
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

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

/* Header */
.header {
    text-align: center;
    padding: 30px 0 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Scan Form */
.scan-form {
    display: flex;
    gap: 10px;
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.scan-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.scan-form input:focus {
    border-color: var(--accent);
}

.scan-form input::placeholder {
    color: #666;
}

.btn {
    padding: 12px 28px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: rgba(79, 195, 247, 0.1);
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Error */
.error-msg {
    display: none;
    padding: 14px 18px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    color: var(--red);
    margin: 12px 0;
    font-size: 14px;
}

.error-msg.active {
    display: block;
}

/* Results */
.results {
    display: none;
}

.results.active {
    display: block;
}

/* Score Circle */
.score-section {
    text-align: center;
    padding: 30px;
    margin: 20px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.score-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
}

.score-circle svg {
    transform: rotate(-90deg);
    width: 140px;
    height: 140px;
}

.score-circle .bg-ring {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.score-circle .score-ring {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
}

.risk-label {
    font-size: 16px;
    font-weight: 600;
    margin-top: 6px;
}

.scan-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

/* Category Cards */
.categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: background 0.2s;
}

.category-card:hover {
    background: var(--bg-card-hover);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
}

.category-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.category-score {
    font-size: 22px;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

.category-toggle {
    color: var(--text-secondary);
    font-size: 18px;
    margin-left: 12px;
    transition: transform 0.2s;
}

.category-card.expanded .category-toggle {
    transform: rotate(180deg);
}

.category-body {
    display: none;
    padding: 0 18px 14px;
    border-top: 1px solid var(--border);
}

.category-card.expanded .category-body {
    display: block;
}

/* Findings */
.finding {
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.finding-critical {
    background: rgba(244, 67, 54, 0.08);
    border-left: 3px solid var(--critical);
}

.finding-warning {
    background: rgba(255, 193, 7, 0.08);
    border-left: 3px solid var(--warning);
}

.finding-info {
    background: rgba(79, 195, 247, 0.05);
    border-left: 3px solid var(--info);
}

.finding .badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
    color: #fff;
}

.badge-critical { background: var(--critical); }
.badge-warning { background: var(--warning); color: #000; }
.badge-info { background: var(--info); color: #000; }

.finding .detail {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Color utilities */
.color-green { color: var(--green); }
.color-yellow { color: var(--yellow); }
.color-red { color: var(--red); }
.bg-green { background: var(--green); }
.bg-yellow { background: var(--yellow); color: #000; }
.bg-red { background: var(--red); }

/* Responsive */
@media (max-width: 600px) {
    .scan-form {
        flex-direction: column;
    }
    .scan-meta {
        flex-direction: column;
        gap: 4px;
    }
}
