/* ============================================
   Math Blaster - UI Components
   ============================================ */

/* ---------- Menu Buttons ---------- */
.menu-btn {
    font-family: var(--font-display);
    font-size: clamp(12px, 3.5vw, 16px);
    font-weight: 700;
    padding: 14px 36px;
    margin: 6px;
    border: 2px solid;
    border-radius: var(--radius-lg);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 2px;
    min-width: 200px;
    position: relative;
    overflow: hidden;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.menu-btn:hover::before {
    left: 100%;
}

/* Primary - Blue */
.menu-btn.primary {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3), inset 0 0 15px rgba(0, 212, 255, 0.1);
}

.menu-btn.primary:hover,
.menu-btn.primary:active {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.5), inset 0 0 25px rgba(0, 212, 255, 0.2);
}

/* Secondary - Pink */
.menu-btn.secondary {
    color: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.3), inset 0 0 15px rgba(255, 0, 110, 0.1);
}

.menu-btn.secondary:hover,
.menu-btn.secondary:active {
    background: rgba(255, 0, 110, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 0, 110, 0.5), inset 0 0 25px rgba(255, 0, 110, 0.2);
}

/* Tertiary - Green */
.menu-btn.tertiary {
    color: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 135, 0.3), inset 0 0 15px rgba(0, 255, 135, 0.1);
}

.menu-btn.tertiary:hover,
.menu-btn.tertiary:active {
    background: rgba(0, 255, 135, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 135, 0.5), inset 0 0 25px rgba(0, 255, 135, 0.2);
}

/* Disabled state */
.menu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.menu-btn:disabled::before {
    display: none;
}

/* ---------- Toggle Switch ---------- */
.toggle-switch {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-normal);
    flex-shrink: 0;
    border: none;
    outline: none;
}

.toggle-switch.active {
    background: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--text-primary);
    top: 2px;
    left: 2px;
    transition: left var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active::after {
    left: 22px;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.toggle-switch:hover {
    opacity: 0.9;
}

.toggle-switch:active::after {
    width: 24px;
}

.toggle-switch.active:active::after {
    left: 18px;
}

/* ---------- Reset Button ---------- */
.reset-btn {
    font-family: var(--font-display);
    font-size: 11px;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--neon-pink);
    background: rgba(255, 0, 110, 0.1);
    color: var(--neon-pink);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
}

.reset-btn:hover {
    background: rgba(255, 0, 110, 0.25);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.3);
}

.reset-btn:active {
    transform: scale(0.95);
}

/* ---------- Confirm Dialog ---------- */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: calc(var(--z-ads) + 10);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
}

.confirm-dialog.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-box {
    background: var(--bg-medium);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-box .confirm-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.confirm-box .confirm-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.confirm-actions .confirm-yes,
.confirm-actions .confirm-no {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-md);
    border: 1px solid;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
    min-width: 80px;
}

.confirm-actions .confirm-yes {
    color: var(--neon-pink);
    border-color: var(--neon-pink);
}

.confirm-actions .confirm-yes:hover {
    background: rgba(255, 0, 110, 0.2);
}

.confirm-actions .confirm-no {
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.confirm-actions .confirm-no:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ---------- Spinner ---------- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--neon-blue);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge.badge-boss {
    background: rgba(255, 0, 110, 0.2);
    color: var(--neon-pink);
    border: 1px solid rgba(255, 0, 110, 0.3);
}

.badge.badge-new {
    background: rgba(0, 255, 135, 0.2);
    color: var(--neon-green);
    border: 1px solid rgba(0, 255, 135, 0.3);
}

/* ---------- Divider ---------- */
.divider {
    width: 100%;
    max-width: 300px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    margin: var(--space-lg) 0;
}

/* ---------- Icon Button ---------- */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    padding: 0;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-light);
}

.icon-btn:active {
    transform: scale(0.9);
}

.icon-btn .btn-icon {
    width: 18px;
    height: 18px;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-normal);
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
}

/* ---------- Card Component ---------- */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ---------- Notification Dot ---------- */
.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink);
    position: absolute;
    top: -2px;
    right: -2px;
    animation: dotPulse 1.5s ease infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}