/* ══════════════════════════════════════════════════════════
   Guerrier du Code — Custom Styles
   ══════════════════════════════════════════════════════════ */

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f0f23;
}
::-webkit-scrollbar-thumb {
    background: #2a2a4a;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a5a;
}

/* ── Selection ─────────────────────────────────────────── */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

/* ── Transitions ───────────────────────────────────────── */
* {
    scroll-behavior: smooth;
}

/* ── HTMX loading indicator ────────────────────────────── */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator {
    opacity: 1;
}
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* ── Prose overrides for dark mode ─────────────────────── */
.prose-invert pre {
    background: #0a0a1a;
    border: 1px solid #2a2a4a;
    border-radius: 0.5rem;
    padding: 1rem;
}
.prose-invert code {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* ── Line clamp utility ────────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Monaco editor container ───────────────────────────── */
#monaco-editor {
    min-height: 300px;
}
#monaco-editor .monaco-editor {
    border-radius: 0;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-shimmer {
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a4a 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ── Loading skeleton ──────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a4a 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* ── Badge shine effect ────────────────────────────────── */
.badge-shine {
    position: relative;
    overflow: hidden;
}
.badge-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 60%
    );
    animation: shimmer 3s infinite;
}

/* ── Streak fire effect ────────────────────────────────── */
.streak-fire {
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

/* ── XP bar animation ──────────────────────────────────── */
.xp-bar {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Focus styles ──────────────────────────────────────── */
input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* ── Toast animations ──────────────────────────────────── */
[x-transition\:enter] {
    transition: all 0.3s ease-out;
}
[x-transition\:leave] {
    transition: all 0.2s ease-in;
}
