/* ========================================
   GAMES COMPONENTS - Shared UI Elements
   Reusable components for all games
   ======================================== */

/* ========================================
   1. CEFR BLOB SELECTOR
   ======================================== */
.cefr-container {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-self: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--header-border) 30%, transparent);
    background: color-mix(in srgb, var(--header-border) 18%, transparent);
    transition: all 0.3s ease;
}

.cefr-blob {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    opacity: 0.3;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.cefr-blob:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

.cefr-blob.active {
    opacity: 1;
    transform: scale(1.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* CEFR Color Classes */
.cefr-pre-a1 { background: #facc15; }
.cefr-a1 { background: #6ee7b7; }
.cefr-a2 { background: #34d399; }
.cefr-b1 { background: #3b82f6; }
.cefr-b2 { background: #8b5cf6; }
.cefr-c1 { background: #f59e0b; }
.cefr-c2 { background: #ef4444; }

/* ========================================
   2. DARK MODE TOGGLE
   ======================================== */
.dark-mode-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
}

.dark-mode-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 2px solid var(--border-color);
}

/* Hide the actual checkbox - it's only for functionality */
.dark-mode-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dark-mode-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}

[data-theme="dark"] .dark-mode-switch {
    background: var(--primary);
}

[data-theme="dark"] .dark-mode-switch::before {
    transform: translateX(20px);
}

/* ========================================
   3. BUTTON STYLES
   ======================================== */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

/* ========================================
   4. UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 1rem;
}

.gap-lg {
    gap: 1.5rem;
}

