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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

main {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.unit-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.unit-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.unit-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.unit-btn:hover:not(.active) {
    border-color: #667eea;
}

.input-section {
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-group span {
    font-weight: 500;
}

.btn-secondary {
    background: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.result-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    min-height: 100px;
}

#barbellVisual {
    margin-bottom: 25px;
    padding: 20px 10px;
    background: white;
    border-radius: 10px;
    overflow-x: auto;
}

.barbell-container {
    display: flex;
    align-items: center;
    min-height: 80px;
    justify-content: center;
    gap: 2px;
}

.barbell-sleeve {
    width: 30px;
    height: 12px;
    background: linear-gradient(to bottom, #c0c0c0, #808080);
    border-radius: 2px;
}

.barbell-collar {
    width: 8px;
    height: 20px;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

.barbell-collar-custom {
    background: linear-gradient(to bottom, #2c3e50, #34495e);
}

.visual-plate {
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,0.2);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2), inset -2px -2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Olympic plate colors and sizes */
.visual-plate-50 {
    width: 75px;
    height: 75px;
    background: radial-gradient(circle, #2c3e50, #1a252f);
    font-size: 15px;
}

.visual-plate-25 {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #e74c3c, #c0392b);
    font-size: 14px;
}

.visual-plate-20 {
    width: 65px;
    height: 65px;
    background: radial-gradient(circle, #3498db, #2980b9);
    font-size: 13px;
}

.visual-plate-15 {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #f1c40f, #f39c12);
    font-size: 12px;
}

.visual-plate-10 {
    width: 55px;
    height: 55px;
    background: radial-gradient(circle, #2ecc71, #27ae60);
    font-size: 12px;
}

.visual-plate-5 {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle, #ecf0f1, #bdc3c7);
    color: #333;
    font-size: 11px;
}

.visual-plate-2_5 {
    width: 38px;
    height: 38px;
    background: radial-gradient(circle, #e74c3c, #c0392b);
    font-size: 10px;
}

.visual-plate-2 {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, #3498db, #2980b9);
    font-size: 10px;
}

.visual-plate-1_5 {
    width: 34px;
    height: 34px;
    background: radial-gradient(circle, #f1c40f, #f39c12);
    color: #333;
    font-size: 9px;
}

.visual-plate-1_25 {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #95a5a6, #7f8c8d);
    font-size: 9px;
}

.visual-plate-1 {
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, #34495e, #2c3e50);
    font-size: 8px;
}

.visual-plate-0_75 {
    width: 25px;
    height: 25px;
    background: radial-gradient(circle, #7f8c8d, #5d6d7e);
    font-size: 7px;
}

.visual-plate-0_5 {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, #bdc3c7, #95a5a6);
    color: #333;
    font-size: 7px;
}

.visual-plate-0_25 {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ecf0f1, #d5dbdb);
    color: #333;
    font-size: 6px;
}

.visual-plate-0_125 {
    width: 18px;
    height: 18px;
    background: radial-gradient(circle, #e74c3c, #c0392b);
    font-size: 6px;
}

#result {
    font-size: 16px;
}

.result-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
}

.plate-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.plate {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    display: inline-block;
}

.plate-50 { background: #2c3e50; }
.plate-25 { background: #e74c3c; }
.plate-20 { background: #3498db; }
.plate-15 { background: #f39c12; }
.plate-10 { background: #2ecc71; }
.plate-5 { background: #9b59b6; }
.plate-2_5 { background: #1abc9c; }
.plate-2 { background: #3498db; }
.plate-1_5 { background: #f39c12; color: #333; }
.plate-1_25 { background: #34495e; }
.plate-1 { background: #95a5a6; }
.plate-0_75 { background: #7f8c8d; }
.plate-0_5 { background: #bdc3c7; }
.plate-0_25 { background: #ecf0f1; color: #333; }
.plate-0_125 { background: #e74c3c; }

.error {
    color: #e74c3c;
    font-weight: 600;
}

.success {
    color: #2ecc71;
}

.inventory-section {
    margin-top: 30px;
    text-align: center;
}

#inventoryPanel {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

#inventoryPanel h3 {
    margin-bottom: 15px;
    color: #667eea;
}

#inventoryList {
    display: grid;
    gap: 12px;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.inventory-item label {
    margin: 0;
    flex: 1;
}

.inventory-item input {
    width: 80px;
    padding: 8px;
}

.collar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
}

.collar-item-name {
    flex: 1;
    font-weight: 500;
}

.collar-item-weight {
    margin: 0 10px;
    color: #666;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c0392b;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}
