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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a1a;
    color: #e8e8e8;
    min-height: 100vh;
    padding: 80px 20px 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #242424;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header h1 {
    margin: 0;
    font-size: 1.4rem;
    color: #e8e8e8;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-toggle {
    display: flex;
    background: #1e1e1e;
    border-radius: 6px;
    padding: 3px;
}

.lang-btn {
    padding: 5px 10px;
    border: none;
    background: transparent;
    color: #999999;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: #e8e8e8;
}

.lang-btn.active {
    background: #3d3d3d;
    color: #f0f0f0;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #e8e8e8;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    right: -280px;
    width: 280px;
    height: calc(100vh - 60px);
    background: #242424;
    z-index: 99;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #3d3d3d;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #e8e8e8;
}

.nav-list {
    list-style: none;
    padding: 10px;
}

.nav-list li {
    margin-bottom: 5px;
}

.nav-btn {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #303030;
    color: #f0f0f0;
}

.nav-btn.active {
    background: #3d3d3d;
    color: #f0f0f0;
}

.overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.open {
    opacity: 1;
    visibility: visible;
}

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

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #e8e8e8;
    font-size: 2rem;
}

h2 {
    margin-bottom: 20px;
    color: #e8e8e8;
}

.tool-section {
    display: none;
    background: #282828;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tool-section.active {
    display: block;
}

/* Unit Toggle */
.unit-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #1e1e1e;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.unit-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #999999;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.unit-btn:hover {
    color: #e8e8e8;
}

.unit-btn.active {
    background: #3d3d3d;
    color: #f0f0f0;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #e8e8e8;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #3d3d3d;
    border-radius: 8px;
    background: #1e1e1e;
    color: #f0f0f0;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #5a5a5a;
}

.input-group input::placeholder {
    color: #777777;
}

.plate-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.plate-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1e1e1e;
    border: 2px solid #3d3d3d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plate-checkbox:hover {
    border-color: #5a5a5a;
}

.plate-checkbox input {
    display: none;
}

.plate-checkbox:has(input:checked) {
    border-color: #5a5a5a;
    background: rgba(70, 70, 70, 0.4);
}

.plate-checkbox:has(input:not(:checked)) {
    opacity: 0.5;
}

.plate-checkbox span {
    font-weight: 600;
    color: #999999;
}

.plate-checkbox .plate-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
    margin-right: 4px;
}

.plate-checkbox:has(input:checked) span {
    color: #e8e8e8;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3d3d3d, #303030);
    border: none;
    border-radius: 8px;
    color: #f0f0f0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(60, 60, 60, 0.6);
}

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

.result {
    margin-top: 25px;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #3d3d3d;
}

.result h3 {
    margin-bottom: 15px;
    color: #e8e8e8;
}

#plates-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.plate-tag {
    padding: 8px 16px;
    background: #303030;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #f0f0f0;
}

.plate-tag .count {
    background: #3d3d3d;
    color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.plate-tag.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.plate-tag.clickable:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.barbell-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    overflow-x: auto;
}

