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

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

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

h1 {
    font-size: 2.2em;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    font-size: 1em;
}

section {
    margin-bottom: 35px;
}

h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.collapsible-header:hover {
    color: #667eea;
}

.collapsible-header span:first-child {
    flex: 1;
}

.collapse-icon {
    font-size: 0.8em;
    color: #667eea;
    transition: transform 0.3s;
    margin-left: 10px;
}

.input-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group-button {
    grid-column: span 1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
}

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

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

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.equipment-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.save-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.save-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.save-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.equipment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    animation: slideDown 0.3s ease-out;
}

.equipment-subsection {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    min-height: 200px;
}

.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.subsection-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #667eea;
}

.subsection-header-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}


.no-plates {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 10px;
}

@media (max-width: 1200px) {
    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .container {
        max-width: 100%;
        padding: 24px;
    }
}

.barbell-item {
    background: white;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
}

.barbell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.barbell-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
}

.barbell-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.barbell-weight-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.barbell-weight-row .input-group {
    flex: 1;
}

.barbell-exercises-row {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.exercises-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.exercises-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.exercise-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95em;
    color: #555;
    user-select: none;
}

.exercise-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.exercise-checkbox-label:hover {
    color: #667eea;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-remove:hover {
    background: #c82333;
}

.plate-config {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .plate-config {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .plate-config {
        grid-template-columns: 1fr;
    }
}

.plate-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    font-size: 0.95em;
}

.plate-weight-input {
    width: 70px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
}

.plate-count-input {
    width: 50px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
}

.btn-remove-plate {
    background: transparent;
    color: #999;
    border: none;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-remove-plate:hover {
    opacity: 1;
    color: #dc3545;
}

.program-section {
    margin-top: 40px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.program-header h2 {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.program-header-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-print {
    width: auto;
    margin-top: 0;
    padding: 10px 20px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .program-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-print {
        width: 100%;
    }
}

.program-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 1.05em;
}

td {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

tbody tr:hover {
    background: #f8f9fa;
}

.week-header {
    background: #e9ecef;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.set-info {
    margin: 8px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.set-header {
    font-size: 0.95em;
    margin-bottom: 8px;
    color: #333;
}

.barbell-selector {
    display: flex;
    gap: 6px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.barbell-btn {
    padding: 6px 12px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    color: #667eea;
    font-weight: 500;
}

.barbell-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.barbell-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.barbell-label {
    display: inline-block;
    padding: 6px 12px;
    border: 2px solid #667eea;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 500;
}

.combination-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.combo-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85em;
}

.combo-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.combo-option.selected {
    border-color: #667eea;
    background: #e7edff;
    font-weight: 600;
}

.combo-plates {
    flex: 1;
    color: #666;
}

.combo-total {
    color: #28a745;
    font-weight: 600;
}

.no-combination {
    color: #dc3545;
    font-size: 0.85em;
    padding: 8px;
    background: #fff5f5;
    border-radius: 4px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    body {
        padding: 12px;
    }

    h1 {
        font-size: 2em;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .input-group-button {
        grid-column: span 1;
    }

    .plate-config {
        grid-template-columns: 1fr;
    }
}
