/* ============================================
   COMPONENTS — Buttons, States, Mobile Menu
   ============================================ */

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(129, 140, 248, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-subtle);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-border-hover);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

/* ============================================
   MOBILE MENU
   ============================================ */

.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--color-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border-subtle);
    gap: var(--space-1);
    animation: slideDown 0.25s var(--ease-out);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-links.active .nav-link {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    width: 100%;
}

.nav-links.active .nav-link:hover {
    background: var(--color-primary-light);
}

/* Burger animation */
.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   EXERCISE CARD STATES
   ============================================ */

.exercise-card.completed {
    border-color: rgba(52, 211, 153, 0.3);
}

.exercise-card.completed::after {
    content: '✓';
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary);
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: var(--radius-full);
}

.exercise-card.completed .category-tag {
    background: var(--color-secondary-light);
    color: var(--color-secondary);
}

/* ============================================
   NO RESULTS STATE
   ============================================ */

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-16);
    color: var(--color-text-muted);
    font-size: var(--text-lg);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--color-border-subtle);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ============================================
   FORM ELEMENTS
   ============================================ */

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23A1A1AA' d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-8);
}

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

input[type="radio"] { border-radius: var(--radius-full); }

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: white;
    border-radius: 50%;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   TABLE STYLING
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-md);
    overflow: hidden;
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
}

th {
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border-subtle);
}

td {
    border-bottom: 1px solid var(--color-border-subtle);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-bg-tertiary); }

/* ============================================
   BADGE
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
}

.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-success { background: var(--color-secondary-light); color: var(--color-secondary); }

/* ============================================
   SPINNER
   ============================================ */

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border-subtle);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   IMAGE / MEDIA
   ============================================ */

img { max-width: 100%; height: auto; }
video { max-width: 100%; border-radius: var(--radius-lg); }

/* ============================================
   MAP CONTAINER
   ============================================ */

.map-container {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: var(--space-6);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}

/* Responsive map height */
@media (max-width: 768px) {
    .map-container iframe {
        min-height: 300px;
    }
}

@media (min-width: 769px) {
    .map-container iframe {
        min-height: 400px;
    }
}