/* ==========================================
   CONVERSOR DE LETRAS — Estilos Globales
   Dark Mode + Light Mode + Animaciones
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* ── Variables ────────────────────────────────────────────────────────── */
:root {
    --font-heading:  'Outfit', sans-serif;
    --font-body:     'Plus Jakarta Sans', sans-serif;
    --font-mono:     'Fira Code', monospace;
    --primary-grad:  linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --secondary-grad:linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --glow-purple:   0 0 20px rgba(168, 85, 247, 0.35);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* ── Dark Mode (Default) ──────────────────────────────────────────────── */
html.dark body {
    background-color: #0b0f19;
    color: #f1f5f9;
}

html.dark .glass-card {
    background: rgba(15, 23, 42, 0.80);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(255, 255, 255, 0.07);
}

html.dark .input-textarea {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: rgba(51, 65, 85, 0.9);
    color: #f1f5f9;
}

html.dark header {
    background-color: rgba(11, 15, 25, 0.85);
    border-color: rgba(30, 41, 59, 0.9);
}

html.dark footer {
    background-color: #050810;
    border-color: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
}

/* ── Light Mode ───────────────────────────────────────────────────────── */
html:not(.dark) body {
    background-color: #f1f5f9;
    color: #0f172a;
}

html:not(.dark) .glass-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(203, 213, 225, 0.9);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.08);
}

html:not(.dark) .input-textarea {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

html:not(.dark) .font-output-text {
    color: #0f172a !important;
}

html:not(.dark) .category-btn {
    background-color: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

html:not(.dark) header {
    background-color: rgba(255, 255, 255, 0.90);
    border-color: #e2e8f0;
}

html:not(.dark) footer {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

html:not(.dark) footer h3 {
    color: #0f172a !important;
}

/* ── Typography ───────────────────────────────────────────────────────── */
.text-gradient {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* ── Custom Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #6366f1; }
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { scrollbar-width: none; }

/* ── Category Button Active ───────────────────────────────────────────── */
.category-btn.active {
    background: var(--primary-grad) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.40);
    border-color: transparent !important;
}

/* ── Font Output Card ─────────────────────────────────────────────────── */
.font-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    will-change: transform;
}

.font-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.25);
}

.font-output-text {
    font-family: var(--font-mono), 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
    letter-spacing: 0.02em;
    word-break: break-word;
    min-height: 2rem;
}

/* ── Toast Notifications ──────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    animation: toastIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.dark .toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #f1f5f9;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
}

html:not(.dark) .toast {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #0f172a;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
}

.toast.hiding {
    animation: toastOut 0.3s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(18px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1);         }
    to   { opacity: 0; transform: translateY(16px) scale(0.95); }
}

/* ── FAQ Accordion ────────────────────────────────────────────────────── */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
}

.faq-answer.open {
    max-height: 1200px;
    transition: max-height 0.45s ease-in-out;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-icon.rotated {
    transform: rotate(180deg);
}

/* ── Pulse Badge ──────────────────────────────────────────────────────── */
@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.45); }
    50%       { opacity: 0.85; box-shadow: 0 0 0 8px rgba(168, 85, 247, 0); }
}

.pulse-badge {
    animation: pulseGlow 2.8s infinite;
}

/* ── Gradient Background Hero ─────────────────────────────────────────── */
.hero-gradient-bg {
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99,102,241,0.18) 0%, transparent 70%);
}

/* ── Shimmer loading skeleton ─────────────────────────────────────────── */
@keyframes shimmer {
    from { background-position: -400px 0; }
    to   { background-position:  400px 0; }
}

.shimmer {
    background: linear-gradient(90deg,
        rgba(148,163,184,0.1) 25%,
        rgba(148,163,184,0.22) 50%,
        rgba(148,163,184,0.1) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
}

/* ── Input Glow Focus ─────────────────────────────────────────────────── */
.input-textarea:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.30);
}

/* ── Copy button micro-animation ──────────────────────────────────────── */
.copy-btn:active {
    transform: scale(0.94);
}

/* ── Responsive helpers ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .font-output-text {
        font-size: 1rem;
    }
}
