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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e8eaf6 0%, #f3e5f5 50%, #fce4ec 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    color: #424242;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.7;
    color: #666;
}

.barbell-container {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 4rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.barbell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    user-select: none;
}

.barbell:active {
    cursor: grabbing;
}

.barbell.lifting {
    animation: liftBarbell var(--lift-difficulty, 1s) ease-out;
}

@keyframes liftBarbell {
    0% { transform: translateY(0) rotateZ(0deg); }
    20% { transform: translateY(-10px) rotateZ(-1deg); }
    40% { transform: translateY(-15px) rotateZ(1deg); }
    60% { transform: translateY(-20px) rotateZ(-0.5deg); }
    80% { transform: translateY(-10px) rotateZ(0.5deg); }
    100% { transform: translateY(0) rotateZ(0deg); }
}

.bar {
    width: 640px;
    height: 28px;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bar.womens {
    height: 25px; /* Thinner shaft for womens bar */
}

/* Left Sleeve */
.bar::before {
    content: '';
    position: absolute;
    left: 0;
    width: 140px;
    height: 100%;
    background: linear-gradient(to bottom, #7d7d7d, #646464, #7d7d7d); /* Zinc finish */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Right Sleeve */
.bar::after {
    content: '';
    position: absolute;
    right: 0;
    width: 140px;
    height: 100%;
    background: linear-gradient(to bottom, #7d7d7d, #646464, #7d7d7d); /* Zinc finish */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Womens Bar Aesthetics */
.bar.womens::before, .bar.womens::after {
    background: linear-gradient(to bottom, #7d7d7d, #646464, #7d7d7d); /* Zinc finish */
}

/* Left Collar */
.collar-left {
    position: absolute;
    left: 140px;
    width: 25px;
    height: 36px;
    background: linear-gradient(to bottom, #404040, #2a2a2a, #404040);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 20;
}

/* Right Collar */
.collar-right {
    position: absolute;
    right: 140px;
    width: 25px;
    height: 36px;
    background: linear-gradient(to bottom, #404040, #2a2a2a, #404040);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 20;
}

/* Central Shaft */
.bar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 310px;
    height: 100%;
    background: linear-gradient(to bottom, #c0c0c0, #a0a0a0, #b0b0b0);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.bar.womens .bar-center {
    background: linear-gradient(to bottom, #d0d0d0, #b0b0b0, #c0c0c0); /* Lighter silver */
}

.bar-center::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 2px;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.4) 100%);
}

/* Knurling on center shaft */
.bar-center::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100%;
    background: repeating-linear-gradient(90deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.15) 1px,
        rgba(0, 0, 0, 0.15) 2px
    );
}

.weight-stack {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    height: auto;
    z-index: 15;
    width: 140px;
}

.weight-stack.left {
    left: 0;
    flex-direction: row-reverse;
}

.weight-stack.right {
    right: 0;
    flex-direction: row;
}

.weights {
    display: flex;
    align-items: center;
    min-width: 170px;
    position: relative;
}

.weights.left {
    left: 0;
    flex-direction: row-reverse;
    animation: slideIn 0.3s ease-out forwards;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

.weight-plate {
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: plateSlide 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.weight-plate span {
    display: block;
}

.weight-plate::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 2px;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.3) 100%);
}

.weight-plate::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.1) 40%, 
        transparent 50%);
    border-radius: 50%;
}

