* {
    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, #1e293b 0%, #581c87 50%, #1e293b 100%);
    min-height: 100vh;
    color: #fff;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-dumbbell {
    width: 2.5rem;
    height: 2.5rem;
    color: #c084fc;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: bold;
}

.subtitle {
    color: #e9d5ff;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
    color: #e9d5ff;
}

.tab:hover {
    background: #334155;
}

.tab.active {
    background: #9333ea;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.3);
}

/* Content */
.content {
    margin-top: 1.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.875rem;
    font-weight: bold;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #9333ea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #7e22ce;
}

.btn-success {
    background: #16a34a;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-success:hover {
    background: #15803d;
}

.btn-cancel {
    background: #475569;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-cancel:hover {
    background: #334155;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s;
}

.btn-icon.edit {
    color: #60a5fa;
}

.btn-icon.edit:hover {
    color: #93c5fd;
}

.btn-icon.delete {
    color: #f87171;
}

.btn-icon.delete:hover {
    color: #fca5a5;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Forms */
.form-card {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #9333ea;
}

.form-card h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #e9d5ff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input, textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #334155;
    color: white;
    border: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #1e293b;
    margin: 2% auto;
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #c084fc;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #e9d5ff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #f87171;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Exercise Tree */
.exercise-tree {
    background: #0f172a;
    border-radius: 0.5rem;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.muscle-category {
    margin-bottom: 0.5rem;
}

.category-header {
    background: #1e293b;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    user-select: none;
}

.category-header:hover {
    background: #334155;
}

.category-icon {
    transition: transform 0.3s;
    font-size: 0.75rem;
    color: #9333ea;
}

.category-header.expanded .category-icon {
    transform: rotate(90deg);
}

.category-name {
    font-weight: 600;
    font-size: 1rem;
}

.category-content {
    display: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.category-content.expanded {
    display: block;
}

/* Subcategories */
.subcategory {
    margin-bottom: 0.5rem;
}

.subcategory-header {
    background: #334155;
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    user-select: none;
}

.subcategory-header:hover {
    background: #475569;
}

.subcategory-icon {
    transition: transform 0.3s;
    font-size: 0.65rem;
    color: #c084fc;
}

.subcategory-header.expanded .subcategory-icon {
    transform: rotate(90deg);
}

.subcategory-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #e9d5ff;
}

.subcategory-content {
    display: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.subcategory-content.expanded {
    display: block;
}

/* Exercise Items */
.exercise-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.exercise-item:hover {
    background: #475569;
}

.exercise-checkbox {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: #9333ea;
}

.exercise-item span {
    font-size: 0.875rem;
    color: #cbd5e1;
}

/* Selected Exercises Preview */
.selected-exercises-preview {
    margin-top: 1.5rem;
    background: #0f172a;
    border-radius: 0.5rem;
    padding: 1rem;
}

.selected-exercises-preview h4 {
    color: #c084fc;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

#selected-exercises-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-exercise-tag {
    background: #9333ea;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-exercise-tag .remove-exercise {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.selected-exercise-tag .remove-exercise:hover {
    color: #f87171;
}

/* Routines List */
.routines-list {
    display: grid;
    gap: 1rem;
}

.routine-card {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 2px solid #334155;
    transition: all 0.3s;
}

.routine-card:hover {
    border-color: #9333ea;
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.3);
}

.routine-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.routine-info h3 {
    font-size: 1.5rem;
    color: #c084fc;
    margin-bottom: 0.5rem;
}

.routine-info p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.routine-actions {
    display: flex;
    gap: 0.5rem;
}

.routine-exercises {
    margin-top: 1rem;
}

.routine-exercises h4 {
    color: #e9d5ff;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.exercise-badge {
    background: #334155;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* ===== NUEVA SECCIÓN: ENTRENAMIENTO ===== */

/* Training View */
.training-view {
    animation: fadeIn 0.3s;
}

.training-header {
    background: #1e293b;
    border: 2px solid #9333ea;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.training-header h2 {
    color: #c084fc;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.training-date {
    color: #94a3b8;
    font-size: 0.9rem;
}

.training-actions {
    display: flex;
    gap: 0.75rem;
}

/* Training Exercises List */
.training-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.training-exercise-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.training-exercise-card:hover {
    border-color: #9333ea;
}

.training-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #334155;
}

.training-exercise-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #e9d5ff;
}

.btn-view-history {
    background: #475569;
    color: #e9d5ff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view-history:hover {
    background: #64748b;
}

/* Series Container */
.series-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.series-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    background: #0f172a;
    padding: 1rem;
    border-radius: 0.5rem;
}

.series-label {
    font-weight: 600;
    color: #c084fc;
    min-width: 80px;
}

.series-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.series-input-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.series-input {
    padding: 0.5rem;
    border-radius: 0.4rem;
    background: #334155;
    color: white;
    border: 2px solid #475569;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.series-input:focus {
    outline: none;
    border-color: #9333ea;
}

.series-input::placeholder {
    color: #64748b;
}

.btn-add-series {
    background: #16a34a;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0.75rem;
}

.btn-add-series:hover {
    background: #15803d;
}

.btn-remove-series {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-remove-series:hover {
    background: #dc2626;
}

/* Notes Section */
.exercise-notes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #334155;
}

.exercise-notes label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.exercise-notes textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.75rem;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.exercise-notes textarea:focus {
    outline: none;
    border-color: #9333ea;
}

/* Progress List */
.progress-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.progress-card {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 2px solid #334155;
    transition: all 0.3s;
}

.progress-card:hover {
    border-color: #9333ea;
}

.progress-card h3 {
    color: #c084fc;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.progress-date {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.progress-exercises {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #334155;
}

.progress-exercise-item {
    background: #0f172a;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.progress-exercise-item:last-child {
    margin-bottom: 0;
}

.progress-exercise-name {
    color: #e9d5ff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-series-data {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.progress-series-badge {
    background: #334155;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.progress-notes {
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #0f172a;
    border-radius: 0.4rem;
}

/* Scrollbar */
.exercise-tree::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.training-exercises-list::-webkit-scrollbar {
    width: 8px;
}

.exercise-tree::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.training-exercises-list::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 10px;
}

.exercise-tree::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.training-exercises-list::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

.exercise-tree::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.training-exercises-list::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .exercises-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .training-header {
        flex-direction: column;
        align-items: stretch;
    }

    .training-actions {
        flex-direction: column;
    }

    .series-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .btn-remove-series {
        width: 100%;
    }
   
 
}

}

}

}