/* Exercise Page Styles */

.exercise-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.exercise-header {
    margin-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
}

.exercise-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.header-meta {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Primary Tabs */
.exercise-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #1f2937;
}

.tab-button.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Muscle Group Filters */
.muscle-group-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-chip {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.filter-chip.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* Search and Sort Container */
.search-sort-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sort-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Primary Action Bar */
.primary-action-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn .icon {
    font-size: 18px;
}

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

.exercise-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.exercise-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #2563eb;
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background-color: #f3f4f6;
}

.card-content {
    padding: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.card-muscle {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-beginner {
    background-color: #d1fae5;
    color: #065f46;
}

.difficulty-intermediate {
    background-color: #fef3c7;
    color: #92400e;
}

.difficulty-advanced {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Filter Drawer */
.filter-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 360px;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.drawer-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: #1f2937;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
    text-transform: uppercase;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-group label:hover {
    color: #2563eb;
}

.filter-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

.drawer-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 768px) {
    .exercise-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .filter-drawer {
        width: 100%;
    }

    .search-sort-container {
        flex-direction: column;
    }

    .sort-select {
        width: 100%;
    }

    .exercise-header h1 {
        font-size: 24px;
    }

    .exercise-tabs {
        gap: 8px;
    }

    .tab-button {
        padding: 6px 10px;
        font-size: 13px;
    }

    .primary-action-bar {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .exercise-page {
        padding: 12px;
    }

    .exercise-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .muscle-group-filters {
        gap: 4px;
    }

    .filter-chip {
        font-size: 13px;
        padding: 6px 12px;
    }

    .exercise-header h1 {
        font-size: 20px;
    }
}
