:root {
    --primary: #0984E3;
    --secondary: #74B9FF;
    --accent: #FDCB6E;
    --bg-color: #0A0F1A;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #FFFFFF;
    --text-muted: #A0AEC0;
    --danger: #FF7675;
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

#app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.logo-icon {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

select {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font);
    outline: none;
    transition: all var(--transition);
}

select:focus {
    border-color: var(--primary);
}

/* Base Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    color: var(--text-primary);
}

.btn-icon {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.btn-icon:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
    background: var(--primary);
}

.btn-accent:hover {
    background: #0073cc;
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

.btn-danger {
    background: rgba(255, 118, 117, 0.1);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel {
    padding: 1.5rem;
}

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

.panel h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary);
}

.instructions {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

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

input[type="text"], input[type="number"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font);
    outline: none;
    transition: all var(--transition);
}

input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary);
}

input[type="text"] {
    flex-grow: 1;
}

.weight-input {
    width: 60px;
    text-align: center;
}

.btn-remove {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition);
}

.btn-remove:hover {
    color: var(--danger);
}

/* Scoring Matrix */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

td {
    font-size: 0.875rem;
}

td:first-child {
    font-weight: 600;
}

.score-input {
    width: 60px;
    text-align: center;
}

.total-score {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.125rem;
}

/* Results & Analysis */
.winner-banner {
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.2), rgba(253, 203, 110, 0.1));
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.winner-label {
    color: var(--secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.winner-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.winner-score {
    color: var(--accent);
    font-weight: 600;
}

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

.chart-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
}

h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

/* Sensitivity Panel */
.mt-4 {
    margin-top: 2rem;
}

.sliders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }
}