.bar {
    height: 12px;
    background: linear-gradient(to bottom, #777777, #555555);
    border-radius: 2px;
    min-width: 60px;
}

.bar-center {
    min-width: 80px;
    height: 16px;
    background: linear-gradient(to bottom, #888888, #666666);
}

.plate {
    height: 60px;
    min-width: 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* lbs plate colors */
.plate-lbs-55 { background: linear-gradient(to right, #dc2626, #b91c1c); height: 85px; min-width: 15px; }  /* red */
.plate-lbs-45 { background: linear-gradient(to right, #2563eb, #1d4ed8); height: 80px; min-width: 14px; }  /* blue */
.plate-lbs-35 { background: linear-gradient(to right, #eab308, #ca8a04); height: 75px; min-width: 12px; }  /* yellow */
.plate-lbs-25 { background: linear-gradient(to right, #16a34a, #15803d); height: 70px; min-width: 11px; }  /* green */
.plate-lbs-15 { background: linear-gradient(to right, #a855f7, #9333ea); height: 60px; min-width: 10px; }  /* purple */
.plate-lbs-10 { background: linear-gradient(to right, #f5f5f5, #e5e5e5); height: 55px; min-width: 9px; color: #333; }  /* white */
.plate-lbs-5 { background: linear-gradient(to right, #3b82f6, #2563eb); height: 45px; min-width: 8px; }   /* blue */
.plate-lbs-2\.5 { background: linear-gradient(to right, #22c55e, #16a34a); height: 40px; min-width: 7px; } /* green */

/* kg plate colors */
.plate-kg-25 { background: linear-gradient(to right, #dc2626, #b91c1c); height: 85px; min-width: 15px; }    /* red */
.plate-kg-20 { background: linear-gradient(to right, #2563eb, #1d4ed8); height: 80px; min-width: 14px; }    /* blue */
.plate-kg-15 { background: linear-gradient(to right, #eab308, #ca8a04); height: 75px; min-width: 12px; }    /* yellow */
.plate-kg-10 { background: linear-gradient(to right, #16a34a, #15803d); height: 70px; min-width: 11px; }    /* green */
.plate-kg-5 { background: linear-gradient(to right, #f5f5f5, #e5e5e5); height: 55px; min-width: 9px; color: #333; }  /* white */
.plate-kg-2\.5 { background: linear-gradient(to right, #3b82f6, #2563eb); height: 45px; min-width: 8px; }   /* blue */
.plate-kg-1\.25 { background: linear-gradient(to right, #22c55e, #16a34a); height: 40px; min-width: 7px; }  /* green */

.error {
    margin-top: 20px;
    padding: 15px;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid #dc2626;
    border-radius: 8px;
    color: #fca5a5;
}

.hidden {
    display: none !important;
}

/* Plate Builder */
.plate-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.plate-btn {
    padding: 12px 18px;
    border: 2px solid #3d3d3d;
    background: #1e1e1e;
    color: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.plate-btn:hover {
    border-color: #5a5a5a;
    background: #303030;
}

.plate-btn:active {
    transform: scale(0.95);
}

.builder-result {
    margin-top: 25px;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #3d3d3d;
}

.total-weight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3d3d3d;
}

.total-weight .label {
    color: #999999;
    font-size: 0.9rem;
}

.total-weight .weight-value {
    font-size: 2rem;
    font-weight: 700;
    color: #e8e8e8;
}

.plates-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    min-height: 30px;
}

.clear-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: transparent;
    border: 2px solid #dc2626;
    border-radius: 8px;
    color: #dc2626;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #dc2626;
    color: #fff;
}

/* 1RM Estimator */
.rm-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
}

.rm-label {
    color: #999999;
    font-size: 0.9rem;
}

.rm-value {
    font-size: 3rem;
    font-weight: 700;
    color: #e8e8e8;
}

.rm-note {
    text-align: center;
    color: #999999;
    font-size: 0.85rem;
    margin-top: 10px;
    font-style: italic;
}

.secondary-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: transparent;
    border: 2px solid #3d3d3d;
    border-radius: 8px;
    color: #aaaaaa;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(70, 70, 70, 0.4);
    color: #f0f0f0;
    border-color: #5a5a5a;
}

/* Percentage Table */
.percentage-table {
    margin-top: 15px;
}

.percentage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #3d3d3d;
}

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

.percentage-row:nth-child(even) {
    background: rgba(60, 60, 60, 0.3);
}

.percentage-row.highlight {
    background: rgba(70, 70, 70, 0.5);
}

.percentage-row.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.percentage-row.clickable:hover {
    background: rgba(80, 80, 80, 0.5);
}

.percentage-label {
    font-weight: 600;
    color: #999999;
}

.percentage-weight {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e8e8e8;
}

/* Unit Converter */
.converter-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.converter-container .input-group {
    flex: 1;
    margin-bottom: 0;
}

.converter-arrow {
    font-size: 1.5rem;
    color: #999999;
    padding-top: 20px;
}

.converter-note {
    text-align: center;
    color: #999999;
    font-size: 0.85rem;
    margin-top: 20px;
}

/* HR Zone Calculator */
.input-note {
    color: #777777;
    font-size: 0.8rem;
    margin-top: 6px;
    font-style: italic;
}

.hr-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3d3d3d;
}

.hr-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.hr-info-row .label {
    color: #999999;
    font-size: 0.9rem;
}

.hr-info-row span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e8e8e8;
}

.hr-zones-table {
    margin-bottom: 15px;
}

.hr-zone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #3d3d3d;
    gap: 10px;
}

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

.hr-zone-row:nth-child(1) { background: rgba(34, 197, 94, 0.15); }  /* Zone 1 - green */
.hr-zone-row:nth-child(2) { background: rgba(59, 130, 246, 0.15); } /* Zone 2 - blue */
.hr-zone-row:nth-child(3) { background: rgba(234, 179, 8, 0.15); }  /* Zone 3 - yellow */
.hr-zone-row:nth-child(4) { background: rgba(249, 115, 22, 0.15); } /* Zone 4 - orange */
.hr-zone-row:nth-child(5) { background: rgba(220, 38, 38, 0.15); }  /* Zone 5 - red */

.zone-name {
    flex: 1;
    font-weight: 600;
    color: #e8e8e8;
    font-size: 0.9rem;
}

.zone-range {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e8e8e8;
    text-align: right;
    min-width: 120px;
}

.zone-pct {
    color: #999999;
    font-size: 0.85rem;
    min-width: 60px;
    text-align: right;
}

.hr-formula-note {
    text-align: center;
    color: #777777;
    font-size: 0.8rem;
    margin-top: 15px;
    font-style: italic;
}

/* Rest Timer */
.timer-display {
    font-size: 5rem;
    font-weight: 700;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: #f0f0f0;
    padding: 30px 20px;
    background: #1e1e1e;
    border-radius: 12px;
    margin-bottom: 25px;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.timer-display.timer-running {
    color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.timer-display.timer-warning {
    color: #f59e0b;
    animation: pulse 1s ease-in-out infinite;
}

.timer-display.timer-done {
    color: #dc2626;
    animation: flash 0.5s ease-in-out 3;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes flash {
    0%, 100% { background: #1e1e1e; }
    50% { background: rgba(220, 38, 38, 0.3); }
}

.timer-input-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.timer-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.timer-input-group label {
    font-size: 0.85rem;
    color: #999999;
}

.timer-input-group input {
    width: 80px;
    padding: 12px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    border: 2px solid #3d3d3d;
    border-radius: 8px;
    background: #1e1e1e;
    color: #f0f0f0;
}

.timer-input-group input:focus {
    outline: none;
    border-color: #5a5a5a;
}

.timer-input-separator {
    font-size: 2rem;
    font-weight: 700;
    color: #999999;
    padding-bottom: 10px;
}

.quick-time-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.quick-time-btn {
    padding: 12px 18px;
    border: 2px solid #3d3d3d;
    background: #1e1e1e;
    color: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.quick-time-btn:hover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.quick-time-btn:active {
    transform: scale(0.95);
}

.timer-controls {
    display: flex;
    gap: 15px;
}

.timer-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-start {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.timer-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.timer-pause {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.timer-pause:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.timer-reset {
    background: transparent;
    border: 2px solid #dc2626;
    color: #dc2626;
}

.timer-reset:hover {
    background: #dc2626;
    color: #fff;
}

/* CrossFit Timer */
.cf-mode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    justify-content: center;
}

.cf-mode-btn {
    padding: 10px 16px;
    border: 2px solid #3d3d3d;
    background: #1e1e1e;
    color: #888888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cf-mode-btn:hover {
    border-color: #555555;
    color: #f0f0f0;
}

.cf-mode-btn.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.cf-start-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #888888;
    font-size: 0.9rem;
}

.cf-countdown-options {
    display: flex;
    gap: 6px;
}

.cf-countdown-btn {
    padding: 6px 12px;
    border: 2px solid #3d3d3d;
    background: #1e1e1e;
    color: #888888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cf-countdown-btn:hover {
    border-color: #555555;
    color: #f0f0f0;
}

.cf-countdown-btn.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.cf-display {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 25px 20px;
    margin-bottom: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.cf-phase {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    min-height: 1.6em;
}

.cf-phase.work {
    color: #22c55e;
}

.cf-phase.rest {
    color: #f59e0b;
}

.cf-phase.complete {
    color: #dc2626;
}

.cf-phase.ready {
    color: #3b82f6;
}

.cf-time {
    font-size: 5rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: #f0f0f0;
    letter-spacing: 0.05em;
    line-height: 1;
}

.cf-round {
    font-size: 1.1rem;
    color: #888888;
    margin-top: 10px;
    min-height: 1.4em;
}

.cf-display.running .cf-time {
    color: #22c55e;
}

.cf-display.running.rest-phase .cf-time {
    color: #f59e0b;
}

.cf-display.warning .cf-time {
    color: #f59e0b;
    animation: pulse 1s ease-in-out infinite;
}

.cf-display.complete {
    animation: flash 0.5s ease-in-out 3;
}

.cf-display.complete .cf-time {
    color: #dc2626;
}

.cf-settings {
    margin-bottom: 20px;
}

.cf-setting-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
}

.cf-setting-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cf-setting-group label {
    font-size: 0.85rem;
    color: #888888;
}

.cf-setting-group select,
.cf-setting-group input {
    padding: 12px;
    border: 2px solid #3d3d3d;
    border-radius: 8px;
    background: #1e1e1e;
    color: #f0f0f0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.cf-setting-group select {
    min-width: 100px;
    cursor: pointer;
}

.cf-setting-group select:focus,
.cf-setting-group input:focus {
    outline: none;
    border-color: #5a5a5a;
}

.cf-duration-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-duration-input input {
    width: 70px;
}

.cf-duration-input span {
    color: #888888;
    font-size: 0.9rem;
}

.cf-rounds-input {
    width: 70px;
}

.cf-tabata-info {
    text-align: center;
    color: #888888;
    font-size: 1rem;
    padding: 15px;
    background: #161616;
    border-radius: 8px;
}

.cf-direction-toggle {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.cf-direction-btn {
    padding: 10px 20px;
    border: 2px solid #3d3d3d;
    background: #1e1e1e;
    color: #888888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cf-direction-btn:hover {
    border-color: #555555;
    color: #f0f0f0;
}

.cf-direction-btn.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.cf-cap-note {
    font-size: 0.8rem;
    color: #666666;
    margin-top: 4px;
}

.cf-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.cf-preset-btn {
    padding: 10px 16px;
    border: 2px solid #3d3d3d;
    background: #1e1e1e;
    color: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cf-preset-btn:hover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.cf-preset-btn:active {
    transform: scale(0.95);
}

.cf-controls {
    display: flex;
    gap: 15px;
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 600px;
    }

    .tool-section {
        padding: 35px;
    }
}

/* Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .container {
        max-width: 550px;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        padding: 80px 30px 30px;
    }

    .container {
        max-width: 600px;
    }

    .sidebar {
        width: 300px;
        right: -300px;
    }
}

/* Small Tablet / Large Mobile (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    body {
        padding: 70px 15px 15px;
    }

    .header {
        height: 55px;
        padding: 0 15px;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .sidebar {
        top: 55px;
        height: calc(100vh - 55px);
        width: 260px;
        right: -260px;
    }

    .overlay {
        top: 55px;
    }

    .tool-section {
        padding: 20px;
    }

    .plate-checkboxes {
        gap: 8px;
    }

    .plate-checkbox {
        padding: 6px 10px;
    }

    .plate-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .rm-value {
        font-size: 2.5rem;
    }

    .total-weight .weight-value {
        font-size: 1.75rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    body {
        padding: 65px 12px 12px;
    }

    .header {
        height: 50px;
        padding: 0 12px;
    }

    .header h1 {
        font-size: 1rem;
    }

    .header-controls {
        gap: 8px;
    }

    .lang-toggle {
        padding: 2px;
    }

    .lang-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .menu-toggle {
        padding: 8px;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
        gap: 4px;
    }

    .sidebar {
        top: 50px;
        height: calc(100vh - 50px);
        width: 100%;
        right: -100%;
    }

    .sidebar-header {
        padding: 15px;
    }

    .sidebar-header h2 {
        font-size: 1.1rem;
    }

    .nav-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .overlay {
        top: 50px;
    }

    .container {
        max-width: 100%;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .tool-section {
        padding: 15px;
        border-radius: 10px;
    }

    .unit-toggle {
        margin-bottom: 15px;
    }

    .unit-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

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

    .input-group label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .input-group input,
    .input-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .plate-checkboxes {
        gap: 6px;
    }

    .plate-checkbox {
        padding: 6px 8px;
        gap: 6px;
        border-radius: 6px;
    }

    .plate-checkbox .plate-color-indicator {
        width: 14px;
        height: 14px;
        margin-right: 2px;
    }

    .plate-checkbox span {
        font-size: 0.85rem;
    }

    .calculate-btn {
        padding: 12px;
        font-size: 1rem;
    }

    .result {
        margin-top: 20px;
        padding: 15px;
    }

    .result h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    #plates-list {
        gap: 8px;
        margin-bottom: 15px;
    }

    .plate-tag {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .plate-tag .count {
        padding: 2px 6px;
        font-size: 0.8rem;
    }

    .barbell-visual {
        padding: 15px 5px;
        transform: scale(0.85);
        transform-origin: center;
    }

    .plate-buttons {
        gap: 8px;
    }

    .plate-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .builder-result {
        margin-top: 20px;
        padding: 15px;
    }

    .total-weight {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .total-weight .label {
        font-size: 0.85rem;
    }

    .total-weight .weight-value {
        font-size: 1.5rem;
    }

    .plates-list-inline {
        gap: 6px;
        margin-top: 12px;
    }

    .clear-btn {
        margin-top: 12px;
        padding: 10px;
        font-size: 0.9rem;
    }

    .rm-display {
        padding: 15px 0;
    }

    .rm-label {
        font-size: 0.85rem;
    }

    .rm-value {
        font-size: 2rem;
    }

    .rm-note {
        font-size: 0.8rem;
    }

    .secondary-btn {
        margin-top: 12px;
        padding: 10px;
        font-size: 0.9rem;
    }

    .percentage-row {
        padding: 10px 12px;
    }

    .percentage-label {
        font-size: 0.9rem;
    }

    .percentage-weight {
        font-size: 1rem;
    }

    /* Stack converter inputs on mobile */
    .converter-container {
        flex-direction: column;
        gap: 10px;
    }

    .converter-container .input-group {
        width: 100%;
    }

    .converter-arrow {
        padding-top: 0;
        transform: rotate(90deg);
    }

    .converter-note {
        margin-top: 15px;
        font-size: 0.8rem;
    }

    /* HR Zone Calculator mobile */
    .hr-zone-row {
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .zone-name {
        font-size: 0.85rem;
        flex-basis: 100%;
        margin-bottom: 5px;
    }

    .zone-range {
        font-size: 1rem;
        min-width: auto;
    }

    .zone-pct {
        font-size: 0.8rem;
        min-width: auto;
    }

    .hr-info-row span:last-child {
        font-size: 1.1rem;
    }

    .input-note {
        font-size: 0.75rem;
    }

    /* Rest Timer mobile */
    .timer-display {
        font-size: 3.5rem;
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .timer-input-group input {
        width: 70px;
        padding: 10px;
        font-size: 1.1rem;
    }

    .timer-input-separator {
        font-size: 1.5rem;
    }

    .quick-time-buttons {
        gap: 8px;
        margin-bottom: 20px;
    }

    .quick-time-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .timer-controls {
        gap: 10px;
    }

    .timer-btn {
        padding: 12px;
        font-size: 1rem;
    }

    /* CrossFit Timer mobile */
    .cf-mode-selector {
        gap: 6px;
        margin-bottom: 20px;
    }

    .cf-mode-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .cf-display {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .cf-phase {
        font-size: 1.2rem;
    }

    .cf-time {
        font-size: 3.5rem;
    }

    .cf-round {
        font-size: 1rem;
    }

    .cf-setting-row {
        gap: 15px;
    }

    .cf-setting-group select,
    .cf-setting-group input {
        padding: 10px;
        font-size: 0.95rem;
    }

    .cf-duration-input input {
        width: 60px;
    }

    .cf-presets {
        gap: 8px;
        margin-bottom: 20px;
    }

    .cf-preset-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .cf-controls {
        gap: 10px;
    }
}

/* Extra small mobile (320px and below) */
@media (max-width: 320px) {
    body {
        padding: 60px 8px 8px;
    }

    .header h1 {
        font-size: 0.9rem;
    }

    .tool-section {
        padding: 12px;
    }

    .plate-checkbox {
        padding: 5px 6px;
    }

    .plate-checkbox .plate-color-indicator {
        width: 12px;
        height: 12px;
    }

    .plate-checkbox span {
        font-size: 0.8rem;
    }

    .plate-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .rm-value {
        font-size: 1.75rem;
    }

    .total-weight .weight-value {
        font-size: 1.3rem;
    }

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

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .calculate-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .calculate-btn:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #474747, #303030);
    }

    .plate-btn:hover {
        border-color: #3d3d3d;
        background: #1e1e1e;
    }

    .plate-btn:active {
        border-color: #5a5a5a;
        background: #303030;
    }

    .nav-btn:hover {
        background: transparent;
    }

    .nav-btn:active {
        background: #303030;
    }

    .plate-tag.clickable:hover {
        background: #303030;
        transform: none;
    }

    .plate-tag.clickable:active {
        background: #dc2626;
        transform: scale(0.95);
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-top: 55px;
    }

    .header {
        height: 45px;
    }

    .header h1 {
        font-size: 1rem;
    }

    .sidebar {
        top: 45px;
        height: calc(100vh - 45px);
    }

    .overlay {
        top: 45px;
    }

    .tool-section {
        padding: 15px;
    }

    .barbell-visual {
        padding: 10px 5px;
    }
}
