/* Base Variables - Mint Fresh Palette */
:root {
    --bg-main: #0A1A0F;
    /* Deep forest night */
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar: #06120A;

    --primary: #2ED573;
    --primary-hover: #1eab58;
    --primary-dim: rgba(46, 213, 115, 0.15);

    --secondary: #7BED9F;
    --accent: #70A1FF;

    --text-main: #FFFFFF;
    --text-muted: #A0B2A8;
    --text-dim: #6B7B71;

    --error: #FF6B81;
    --error-dim: rgba(255, 107, 129, 0.15);
    --warning: #FFA502;
    --warning-dim: rgba(255, 165, 2, 0.15);

    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(46, 213, 115, 0.3);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 1.25rem;
}

.brand h1 {
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.nav {
    flex: 1;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-item:hover:not(:disabled) {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--primary-dim);
    color: var(--primary);
}

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

.sidebar-footer {
    padding: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 2.5rem 3rem;
}

.tab-pane {
    display: none;
}

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

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.text-dim {
    color: var(--text-dim);
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Utilities */
.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.p-0 {
    padding: 0 !important;
}

.p-4 {
    padding: 1rem;
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

.text-sm {
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-sidebar);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

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

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

/* Mini Score Sidebar */
.mini-score-card {
    padding: 1rem;
    text-align: center;
    border-color: var(--primary-dim);
    animation: fadeIn 0.3s;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
    line-height: 1;
}

/* Code Editor */
.code-editor {
    width: 100%;
    height: 50vh;
    min-height: 300px;
    background-color: #030a05;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    color: #a9dcba;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.code-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Score Ring */
.score-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 200px;
}

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

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

.ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.score-center {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.score-max {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Breakdowns */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.breakdown-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.badge {
    background: var(--bg-card-hover);
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.badge.perfect {
    background: var(--primary-dim);
    color: var(--primary);
}

.badge.warning {
    background: var(--warning-dim);
    color: var(--warning);
}

.badge.error {
    background: var(--error-dim);
    color: var(--error);
}

/* Report Tabs */
.report-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.report-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

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

.report-view {
    display: none;
}

.report-view.active {
    display: block;
}

/* Issue List */
.issue-card {
    background: var(--bg-card);
    border-left: 4px solid var(--error);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: slideUp 0.3s forwards;
    opacity: 0;
    transform: translateY(10px);
}

.issue-card.warning {
    border-color: var(--warning);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.issue-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.issue-penalty {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--error);
}

.issue-card.warning .issue-penalty {
    color: var(--warning);
}

.issue-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.suggestion-box {
    background: rgba(112, 161, 255, 0.1);
    border: 1px solid rgba(112, 161, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.suggestion-icon {
    color: var(--accent);
}

.suggestion-text {
    font-size: 0.9rem;
    color: var(--text-main);
}

.suggestion-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    color: var(--accent);
}

/* Tree & Annotated */
.tree-container {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-main);
}

.tree-item {
    display: flex;
    align-items: center;
}

.tree-h1 {
    margin-left: 0;
    color: var(--primary);
    font-weight: bold;
}

.tree-h2 {
    margin-left: 20px;
    color: var(--secondary);
}

.tree-h3 {
    margin-left: 40px;
    color: var(--accent);
}

.tree-h4 {
    margin-left: 60px;
    color: var(--text-muted);
}

.tree-h5 {
    margin-left: 80px;
    color: var(--text-dim);
}

.tree-h6 {
    margin-left: 100px;
    color: var(--text-dim);
}

.tree-err {
    color: var(--error);
    text-decoration: line-through;
}

.annotated-area {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    background: #030a05;
    color: #a9dcba;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 500px;
    overflow-y: auto;
}

.annot-err {
    border-bottom: 1px dotted var(--error);
    position: relative;
    cursor: help;
}

.annot-warn {
    border-bottom: 1px dotted var(--warning);
    position: relative;
    cursor: help;
}

.annot-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    white-space: nowrap;
    z-index: 100;
    font-size: 0.8rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.annot-err:hover .annot-tooltip,
.annot-warn:hover .annot-tooltip {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* Checklist */
.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checklist li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-top: 3px;
}

.checklist code {
    font-family: var(--font-mono);
    color: var(--secondary);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}