:root {
    --bg-color: #0f172a;
    /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --accent-primary: #3b82f6;
    /* Blue 500 */
    --accent-secondary: #8b5cf6;
    /* Violet 500 */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: var(--glass-border);
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
}

/* Methods Grid */
.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.method-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

h3 {
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.visual-container {
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* ABC Visual */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 100%;
    padding: 20px;
}

.bar {
    width: 40px;
    background: var(--accent-primary);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.bar span {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    white-space: nowrap;
}

.a-bar {
    background: #10b981;
}

.b-bar {
    background: #f59e0b;
}

.c-bar {
    background: #ef4444;
}

/* XYZ Controls */
.trend-line {
    width: 80%;
    height: 60%;
}

.xyz-controls,
.rsu-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 10px;
}

button {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover,
button.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.hidden {
    display: none;
}

.icon-representation {
    font-size: 3rem;
    margin-bottom: 5px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.details {
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 8px;
}

.details ul {
    list-style-position: inside;
    margin-top: 0.5rem;
}

/* Tradeoff Section */
.tradeoff-container {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .tradeoff-container {
        grid-template-columns: 1fr;
    }
}

.balance-scale {
    position: relative;
    height: 200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.scale-arm {
    width: 80%;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 3px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Pans hang from here */
    transform-origin: center;
}

.fulcrum {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-top: -10px;
    z-index: 2;
}

.pan {
    width: 80px;
    height: 60px;
    /* Visual pan */
    border-bottom: 3px solid var(--text-secondary);
    border-left: 2px solid var(--text-secondary);
    border-right: 2px solid var(--text-secondary);
    border-radius: 0 0 40px 40px;
    position: absolute;
    bottom: -60px;
    /* Hang below bar */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 10px;
}

.left-pan {
    left: 0;
}

.right-pan {
    right: 0;
}

.weight-box {
    font-size: 2rem;
    transition: transform 0.3s;
}

.weight-label {
    position: absolute;
    top: -30px;
    width: 120px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Controls */
.controls-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

input[type=range] {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 2px;
}

.stat-item {
    margin-bottom: 1rem;
}

.stat-item .label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.stat-item .value {
    float: right;
    font-weight: bold;
    color: var(--accent-primary);
}

.bar-indicator {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.insight-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.example-text {
    display: block;
    margin: 0.5rem 0;
    color: var(--accent-primary);
    font-style: normal;
}