:root {
    --page-max-width: 72rem;
    --surface-base: rgba(15, 23, 42, 0.88);
    --surface-subtle: rgba(30, 41, 59, 0.52);
    --surface-strong: rgba(15, 23, 42, 0.95);
    --surface-border: rgba(71, 85, 105, 0.9);
    --shadow-panel: 0 30px 80px rgba(2, 6, 23, 0.45);
    --ring-color: #3b82f6;
    --radius-lg: 1rem;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    font-variation-settings: normal;
    background:
        radial-gradient(circle at top, rgba(16, 185, 129, 0.08), transparent 28rem),
        linear-gradient(180deg, rgba(15, 23, 42, 1) 0%, rgba(2, 6, 23, 1) 100%);
}

button,
a,
input,
textarea,
select,
.finding-card,
details,
.filter-button,
.attack-summary > div {
    transition-property: color, background-color, border-color, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-width {
    width: min(100%, var(--page-max-width));
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.page-section {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.content-block + .content-block {
    margin-top: 2rem;
}

.panel {
    background: var(--surface-base);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
    padding: 1.5rem;
}

.panel-hero {
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.9)),
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.08), transparent 16rem);
}

.panel-subtle {
    background: var(--surface-subtle);
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.04);
}

.panel-progress {
    background: rgba(15, 23, 42, 0.86);
    box-shadow: none;
    padding: 0.875rem 1rem;
}

.scanner-shell,
.scanner-stack,
.scanner-secondary,
.modal-content {
    display: grid;
    gap: 1rem;
}

.modal-content {
    padding: 1.5rem;
}

.scanner-helper {
    display: grid;
    gap: 0.375rem;
    padding: 1rem;
    border: 1px solid rgba(109, 40, 217, 0.35);
    border-radius: 0.875rem;
    background: rgba(91, 33, 182, 0.12);
}

.info-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.info-wide-card {
    height: 100%;
}

.info-wide-card {
    margin-top: 1.5rem;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.results-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.7);
    background: var(--surface-strong);
}

.results-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-subheader {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
    background: rgba(15, 23, 42, 0.72);
}

.delta-summary {
    display: grid;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
    background: rgba(2, 6, 23, 0.34);
}

.delta-summary.hidden {
    display: none;
}

.delta-verdict {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.verdict-badge {
    flex: 0 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 700;
    letter-spacing: 0;
}

.verdict-block {
    border-color: rgba(248, 113, 113, 0.75);
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.35);
}

.verdict-review {
    border-color: rgba(251, 191, 36, 0.75);
    color: #fcd34d;
    background: rgba(120, 53, 15, 0.35);
}

.verdict-safe {
    border-color: rgba(52, 211, 153, 0.75);
    color: #6ee7b7;
    background: rgba(6, 78, 59, 0.35);
}

.delta-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.delta-card {
    min-width: 0;
    border: 1px solid rgba(51, 65, 85, 0.9);
    border-radius: 0.75rem;
    padding: 0.875rem;
    background: rgba(15, 23, 42, 0.62);
}

.delta-label {
    color: #64748b;
    font-size: 0.7rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.delta-copy {
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-button {
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    line-height: 1;
    border-width: 1px;
}

.filter-button[data-active="false"] {
    opacity: 0.4;
}

.modal-panel {
    padding: 0;
    overflow: hidden;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-dark {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(16, 24, 39, 0.3);
    border-radius: 50%;
    border-top-color: #0f172a;
    animation: spin 0.8s linear infinite;
}

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

/* Severity Badges */
.severity-critical { 
    border-left: 4px solid #DC2626; 
    background: linear-gradient(to right, rgba(220, 38, 38, 0.05), transparent);
}

.severity-high { 
    border-left: 4px solid #EF4444; 
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), transparent);
}

.severity-medium { 
    border-left: 4px solid #F59E0B; 
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), transparent);
}

.severity-low { 
    border-left: 4px solid #3B82F6; 
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button Loading State */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Finding Cards */
.finding-card {
    background-color: transparent;
}

.finding-card:hover {
    background-color: rgba(30, 41, 59, 0.4);
}

.finding-card.filtered-out {
    display: none;
}

.finding-card code,
.finding-card pre,
#attackStatus,
#scanUrl {
    overflow-wrap: anywhere;
}

.attack-summary {
    max-width: 100%;
}

.attack-summary > div {
    max-width: 100%;
}

.attack-summary .flex {
    justify-content: flex-start;
}

/* Code Block Styling */
code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

/* Badge Styles */
/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--ring-color);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-section {
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }

    .content-block + .content-block {
        margin-top: 1.5rem;
    }

    .panel,
    .results-header,
    .results-subheader,
    .delta-summary {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .panel {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .results-header {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .results-subheader {
        padding-top: 0.875rem;
        padding-bottom: 0.875rem;
    }

    .filter-row {
        align-items: flex-start;
    }

    .delta-verdict {
        flex-direction: column;
        gap: 0.75rem;
    }

    .delta-grid {
        grid-template-columns: 1fr;
    }
}
