/* ... (предыдущие стили остаются без изменений) ... */

/* Иконки в кнопках */
.btn-primary i, .btn-secondary i, .btn-logout i {
    margin-right: 8px;
}

/* Анимации для плавного перехода */
#main-content {
    transition: opacity 0.3s ease;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-actions a {
        width: 100%;
        text-align: center;
    }
    
    .exercise-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .remove-exercise {
        width: 100%;
    }
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Стили для страницы аутентификации */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-button.active {
    color: #4BC0C0;
    border-bottom: 2px solid #4BC0C0;
}

.auth-form {
    padding: 30px;
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #4BC0C0;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:click {
    background-color: #3aa9a9;
}

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Стили для основной панели */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

header h1 {
    color: #4BC0C0;
    font-size: 28px;
}

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

.btn-primary, .btn-secondary, .btn-logout {
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #4BC0C0;
    color: white;
}

.btn-primary:hover {
    background-color: #3aa9a9;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.btn-logout {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-logout:hover {
    background-color: #e9ecef;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
}

h3 {
    margin-bottom: 15px;
    color: #4BC0C0;
}

h4 {
    margin: 20px 0 10px;
    color: #666;
}

.exercise-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

.exercise-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.progress-chart {
    height: 300px;
    margin-bottom: 30px;
}

.progress-list {
    max-height: 300px;
    overflow-y: auto;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.progress-date {
    color: #666;
}

.progress-details {
    font-weight: 600;
    color: #4BC0C0;
}

.workout-list {
    margin-bottom: 20px;
}

.workout-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.workout-header h3 {
    margin: 0;
    color: #333;
}

.exercise-count {
    color: #666;
    font-size: 14px;
}

.workout-exercise {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.exercise-name {
    color: #333;
}

.exercise-details {
    color: #4BC0C0;
    font-weight: 600;
}

.workout-more {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.workout-actions {
    text-align: center;
}

/* Формы */
.workout-form, .exercise-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

#exercises-container {
    margin-bottom: 20px;
}

.exercise-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.exercise-row select, .exercise-row input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-exercise {
    width: auto;
    padding: 8px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.remove-exercise:hover {
    background-color: #c82333;
}

#add-exercise {
    width: auto;
    margin-bottom: 20px;
    background-color: #6c757d;
}

#add-exercise:hover {
    background-color: #5a6268;
}

.existing-exercises {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.existing-exercises h4 {
    color: #4BC0C0;
    margin-top: 20px;
}

.existing-exercises ul {
    list-style: none;
    margin-bottom: 20px;
}

.existing-exercises li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .exercise-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .workout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Адаптивное меню для мобильных устройств */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #4BC0C0;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 20px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    max-height: 100vh;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateY(0);
    display: block;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mobile-menu-header h2 {
    color: #4BC0C0;
    margin: 0;
    font-size: 22px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu-actions a {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 16px;
}

.mobile-menu-actions a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.mobile-menu-actions .btn-primary {
    background-color: #4BC0C0;
    color: white;
}

.mobile-menu-actions .btn-primary:hover {
    background-color: #3aa9a9;
}

.mobile-menu-actions .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.mobile-menu-actions .btn-secondary:hover {
    background-color: #5a6268;
}

.mobile-menu-actions .btn-logout {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.mobile-menu-actions .btn-logout:hover {
    background-color: #e9ecef;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.overlay.active {
    display: block;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 940px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .header-actions {
        display: none !important;
    }
    
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
    }
    
    .header h1 {
        margin: 0;
        font-size: 24px;
    }
    
    /* Адаптация контента для мобильных */
    .container {
        padding: 0 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .exercise-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .workout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .progress-chart {
        height: 250px;
    }
    
    /* Улучшение touch-интерфейса */
    button, a {
        min-height: 44px; /* Минимальный размер для touch */
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Убирает zoom на iOS */
    }
    
    /* Гарантируем, что мобильное меню всегда правильно отображается */
    .mobile-menu {
        display: block;
    }
}

/* Стили для редактирования тренировки */
.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.workout-header h2 {
    margin: 0;
    color: #4BC0C0;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-danger:hover {
    background-color: #c82333;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-buttons button {
    flex: 1;
}

/* Стили для карточек тренировок */
.workout-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.workout-card:hover {
    border-color: #4BC0C0;
    box-shadow: 0 2px 8px rgba(75, 192, 192, 0.2);
    transform: translateY(-2px);
}

.workout-card::after {
    content: '✏️';
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.workout-card:hover::after {
    opacity: 1;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .workout-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .workout-card::after {
        opacity: 1; /* Всегда показываем иконку редактирования на мобильных */
    }
}