@keyframes plateSlide {
    0% {
        transform: translateX(0) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(-20px) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.weight-plate.removing {
    animation: slideOut 0.4s ease-in forwards;
}

@keyframes slideOut {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(20px) scale(0.8);
        opacity: 0;
    }
}

/* Different sizes for different weights - now as rectangular plates */
.weight-plate[data-weight="45"] {
    width: 20px;
    height: 120px;
    font-size: 11px;
}

.weight-plate[data-weight="35"] {
    width: 18px;
    height: 105px;
    font-size: 10px;
}

.weight-plate[data-weight="25"] {
    width: 16px;
    height: 90px;
    font-size: 9px;
}

.weight-plate[data-weight="10"] {
    width: 14px;
    height: 75px;
    font-size: 8px;
}

.weight-plate[data-weight="5"] {
    width: 12px;
    height: 60px;
    font-size: 7px;
}

.weight-plate[data-weight="2.5"] {
    width: 10px;
    height: 50px;
    font-size: 6px;
}

.weight-plate.falling {
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto 0;
    animation: fall 1s ease-in forwards;
    z-index: 0;
}

@keyframes fall {
    from {
      transform: translateY(0) rotate(-5deg);
      opacity: 1;
    }
    to {
      transform: translateY(200px) rotate(20deg);
      opacity: 0;
    }
}

.controls {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.weight-display {
    text-align: center;
    margin-bottom: 2rem;
}

.total-weight {
    font-size: 4rem;
    font-weight: 700;
    color: #424242;
    transition: all 0.3s ease;
}

.unit {
    font-size: 1.5rem;
    font-weight: 600;
    color: #7f8c8d;
    margin-left: 0.5rem;
}

.dynamic-rep-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 100;
    pointer-events: none;
    animation: rep-fade 1.2s ease-out forwards;
}

@keyframes rep-fade {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    20% { transform: translate(-50%, -60%) scale(1.1); opacity: 1; }
    80% { transform: translate(-50%, -65%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -70%) scale(1); opacity: 0; }
}

.weight-buttons {
    margin-bottom: 2rem;
}

.weight-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.weight-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.weight-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.weight-btn:hover::before {
    left: 100%;
}

.weight-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.weight-btn[data-weight="45"] {
    background: linear-gradient(135deg, #8d6e63, #6d4c41);
}

.weight-btn[data-weight="35"] {
    background: linear-gradient(135deg, #a1887f, #8d6e63);
}

.weight-btn[data-weight="25"] {
    background: linear-gradient(135deg, #90a4ae, #78909c);
}

.weight-btn[data-weight="10"] {
    background: linear-gradient(135deg, #b0bec5, #90a4ae);
}

.weight-btn[data-weight="5"] {
    background: linear-gradient(135deg, #bcaaa4, #a1887f);
}

.weight-btn[data-weight="2.5"] {
    background: linear-gradient(135deg, #cfd8dc, #b0bec5);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.btn-clear {
    background: linear-gradient(135deg, #8d6e63, #6d4c41);
    color: white;
    box-shadow: 0 4px 15px rgba(141, 110, 99, 0.3);
}

.btn-remove {
    background: linear-gradient(135deg, #a1887f, #8d6e63);
    color: white;
    box-shadow: 0 4px 15px rgba(161, 136, 127, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.plate-rack-container {
    margin-bottom: 2rem;
}

.rack-title {
    text-align: center;
    font-weight: 600;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.barbell-selector-container {
    text-align: center;
    margin-bottom: 2rem;
}

.barbell-selector-container label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.select-wrapper {
    position: relative;
    display: inline-block;
}

#barbell-select {
    font-family: 'Inter', sans-serif;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.8rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #888;
}

.plate-rack {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.1));
    border-radius: 12px;
    min-height: 120px;
}

.rack-plate {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease-out;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(0,0,0,0.15), inset 0 -4px 0 rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.1);
}

.rack-plate:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2), inset 0 -2px 0 rgba(0,0,0,0.1);
}

.rack-plate:active {
    transform: translateY(0px) scale(1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.2);
}

.rack-plate[data-weight="45"]  { background-color: #D32F2F; width: 80px; height: 80px; font-size: 24px; color: white;}
.rack-plate[data-weight="35"]  { background-color: #FBC02D; width: 75px; height: 75px; font-size: 22px; color: #333;}
.rack-plate[data-weight="25"]  { background-color: #388E3C; width: 70px; height: 70px; font-size: 20px; color: white;}
.rack-plate[data-weight="10"]  { background-color: #E0E0E0; width: 60px; height: 60px; font-size: 18px; color: #333;}
.rack-plate[data-weight="5"]   { background-color: #1976D2; width: 50px; height: 50px; font-size: 16px; color: white;}
.rack-plate[data-weight="2.5"] { background-color: #212121; width: 45px; height: 45px; font-size: 14px; color: white;}

.rack-plate[data-weight="10"] span,
.rack-plate[data-weight="35"] span {
    text-shadow: 0 1px 1px rgba(255,255,255,0.2);
}

.rack-plate span {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.rack-plate.falling {
    animation: fall 1s ease-in forwards;
    z-index: 0;
}

@keyframes fall {
    from {
      transform: translateY(0) rotate(-5deg);
      opacity: 1;
    }
    to {
      transform: translateY(200px) rotate(20deg);
      opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .bar {
        width: 300px;
    }
    
    .total-weight {
        font-size: 3rem;
    }
    
    .weight-group {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .plate-rack {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        align-items: center;
    }

    .rack-plate {
        justify-self: center;
    }
}

.controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.barbell-selector {
    display: flex;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 5px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.btn-selector {
    border: none;
    background: transparent;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease-out;
    position: relative;
    top: 0;
}

.btn-selector.active {
    background: white;
    color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.unit-toggle {
    border-radius: 50%;
}

.feedback-message {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #D32F2F;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    z-index: 1000;
    animation: fadeInOut 2.5s ease-out forwards;
    border: 2px solid rgba(255,255,255,0.8);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -10px); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

.barbell-container.shake {
    animation: shake-horizontal 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake-horizontal {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.control-group {
    display: flex;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 5px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.btn-selector {
    border: none;
    background: transparent;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease-out;
    position: relative;
    top: 0;
}

.btn-selector.active {
    background: white;
    color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@keyframes slideIn {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
} 