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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.header {
    background: #000;
    color: white;
    padding: 20px 40px;
    border-bottom: 3px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 40px;
    cursor: pointer;
}

.header h1 {
    font-size: 1.8em;
    font-weight: 300;
    letter-spacing: 2px;
}

.header-right a {
    color: white;
    text-decoration: none;
    font-size: 0.95em;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.header-right a:hover {
    opacity: 1;
    text-decoration: underline;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    min-height: calc(100vh - 100px);
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    background: #000;
    color: white;
    border: none;
    padding: 10px 24px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    height: 42px;
}

.btn:hover {
    background: #333;
}

.btn-secondary {
    background: white;
    color: #000;
    border: 2px solid #000;
    padding: 8px 22px;
}

.btn-secondary:hover {
    background: #f8f9fa;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: start;
}

input[type="text"] {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    font-size: 0.95em;
    font-weight: 300;
    min-width: 200px;
    height: 42px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #000;
}

.filter-dropdown {
    position: relative;
    min-width: 200px;
}

.category-info-link {
    display: block;
    text-align: center;
    font-size: 0.85em;
    color: #666;
    text-decoration: none;
    margin-top: 5px;
}

.category-info-link:hover {
    color: #000;
    text-decoration: underline;
}

.filter-button {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    background: white;
    text-align: left;
    font-size: 0.95em;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 42px;
}

.filter-button:hover {
    border-color: #000;
}

.filter-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #000;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 2px;
}

.filter-menu.active {
    display: block;
}

.filter-option {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-option:hover {
    background: #f8f9fa;
}

.filter-option input {
    margin-right: 8px;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    background: white;
    color: #666;
    border: none;
    padding: 12px 30px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 400;
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab:hover {
    color: #000;
}

.tab.active {
    color: #000;
    border-bottom-color: #000;
}

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

.exercise-card {
    border: 2px solid #e0e0e0;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.exercise-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.exercise-image:hover {
    opacity: 0.9;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex !important;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.exercise-content {
    padding: 20px;
}

.exercise-card:hover {
    border-color: #000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.exercise-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #000;
    letter-spacing: 0.5px;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #ccc;
    transition: color 0.3s ease;
}

.favorite-btn.active {
    color: #FED235;
}

.exercise-info {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.exercise-label {
    font-weight: 600;
    color: #000;
}

.exercise-notes {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
    white-space: pre-line;
}

.notes-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notes-content.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.read-more {
    color: #000;
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: underline;
    margin-top: 5px;
    display: inline-block;
}

.video-link {
    display: inline-block;
    color: #000;
    text-decoration: none;
    margin-top: 10px;
    font-weight: 400;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.video-link:hover {
    border-bottom-color: #000;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h2 {
    font-size: 1.5em;
    font-weight: 300;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 20px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .logo {
        height: 30px;
    }
    
    .container {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .filters {
        flex-direction: column;
        width: 100%;
    }
    
    .filters > * {
        width: 100%;
        min-width: unset;
    }
    
    input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .exercise-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
    }
    
    .exercise-card {
        width: 100%;
        max-width: 100%;
    }
    
    .exercise-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 200px;
    }
    
    .exercise-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .lightbox img {
        max-width: 90%;
        max-height: 70vh;
    }
}