:root {
    --bg-color: #121212;
    --card-bg: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --accent-color: #00E5FF;
    --bar-color: #C0C0C0;

    /* Plate Colors */
    --plate-red: #D9381E;
    --plate-blue: #0055A4;
    --plate-yellow: #F1C40F;
    --plate-green: #008F39;
    --plate-white: #F0F0F0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

h1 {
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, #aaa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bar-selector {
    display: flex;
    background: #2A2A2A;
    border-radius: 8px;
    padding: 4px;
}

.radio-label input {
    display: none;
}

.radio-custom {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
}

.radio-label input:checked+.radio-custom {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 2px 10px rgba(0, 229, 255, 0.3);
}

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

.weight-input-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #2A2A2A;
    border-radius: 8px;
    padding: 0 1rem;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
}

input[type="number"] {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    font-family: 'Roboto Mono', monospace;
    width: 120px;
    padding: 10px 0;
    outline: none;
}

.unit {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Visualization */
.visualization-container {
    background: #181818;
    border-radius: 16px;
    padding: 3rem 1rem;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.barbell-stage {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the whole assembly */
    min-width: 600px;
}

.barbell {
    display: flex;
    align-items: center;
    position: relative;
}

.bar-shaft {
    width: 200px;
    /* Visible part of shaft */
    height: 28px;
    /* Standard 28mm */
    background: linear-gradient(to bottom, #999, #eee 40%, #999);
    position: relative;
    z-index: 1;
}

.bar-sleeve {
    height: 50px;
    /* 50mm sleeve */
    background: linear-gradient(to bottom, #888, #ddd 40%, #888);
    display: flex;
    align-items: center;
    position: relative;
    min-width: 300px;
    /* Ensure space for plates */
}

.bar-sleeve.left {
    padding-right: 10px;
    border-right: 4px solid #555;
    justify-content: flex-end;
}

.bar-sleeve.right {
    padding-left: 10px;
    /* Space before plates start */
    border-left: 4px solid #555;
    /* Sleeve collar */
}

.plates-container {
    display: flex;
    align-items: center;
    gap: 1px;
    /* Tiny gap between plates */
}

#plates-left {
    flex-direction: row-reverse;
}

/* Plate Styles */
.plate {
    width: 15px;
    /* Thickness representation */
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: all 0.3s ease;
}

/* Heights based on diameter */
/* 450mm = 100% height (let's say 250px) */
.plate-25 {
    height: 250px;
    background-color: var(--plate-red);
    width: 25px;
}

.plate-20 {
    height: 250px;
    background-color: var(--plate-blue);
    width: 22px;
}

.plate-15 {
    height: 250px;
    background-color: var(--plate-yellow);
    width: 18px;
}

.plate-10 {
    height: 250px;
    background-color: var(--plate-green);
    width: 15px;
}

/* 5kg is smaller, approx 230mm -> ~51% */
.plate-5 {
    height: 128px;
    background-color: var(--plate-white);
    width: 12px;
}

/* Change plates */
/* 2.5kg ~ 190mm -> ~42% */
.plate-2-5 {
    height: 105px;
    background-color: var(--plate-red);
    width: 10px;
}

/* 2kg ~ 170mm -> ~38% */
.plate-2 {
    height: 94px;
    background-color: var(--plate-blue);
    width: 9px;
}

/* 1.5kg ~ 150mm -> ~33% */
.plate-1-5 {
    height: 83px;
    background-color: var(--plate-yellow);
    width: 8px;
}

/* 1kg ~ 135mm -> ~30% */
.plate-1 {
    height: 75px;
    background-color: var(--plate-green);
    width: 7px;
}

/* 0.5kg ~ 120mm -> ~27% */
.plate-0-5 {
    height: 67px;
    background-color: var(--plate-white);
    width: 6px;
}

.collar {
    width: 25px;
    height: 80px;
    background: linear-gradient(to right, #ccc, #fff, #ccc);
    border: 1px solid #999;
    position: relative;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

#collar-right {
    margin-left: 2px;
}

#collar-left {
    margin-right: 2px;
}

.collar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 30px;
    background: #333;
    border-radius: 2px;
}

/* Text on plates (optional, for larger ones) */
.plate::before {
    content: attr(data-weight);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: 10px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: bold;
    white-space: nowrap;
}

.plate-0-5::before,
.plate-1::before,
.plate-1-5::before {
    font-size: 8px;
}

/* Results */
.results-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.result-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
}

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.plate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.plate-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #000;
    /* Most plates have dark text for contrast, except maybe blue/red/green? Let's stick to black or white based on bg */
}

.badge-25 {
    background-color: var(--plate-red);
    color: #fff;
}

.badge-20 {
    background-color: var(--plate-blue);
    color: #fff;
}

.badge-15 {
    background-color: var(--plate-yellow);
    color: #000;
}

.badge-10 {
    background-color: var(--plate-green);
    color: #fff;
}

.badge-5 {
    background-color: var(--plate-white);
    color: #000;
}

.badge-2-5 {
    background-color: var(--plate-red);
    color: #fff;
}

.badge-2 {
    background-color: var(--plate-blue);
    color: #fff;
}

.badge-1-5 {
    background-color: var(--plate-yellow);
    color: #000;
}

.badge-1 {
    background-color: var(--plate-green);
    color: #fff;
}

.badge-0-5 {
    background-color: var(--plate-white);
    color: #000;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #333;
}

.info-row:last-child {
    border-bottom: none;
}

footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .results-panel {
        grid-template-columns: 1fr;
    }

    .barbell-stage {
        transform: scale(0.7);
    }
}