/* ================================
   ESTILOS GLOBALES
================================= */

/* Mejorar la visibilidad de los placeholders en toda la app (soporte tema oscuro) */
::placeholder {
    color: oklch(var(--bc) / 0.5) !important;
    opacity: 1 !important;
}

/* Animaciones Generales */
.success-animation { animation: pulse 1s infinite; color: oklch(var(--su)); }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* ================================
   ANIMACIONES DE MODALES (UX)
================================= */
dialog[open] {
    animation: modal-slide-up 0.25s ease-out;
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

dialog::backdrop {
    animation: backdrop-fade 0.2s ease-out;
}

@keyframes backdrop-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ================================
   TERMINAL
================================= */
/* Scrollbar de la Terminal */
#terminal-container::-webkit-scrollbar { width: 8px; }
#terminal-container::-webkit-scrollbar-track { background: transparent; }
#terminal-container::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* BotÃ³n copiar en lÃ­neas del terminal */
.terminal-line { position: relative; }
.terminal-line .copy-btn {
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: oklch(var(--bc) / 0.5);
}
.terminal-line:hover .copy-btn { opacity: 1; }

/* ================================
   MOBILE: TERMINAL COLAPSABLE
================================= */
#terminal-body {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}
#terminal-body.collapsed {
    max-height: 0 !important;
    opacity: 0;
}

/* ================================
   NOTIFICACIÃ“N DE LOGRO (ACHIEVEMENT)
================================= */
@keyframes achievement-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.achievement-notif {
    animation: achievement-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================================
   FLOATER BOTÃ“N IA EN MÃ“VIL
================================= */
@keyframes float-pulse {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-4px); }
}
#ai-float-btn {
    animation: float-pulse 2s ease-in-out infinite;
}

/* ================================
   ONBOARDING TOOLTIP
================================= */
.onboarding-tooltip {
    position: fixed;
    z-index: 9998;
    background: oklch(var(--p));
    color: oklch(var(--pc));
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 240px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: modal-slide-up 0.25s ease-out;
    pointer-events: none;
}

.onboarding-tooltip::after {
    content: '';
    position: absolute;
    border: 8px solid transparent;
}

/* ================================
   ESTILOS PARA EDITOR HTML (QUILL)
================================= */
.ql-toolbar.ql-snow {
    background-color: transparent;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    border-color: oklch(var(--bc) / 0.2);
    transition: border-color 0.2s ease;
}
.ql-container.ql-snow {
    background-color: transparent;
    color: oklch(var(--bc));
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    border-color: oklch(var(--bc) / 0.2);
    transition: border-color 0.2s ease;
    font-family: inherit;
    font-size: 1rem;
}
.ql-editor { min-height: 150px; }
.quill-wrapper { border-radius: 0.5rem; }
.quill-wrapper:focus-within { outline: 2px solid oklch(var(--p)); outline-offset: 2px; }
.quill-wrapper:focus-within .ql-toolbar.ql-snow,
.quill-wrapper:focus-within .ql-container.ql-snow { border-color: oklch(var(--p)); }
.ql-editor.ql-blank::before { color: oklch(var(--bc) / 0.5) !important; font-style: normal !important; }
/* === GAMIFICACIÓN PREMIUM === */
@keyframes fire-aura { 
    0% { box-shadow: 0 0 5px #f97316, 0 0 10px #fbbf24; transform: scale(1); } 
    50% { box-shadow: 0 0 15px #f97316, 0 0 30px #fbbf24, 0 0 45px #f59e0b; transform: scale(1.05); } 
    100% { box-shadow: 0 0 5px #f97316, 0 0 10px #fbbf24; transform: scale(1); } 
}
.streak-aura { 
    animation: fire-aura 2s infinite ease-in-out; 
    border: 2px solid #fbbf24 !important;
    position: relative;
    z-index: 10;
}
.streak-aura::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(45deg, #f97316, #fbbf24, #f59e0b);
    filter: blur(8px);
    opacity: 0.4;
    z-index: -1;
    animation: pulse 2s infinite;
}
.lootbox-pulse { animation: gold-pulse 2s infinite; }
@keyframes gold-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); filter: drop-shadow(0 0 10px #fbbf24); } }

/* === LOOTBOX UNBOXING EXPERIENCE === */
@keyframes lootbox-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}
.animate-lootbox-shake {
    animation: lootbox-shake 0.15s infinite;
}

@keyframes lootbox-open {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    50% { transform: scale(1.4) translateY(-20px); opacity: 0.8; filter: brightness(2); }
    100% { transform: scale(2) translateY(-40px); opacity: 0; }
}
.animate-lootbox-open {
    animation: lootbox-open 0.8s forwards ease-in;
}

@keyframes reward-reveal {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.animate-reward-reveal {
    animation: reward-reveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.rarity-glow-legendary {
    filter: drop-shadow(0 0 15px #fbbf24) drop-shadow(0 0 30px #f59e0b);
}
.rarity-glow-rare {
    filter: drop-shadow(0 0 15px #a78bfa) drop-shadow(0 0 30px #8b5cf6);
}


/* === RESPONSIVIDAD MÓVIL OPTIMIZADA === */
@media (max-width: 640px) {
    main { padding: 0.75rem !important; }
    .prose { font-size: 0.875rem; line-height: 1.4; }
    .prose p { margin-bottom: 0.75rem; }
    .badge { font-size: 0.65rem; height: 1.5rem; padding-left: 0.5rem; padding-right: 0.5rem; }
    
    /* Navbar compacta para pantallas muy pequeñas */
    @media (max-width: 400px) {
        .navbar { padding-left: 0.5rem; padding-right: 0.5rem; gap: 0.5rem; }
        .xs\:inline { display: none !important; }
    }
}

/* Ajuste fino de botones de snippets */
@media (max-width: 640px) {
    .snippet-btn {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
        min-height: 1.6rem !important;
        height: 1.6rem !important;
        font-size: 0.7rem !important;
        border-color: oklch(var(--bc) / 0.1) !important;
    }
    #mobile-quick-type {
        margin-bottom: 0.5rem !important;
    }
}
