:root {
    --primary: #F39C12;     /* Amber Gold */
    --primary-hover: #E67E22;
    --secondary: #FFEAA7;
    --accent: #00CEC9;      /* Teal/Cyan */
    --accent-glow: rgba(0, 206, 201, 0.4);
    --bg-base: #100C06;     /* Darker base */
    --bg-panel: #1A150A;    /* Dark Amber base */
    --border: rgba(243, 156, 18, 0.2);
    
    --text-main: #FFFFFF;
    --text-muted: #D1D5DB;
    --text-dim: #9CA3AF;

    --radius: 12px;
    --font: 'Inter', system-ui, sans-serif;

    /* Package Colors */
    --color-a: #F39C12; /* Amber */
    --color-b: #00CEC9; /* Teal */
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    background-image: radial-gradient(circle at 50% 0%, rgba(243, 156, 18, 0.05) 0%, transparent 50%);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.text-center { text-align: center; }

.glass-panel {
    background: rgba(26, 21, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--primary);
}

.header-logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

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

/* Search Section */
.search-section {
    padding: 24px;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 14px 14px 14px 40px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.vs-badge {
    align-self: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.btn-compare {
    background: var(--primary);
    color: var(--bg-base);
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    outline: none;
    height: 52px;
}

.btn-compare:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

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

.btn-compare:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-msg {
    margin-top: 16px;
    color: #ff6b6b;
    font-size: 0.9rem;
    text-align: center;
    background: rgba(255, 107, 107, 0.1);
    padding: 10px;
    border-radius: 6px;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 60px 0;
    color: var(--primary);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(243, 156, 18, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Dashboard Grid */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.pkg-header {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pkg-a-header { border-top: 4px solid var(--color-a); }
.pkg-b-header { border-top: 4px solid var(--color-b); }

.pkg-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pkg-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.version-badge {
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: monospace;
}

.pkg-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex: 1;
}

.pkg-links {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.pkg-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.pkg-links a:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.pkg-a-header .pkg-links a:hover { border-color: var(--color-a); color: var(--color-a); }
.pkg-b-header .pkg-links a:hover { border-color: var(--color-b); color: var(--color-b); }

/* Stats rows span across columns */
.stats-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    padding: 20px;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.stat-compare {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
/* Divider in the middle of side-by-side stats */
.stat-compare::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.1);
}

.val-a, .val-b {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 600;
}

.val-a { color: var(--text-main); padding-right: 10px;}
.val-b { color: var(--text-main); padding-left: 10px;}

.highlight-a { color: var(--color-a); }
.highlight-b { color: var(--color-b); }

.ts-yes { color: #4ade80; }
.ts-no { color: #f87171; }

/* Chart Section */
.chart-section {
    grid-column: 1 / -1;
    padding: 24px;
}
.chart-section h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}
.chart-container {
    height: 300px;
    position: relative;
    width: 100%;
}

/* Alternatives */
.alternatives-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.alternatives-section > div {
    padding: 20px;
}
.alternatives-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.tag {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard, .stats-row, .alternatives-section {
        grid-template-columns: 1fr;
    }
    .vs-badge {
        display: none;
    }
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-compare {
        justify-content: center;
    }
}
