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


:root {
    --background: #0b1120;
    --surface: #111827;
    --surface-light: #182234;

    --border: #263244;

    --text: #e5e7eb;
    --muted: #94a3b8;

    --primary: #60a5fa;
    --primary-dark: #2563eb;

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
}


body {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);

    min-height: 100vh;
}


.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}


/* =================================
   NAVBAR
================================= */

.navbar {
    border-bottom: 1px solid var(--border);
    background: rgba(11, 17, 32, 0.95);
}


.nav-content {
    min-height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.logo {
    font-size: 21px;
    font-weight: 700;

    display: flex;
    align-items: center;
    gap: 10px;
}


.logo-icon {
    color: var(--primary);
    font-family: monospace;
}


.nav-label {
    color: var(--muted);
    font-size: 14px;
}


.new-analysis {
    color: var(--text);

    text-decoration: none;

    border: 1px solid var(--border);

    padding: 9px 14px;

    border-radius: 8px;

    font-size: 14px;
}


.new-analysis:hover {
    border-color: var(--primary);
}


/* =================================
   HOME PAGE
================================= */

.home-main {
    min-height: calc(100vh - 130px);
}


.hero {
    max-width: 760px;

    margin: 0 auto;

    padding: 90px 20px 60px;

    text-align: center;
}


.hero-badge {
    display: inline-block;

    color: var(--primary);

    border: 1px solid #24446c;

    background: #101d32;

    padding: 7px 13px;

    border-radius: 999px;

    font-size: 13px;

    margin-bottom: 24px;
}


.hero h1 {
    font-size: clamp(42px, 7vw, 70px);

    line-height: 1.05;

    letter-spacing: -2px;

    margin-bottom: 22px;
}


.hero h1 span {
    color: var(--primary);
}


.hero-description {
    max-width: 620px;

    margin: 0 auto 42px;

    color: var(--muted);

    font-size: 18px;

    line-height: 1.7;
}


/* =================================
   UPLOAD
================================= */

.upload-form {
    max-width: 650px;
    margin: 0 auto;
}


.upload-box {
    display: block;

    border: 1px dashed #3c516d;

    background: var(--surface);

    border-radius: 14px;

    padding: 42px 20px;

    cursor: pointer;

    transition: 0.2s;
}


.upload-box:hover {
    border-color: var(--primary);
    background: #121d2d;
}


.upload-icon {
    width: 52px;
    height: 52px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #172a46;

    color: var(--primary);

    font-size: 28px;
}


.upload-box h3 {
    margin-bottom: 8px;
}


.upload-box p {
    color: var(--muted);
    font-size: 14px;
}


.upload-box input {
    display: none;
}


.browse-button {
    display: inline-block;

    margin-top: 18px;

    padding: 9px 15px;

    background: var(--surface-light);

    border: 1px solid var(--border);

    border-radius: 8px;

    font-size: 14px;
}


.selected-file {
    margin-top: 16px;
}


.analyze-button {
    width: 100%;

    border: none;

    margin-top: 16px;

    padding: 14px;

    border-radius: 9px;

    background: var(--primary-dark);

    color: white;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}


.analyze-button:hover {
    background: #1d4ed8;
}


/* =================================
   FEATURES
================================= */

.features {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 16px;

    padding-bottom: 70px;
}


.feature {
    border: 1px solid var(--border);

    background: var(--surface);

    padding: 22px;

    border-radius: 12px;
}


.feature h3 {
    font-size: 15px;
    margin-bottom: 8px;
}


.feature p {
    color: var(--muted);

    font-size: 13px;

    line-height: 1.6;
}


/* =================================
   DASHBOARD
================================= */

.dashboard {
    padding-top: 48px;
    padding-bottom: 80px;
}


.dashboard-heading {
    margin-bottom: 30px;
}


.dashboard-heading h1 {
    font-size: 34px;
    margin-bottom: 8px;
}


.dashboard-heading p {
    color: var(--muted);
}


.section-label {
    color: var(--primary) !important;

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 1.5px;

    margin-bottom: 10px;
}


/* =================================
   STATS
================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-bottom: 24px;
}


.stat-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 20px;
}


.stat-card span {
    color: var(--muted);

    font-size: 13px;

    display: block;

    margin-bottom: 10px;
}


.stat-card strong {
    font-size: 28px;
}


/* =================================
   PANELS
================================= */

.panel {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    margin-top: 18px;

    padding: 24px;
}


.panel-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 22px;
}


.panel-header h2 {
    font-size: 18px;
}


