/* Animations CSS for PromptZap - Elite UI/UX Design System */

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================
   LEGACY COLOR REFERENCES
   Maintained for backward compatibility
   New code should use variables.css
   ============================================ */
:root {
    /* Brand Identity - mapped to new coral/amber system */
    --brand-primary: var(--accent-coral, #ff6b4a);
    --brand-secondary: var(--accent-amber, #ffb347);
    --brand-gradient: linear-gradient(135deg, var(--accent-coral, #ff6b4a) 0%, var(--accent-amber, #ffb347) 100%);

    /* Semantic Colors (maintained from original) */
    --success: var(--color-success, #10B981);
    --warning: var(--color-warning, #F59E0B);
    --error: var(--color-error, #EF4444);
    --info: var(--color-info, #06B6D4);

    /* Dark Theme - mapped to new warm backgrounds */
    --bg-canvas: var(--bg-primary, #1a1614);
    --bg-surface: var(--bg-secondary, #242020);
    --bg-surface-raised: var(--bg-card, #2a2524);
    --bg-interactive: var(--bg-card, #2a2524);

    /* Text Colors - mapped to new warm text colors */
    --text-tertiary: var(--text-secondary, #a8a3a0);

    /* Type Scale - use new variables.css typography */
    --text-xs: var(--text-tiny, 0.75rem);
    --text-sm: var(--text-small, 0.875rem);
    --text-base: var(--text-body, 1rem);
    --text-lg: var(--text-h3, 1.25rem);
    --text-xl: var(--text-h2, 1.5rem);
    --text-2xl: var(--text-h1, 2.5rem);
    --text-3xl: var(--text-hero, clamp(3rem, 8vw, 5.5rem));
}

/* ============================================
   MOTION DESIGN (Physics-Based Animation)
   ============================================ */

/* Sparkle animation - one-time 1.2s pulse */
@keyframes sparkle {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shimmer effect for button hover */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::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 1s ease-out;
}

.shimmer:hover::before {
    left: 100%;
}

/* Button Shimmer Animation */
@keyframes shimmer-sweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.animate-shimmer-sweep {
    animation: shimmer-sweep 1s ease-out;
}

/* Ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Zen fade - for non-active elements */
.zen-fade {
    opacity: 0.3;
    transition: opacity 0.3s ease-in-out;
}

/* Confetti pieces */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-coral);
    animation: confetti-fall 3s ease-out forwards;
}

.confetti-piece:nth-child(2n) {
    background: var(--accent-amber);
}

.confetti-piece:nth-child(3n) {
    background: var(--color-success);
}

.confetti-piece:nth-child(4n) {
    background: var(--color-warning);
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Pulse glow for Generate button */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 74, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 74, 0.6);
    }
}

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

/* ============================================
   MOMENTUM-BASED ANIMATIONS
   ============================================ */

/* Output Reveal (Momentum-based slide) */
@keyframes slideUpMomentum {
    0% {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    60% {
        transform: translateY(-2%) scale(1.01);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.animate-slideUpMomentum {
    animation: slideUpMomentum 600ms cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom;
}

/* Fade-in Stagger for AI Suggestions */
@keyframes fadeInStagger {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-fadeInStagger {
    animation: fadeInStagger 400ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 300ms ease-out;
}

/* Float Animation (for empty state icon) */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Input Focus Animation */
@keyframes inputFocus {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 74, 0.1);
    }
    100% {
        transform: scale(1.01);
        box-shadow:
            0 0 0 4px rgba(255, 107, 74, 0.1),
            0 8px 32px rgba(255, 107, 74, 0.15);
    }
}

/* Button Scale Animation */
@keyframes buttonActive {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Smooth transitions */
.transition-smooth {
    transition: all 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.transition-momentum {
    transition: all 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glass morphism effect */
.glass {
    background: rgba(26, 27, 34, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient border glow */
.gradient-border-glow {
    position: relative;
}

.gradient-border-glow::before {
    content: '';
    position: absolute;
    inset: -0.5px;
    border-radius: inherit;
    padding: 0.5px;
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-amber));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gradient-border-glow:focus-within::before {
    opacity: 0.2;
}

/* ============================================
   COMPONENT STYLES
   ============================================ */

/* Textarea responsive sizing */
.textarea-responsive {
    min-height: 200px;
    max-height: 600px;
}

/* Thin scrollbar utility */
.scrollbar-thin {
    scrollbar-width: thin;
}

/* ============================================
   NAVIGATION COMPONENTS
   ============================================ */

/* Navigation Link Base Styles */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
    padding-bottom: 8px;
}

/* Active Navigation Link with Warm Gradient Underline */
.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -28px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-coral, #ff6b4a) 0%, var(--accent-amber, #ffb347) 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 107, 74, 0.4);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 200px;
    background: rgba(42, 37, 36, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
}

.user-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary, #a8a3a0);
    transition: all 0.2s ease;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    color: var(--text-primary, #f8f6f4);
    background: rgba(255, 107, 74, 0.1);
}

.user-dropdown .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}

