/* ========================================
   Security Scanner - Modern UI Styles
   ======================================== */

:root {
    /* Color Palette */
    --bg-primary: #0f0f12;
    --bg-secondary: #18181b;
    --bg-card: #1c1c21;
    --bg-card-hover: #232329;
    --bg-input: #27272d;
    --border-color: #2e2e36;
    --border-active: #4f46e5;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);

    /* Status Colors */
    --critical: #ef4444;
    --critical-bg: rgba(239, 68, 68, 0.12);
    --high: #f97316;
    --high-bg: rgba(249, 115, 22, 0.12);
    --medium: #eab308;
    --medium-bg: rgba(234, 179, 8, 0.12);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);

    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */

.header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo svg {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* ========================================
   Cards
   ======================================== */

.scan-form-card,
.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.scan-form-card h2,
.progress-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* ========================================
   Form Elements
   ======================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* ========================================
   Buttons
   ======================================== */

.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, #6366f1 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 50px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary {
    padding: 0.625rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* ========================================
   Progress Section
   ======================================== */

.progress-section {
    animation: fadeIn 0.3s ease;
}

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

.scan-id {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-input);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.progress-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-hover));
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed .step-icon {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}

.step.active .step-icon {
    background: var(--accent-glow);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    animation: pulse 1.5s infinite;
}

.step-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
}

.step.completed + .step-line,
.step.completed ~ .step-line {
    background: var(--success);
}

.step span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.step.active span {
    color: var(--text-primary);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

/* ========================================
   Results Section
   ======================================== */

.results-section {
    animation: fadeIn 0.3s ease;
}

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

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.download-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card.critical {
    border-color: var(--critical);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--critical-bg) 100%);
}

.summary-card.high {
    border-color: var(--high);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--high-bg) 100%);
}

.summary-card.medium {
    border-color: var(--medium);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--medium-bg) 100%);
}

.summary-card.total {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-glow) 100%);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.summary-card.critical .card-icon { color: var(--critical); }
.summary-card.high .card-icon { color: var(--high); }
.summary-card.medium .card-icon { color: var(--medium); }
.summary-card.total .card-icon { color: var(--accent-primary); }

.card-content {
    display: flex;
    flex-direction: column;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Tabs
   ======================================== */

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-content.active {
    display: block;
}

/* ========================================
   Tables
   ======================================== */

.vuln-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.vuln-table {
    width: 100%;
    border-collapse: collapse;
}

.vuln-table th {
    background: var(--bg-secondary);
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.vuln-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

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

.vuln-table tr:hover td {
    background: var(--bg-card-hover);
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.CRITICAL {
    background: var(--critical-bg);
    color: var(--critical);
}

.severity-badge.HIGH {
    background: var(--high-bg);
    color: var(--high);
}

.severity-badge.MEDIUM {
    background: var(--medium-bg);
    color: var(--medium);
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    color: var(--success);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ========================================
   Animations
   ======================================== */

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .download-buttons {
        width: 100%;
    }

    .download-buttons .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    .progress-steps {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .step-line {
        display: none;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .vuln-table {
        font-size: 0.8rem;
    }

    .vuln-table th,
    .vuln-table td {
        padding: 0.625rem 0.75rem;
    }
}