.count-badge {
    background: var(--surface-light);

    border: 1px solid var(--border);

    border-radius: 999px;

    padding: 5px 10px;

    color: var(--muted);

    font-size: 12px;
}


/* =================================
   STRUCTURE
================================= */

.structure-grid {
    display: grid;

    grid-template-columns:
        repeat(6, 1fr);

    gap: 12px;
}


.structure-grid div {
    background: var(--surface-light);

    border-radius: 8px;

    padding: 15px;
}


.structure-grid span {
    color: var(--muted);

    display: block;

    font-size: 12px;

    margin-bottom: 7px;
}


.structure-grid strong {
    font-size: 20px;
}


/* =================================
   QUALITY
================================= */

.issue-list {
    display: grid;
    gap: 12px;
}


.issue-card {
    border: 1px solid #5c4820;

    background: #211d13;

    padding: 16px;

    border-radius: 9px;
}


.issue-title {
    font-weight: 600;

    margin-bottom: 6px;
}


.warning-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    margin-right: 7px;

    border-radius: 50%;

    background: var(--warning);

    color: #111827;

    font-size: 12px;
    font-weight: bold;
}


.issue-location {
    color: var(--muted);

    font-family: monospace;

    font-size: 12px;

    margin-bottom: 9px;
}


.issue-card p {
    color: #cbd5e1;

    font-size: 14px;
}


.success-box {
    display: flex;

    gap: 13px;

    align-items: flex-start;

    background: #10231d;

    border: 1px solid #1d493b;

    border-radius: 9px;

    padding: 17px;
}


.success-box > span {
    color: var(--success);

    font-size: 21px;
}


.success-box p {
    color: var(--muted);

    font-size: 13px;

    margin-top: 4px;
}


/* =================================
   TABLE
================================= */

.table-wrapper {
    overflow-x: auto;
}


table {
    width: 100%;

    border-collapse: collapse;
}


th,
td {
    text-align: left;

    padding: 13px;

    border-bottom: 1px solid var(--border);

    font-size: 13px;
}


th {
    color: var(--muted);

    font-weight: 500;
}


.complexity-badge {
    padding: 4px 9px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;
}


.complexity-badge.low {
    color: #6ee7b7;
    background: #12352c;
}


.complexity-badge.medium {
    color: #fde68a;
    background: #413414;
}


.complexity-badge.high {
    color: #fca5a5;
    background: #431d1d;
}


/* =================================
   DEPENDENCIES
================================= */

.dependency-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 16px;
}


.dependency-column {
    background: var(--surface-light);

    padding: 17px;

    border-radius: 9px;
}


.dependency-column h3 {
    font-size: 14px;

    margin-bottom: 14px;
}


.dependency-tag {
    display: inline-block;

    padding: 6px 9px;

    margin: 3px;

    border: 1px solid var(--border);

    background: var(--background);

    border-radius: 6px;

    font-family: monospace;

    font-size: 12px;
}


.dependency-column p {
    color: var(--muted);
    font-size: 13px;
}


/* =================================
   GRAPH
================================= */

.graph-list {
    display: grid;
    gap: 10px;
}


.graph-connection {
    display: flex;

    align-items: center;

    gap: 14px;
}


.graph-node {
    border: 1px solid var(--border);

    background: var(--surface-light);

    padding: 9px 12px;

    border-radius: 7px;

    font-family: monospace;

    font-size: 12px;
}


.graph-arrow {
    color: var(--primary);

    font-size: 20px;
}


/* =================================
   FILES
================================= */

.file-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 14px;
}


.file-card {
    background: var(--surface-light);

    border-radius: 9px;

    padding: 17px;
}


.file-card h3 {
    font-family: monospace;

    font-size: 14px;

    margin-bottom: 15px;

    word-break: break-all;
}


.file-stats {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;
}


.file-stats div {
    background: var(--background);

    padding: 10px;

    border-radius: 7px;
}


.file-stats span {
    display: block;

    color: var(--muted);

    font-size: 11px;

    margin-bottom: 4px;
}


.empty-message {
    color: var(--muted);
    font-size: 14px;
}


/* =================================
   FOOTER
================================= */

footer {
    border-top: 1px solid var(--border);

    color: var(--muted);

    text-align: center;

    padding: 24px;

    font-size: 12px;
}


/* =================================
   RESPONSIVE
================================= */

@media (max-width: 900px) {

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


    .structure-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }


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

}

/* =================================
   VISUAL DEPENDENCY GRAPH
================================= */

.panel-description {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}


.visual-graph-container {
    width: 100%;

    overflow-x: auto;

    background: #0d1525;

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 12px;
}


