:root {
    --bg-main: #0A1A0F;
    --bg-panel: rgba(46, 204, 113, 0.05);
    --bg-panel-hover: rgba(46, 204, 113, 0.1);
    --border-color: rgba(46, 204, 113, 0.2);
    --primary: #2ECC71;
    --secondary: #27AE60;
    --accent: #E74C3C;
    --accent-hover: #c0392b;
    --text-main: #FFFFFF;
    --text-muted: #A0B0A5;
    --green-light: rgba(46, 204, 113, 0.2);
    --red-light: rgba(231, 76, 60, 0.2);
    --orange: #f39c12;
    --border-radius: 12px;
    --transition: all 0.25s ease;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.upload-section {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-card {
    flex: 1;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-panel);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--bg-panel-hover);
}

.upload-area.file-loaded {
    border-color: var(--primary);
    border-style: solid;
    background: var(--green-light);
}

.upload-area svg {
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-area h3 {
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.export-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-main);
}

.btn-primary:hover {
    background-color: var(--secondary);
}

.btn-secondary {
    background-color: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-panel-hover);
}

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

.btn-outline:hover {
    background-color: var(--green-light);
}

.panel {
    background: rgba(10, 26, 15, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.panel h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Scores */
.score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.score-card {
    background: var(--bg-panel);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid transparent;
}

.score-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.score-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.score-col {
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.score-num {
    font-size: 2rem;
    font-weight: 700;
}

.score-good { color: var(--primary); }
.score-average { color: var(--orange); }
.score-poor { color: var(--accent); }
.score-unc { color: var(--text-muted); }

.score-delta {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

/* Key Metrics Breakdown */
.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: 8px;
}

.metric-info h4 {
    margin-bottom: 0.25rem;
}

.metric-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.metric-values {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.metric-val {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.metric-val span:first-child {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.metric-val span:last-child {
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem;
}

.metric-delta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    width: 80px;
    justify-content: flex-end;
}

/* Chart */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Audit Lists */
.audit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audit-list li {
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audit-title {
    font-weight: 600;
}

.audit-diff {
    font-family: monospace;
    font-weight: bold;
}

.audit-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Screenshots */
.screenshots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.screenshot-pane {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.screenshot-pane h3 {
    text-align: center;
    color: var(--text-muted);
}

.img-container {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

.img-container img {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    border-radius: 4px;
}

/* Timeline */
.timeline-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.timeline-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.timeline-row h3 {
    font-size: 1rem;
    color: var(--text-muted);
}
.filmstrip {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 1rem;
}
.filmstrip::-webkit-scrollbar {
    height: 8px;
}
.filmstrip::-webkit-scrollbar-track {
    background: var(--bg-main);
}
.filmstrip::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.frame {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.frame img {
    height: 120px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.frame span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Recommendations */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rec-item {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--orange);
}

.rec-item h4 {
    margin-bottom: 0.5rem;
}

.rec-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.rec-savings {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary);
}

/* Text Colors */
.text-green { color: var(--primary) !important; }
.text-red { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }

@media (max-width: 768px) {
    .upload-section {
        flex-direction: column;
    }
    .grid-2-col, .screenshots-grid, .timeline-container {
        grid-template-columns: 1fr;
    }
}
