/* Components — Header, buttons, search, cards, grid */

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.back-btn {
    background: #1a1a1a;
    color: #3b82f6;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid #2a2a2a;
    transition: background 0.15s;
}

.back-btn:hover {
    background: #252525;
}

/* Sync Buttons */
.sync-buttons {
    display: flex;
    gap: 8px;
}

.sync-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.sync-btn:hover:not(:disabled) {
    background: #2563eb;
}

.sync-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.sync-btn-secondary {
    background: #6b7280;
}

.sync-btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

/* Search */
.search-box {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 16px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box:focus {
    border-color: #3b82f6;
}

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

.exercise-card {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.exercise-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
}

.exercise-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.exercise-stats {
    display: flex;
    gap: 16px;
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}

.latest-session {
    border-top: 1px solid #2a2a2a;
    padding-top: 10px;
}

.latest-session .label {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 6px;
}

.mini-sets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mini-set {
    background: #252525;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #aaa;
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* Category Dropdown */
.category-dropdown {
    position: relative;
}

.category-dropdown-btn {
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #2a2a2a;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.15s;
    white-space: nowrap;
}

.category-dropdown-btn:hover {
    border-color: #3b82f6;
    background: #252525;
}

.category-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 6px 0;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.category-dropdown.open .category-dropdown-menu {
    display: block;
}

.category-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #e0e0e0;
    transition: background 0.1s;
    user-select: none;
}

.category-option:hover {
    background: #252525;
}

.category-option input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Muscle Tags */
.muscle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.muscle-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sync-buttons {
        width: 100%;
        flex-wrap: wrap;
    }

    .category-dropdown {
        width: 100%;
    }

    .category-dropdown-btn {
        width: 100%;
    }

    .category-dropdown-menu {
        left: 0;
        right: 0;
    }

    .sync-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 13px;
    }

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