/* Base styles */
:root {
    --primary: #008080;
    --primary-dark: #008080;
    --primary-light: #008080;
    --secondary: #f0f4f8;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #888888;
    --background: #ffffff;
    --border: #e0e0e0;
    --error: #e53935;
    --success: #43a047;
    --warning: #ffa000;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text);
    background-color: var(--background);
    line-height: 1.6;
    font-size: 16px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Header and Navigation */
.main-header {
    background-color: var(--background);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Logo container (image + text if needed) */
.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text);
    margin: 5px 0;
    transition: var(--transition);
}

/* Footer */
footer {
    background-color: var(--secondary);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Exercise Cards */
.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.exercise-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.exercise-card:hover {
    transform: translateY(-5px);
}

.exercise-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.exercise-image.placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.exercise-info {
    padding: 15px;
}

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

.exercise-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.exercise-category {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: #e0e0e0;
    color: #333;
    text-transform: capitalize;
}

.exercise-category.neck {
    background: #ffebee;
    color: #c62828;
}

.exercise-category.shoulder {
    background: #e3f2fd;
    color: #1565c0;
}

.exercise-category.back {
    background: #e8f5e9;
    color: #2e7d32;
}

.exercise-category.knee {
    background: #fff3e0;
    color: #ef6c00;
}

.exercise-category.ankle {
    background: #f3e5f5;
    color: #7b1fa2;
}

.exercise-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.exercise-details {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.exercise-details strong {
    color: #333;
}

.exercise-actions {
    display: flex;
    gap: 10px;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    padding: 40px;
}

.loading-spinner p {
    margin-top: 15px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4a89dc;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-exercise-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 4px;
    margin: 15px 0;
}

.modal-exercise-details {
    margin: 20px 0;
}

.modal-exercise-details h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.instructions {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    line-height: 1.6;
}

.exercise-specs {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.spec {
    flex: 1;
    text-align: center;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
}

.spec h4 {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.spec p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    flex: 1;
    margin-right: 15px;
}

.toast-title {
    font-weight: 600;
    margin: 0 0 5px 0;
}

.toast-message {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Tabs */
.tabs {
    margin-top: 30px;
}

.tabs-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.tab-trigger {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    background: #f0f0f0;
    color: #666;
}

.tab-trigger.active {

    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .exercise-grid {
        grid-template-columns: 1fr;
    }
    
    .exercise-actions {
        flex-direction: column;
    }
    
    .exercise-actions .btn {
        width: 100%;
    }
}
/* Routines Page */
.routine-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.routine-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.routine-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f5f5f5;
    color: #333;
}

.icon {
    font-size: 1rem;
}

.routine-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 15px;
}

.routine-exercises {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exercise-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #333;
}

.exercise-tag.neck {
    background: #ffebee;
    color: #c62828;
}

.exercise-tag.shoulder {
    background: #e3f2fd;
    color: #1565c0;
}

.exercise-tag.back {
    background: #e8f5e9;
    color: #2e7d32;
}

.exercise-tag.knee {
    background: #fff3e0;
    color: #ef6c00;
}

.exercise-tag.ankle {
    background: #f3e5f5;
    color: #7b1fa2;
}

.exercise-tag.more {
    background: #f0f0f0;
    color: #666;
}

/* Routine Builder */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.card-content {
    padding: 20px;
}

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

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

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

.section-header h3 {
    margin: 0;
    font-size: 1rem;
}

.empty-builder {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 4px;
}

.empty-builder p {
    margin-bottom: 15px;
    color: #666;
}

.exercise-list {
    border: 1px solid #eee;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.exercise-item:last-child {
    border-bottom: none;
}

.exercise-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
}

.empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .routine-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .routine-actions {
        align-self: flex-end;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
/* Progress Page */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-content h3 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
}

.stats-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Activity Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.calendar-day-label {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.calendar-empty-cell {
    visibility: hidden;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: default;
}

.calendar-day.activity-level-1 {
    background: #c6e48b;
}

.calendar-day.activity-level-2 {
    background: #7bc96f;
}

.calendar-day.activity-level-3 {
    background: #239a3b;
}

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
}

.legend-box {
    width: 15px;
    height: 15px;
    border-radius: 2px;
}

.legend-box.level-0 {
    background: #f0f0f0;
}

.legend-box.level-1 {
    background: #c6e48b;
}

.legend-box.level-2 {
    background: #7bc96f;
}

.legend-box.level-3 {
    background: #239a3b;
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.activity-icon {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
}

.activity-content p {
    margin: 0;
    color: #666;
    font-size: 0.8rem;
}

.activity-duration {
    font-weight: 600;
    color: #4a89dc;
}

.empty-activity {
    text-align: center;
    padding: 30px;
}

.empty-activity p {
    margin-bottom: 15px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .activity-duration {
        align-self: flex-end;
    }
}