.dependency-graph-svg {
    display: block;

    width: 100%;

    min-width: 700px;
}


.dependency-node rect {
    fill: #18263b;

    stroke: #36577f;

    stroke-width: 1.5;

    transition: 0.2s;
}


.dependency-node:hover rect {
    fill: #1e3350;

    stroke: var(--primary);
}


.dependency-node text {
    fill: #e5e7eb;

    font-family: monospace;

    font-size: 12px;

    pointer-events: none;
}


.dependency-edge {
    fill: none;

    stroke: #4d79ad;

    stroke-width: 1.7;

    opacity: 0.9;
}


.graph-arrow-head {
    fill: #60a5fa;
}


.empty-graph {
    text-align: center;

    padding: 38px 20px;

    background: #0d1525;

    border: 1px solid var(--border);

    border-radius: 10px;
}


.empty-graph-icon {
    color: var(--primary);

    font-family: monospace;

    font-size: 25px;

    margin-bottom: 12px;
}


.empty-graph p {
    color: var(--muted);

    font-size: 13px;

    margin-top: 6px;
}

@media (max-width: 650px) {

    .hero {
        padding-top: 60px;
    }

    .complexity-summary {
    grid-template-columns: 1fr;
}
    .features,
    .stats-grid,
    .file-grid {
        grid-template-columns: 1fr;
    }


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


    .nav-label {
        display: none;
    }

}

/* =================================
   COMPLEXITY SUMMARY
================================= */

.complexity-summary {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-bottom: 28px;
}


.complexity-summary-card {
    background: var(--surface-light);

    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 17px;
}


.complexity-summary-card span {
    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 8px;
}


.complexity-summary-card strong {
    font-size: 22px;
}


.complex-function-name {
    font-family: monospace;

    font-size: 16px !important;

    word-break: break-word;
}


/* =================================
   COMPLEXITY DISTRIBUTION
================================= */

.complexity-distribution {
    background: #0d1525;

    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 20px;

    margin-bottom: 26px;
}


.complexity-distribution h3 {
    font-size: 14px;

    margin-bottom: 20px;
}


.distribution-row {
    margin-bottom: 16px;
}


.distribution-row:last-child {
    margin-bottom: 0;
}


.distribution-label {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 7px;

    font-size: 12px;
}


.distribution-label span {
    color: var(--muted);
}


.distribution-track {
    width: 100%;

    height: 9px;

    background: #1a2536;

    border-radius: 999px;

    overflow: hidden;
}


.distribution-bar {
    height: 100%;

    border-radius: 999px;

    min-width: 0;

    transition: width 0.5s ease;
}


.low-bar {
    background: #34d399;
}


.medium-bar {
    background: #fbbf24;
}


.high-bar {
    background: #f87171;
}

/* =================================
   REPORT ACTIONS
================================= */

.report-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


.report-button {
    color: var(--text);

    text-decoration: none;

    border: 1px solid var(--border);

    background: var(--surface);

    padding: 9px 14px;

    border-radius: 8px;

    font-size: 14px;

    transition: 0.2s;
}


.report-button:hover {
    border-color: var(--primary);

    color: var(--primary);
}


@media (max-width: 650px) {

    .report-actions {
        gap: 6px;
    }


    .report-button,
    .new-analysis {
        padding: 8px 9px;

        font-size: 11px;
    }

}

/* =================================
   DRAG AND DROP UPLOAD
================================= */

.upload-box {
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.upload-box.drag-active {
    border-color: #60a5fa;
    background: rgba(59, 130, 246, 0.08);
    transform: scale(1.01);
}


.upload-box.upload-invalid {
    border-color: #f87171;
}


.upload-hint {
    margin-top: 14px;

    font-size: 12px;

    opacity: 0.65;
}


.upload-error {
    min-height: 18px;

    margin-top: 8px;

    font-size: 13px;

    color: #f87171;
}


.selected-file {
    word-break: break-word;
}

/* =================================
   ERROR PAGE
================================= */

.error-page {
    min-height: calc(100vh - 140px);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 40px 20px;
}


.error-card {
    width: 100%;
    max-width: 520px;

    text-align: center;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 42px 30px;
}


.error-icon {
    width: 52px;
    height: 52px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(248, 113, 113, 0.12);

    color: #f87171;

    font-size: 25px;
    font-weight: 700;
}


.error-card h1 {
    margin-bottom: 12px;
}


.error-card p {
    color: var(--muted);

    line-height: 1.6;

    margin-bottom: 26px;
}


.error-back-button {
    display: inline-block;

    text-decoration: none;
}