/* ============================================
   Lovu Custom Styles
   Modern, Professional Design System
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors - Sky Blue (from logo) */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;

    /* Accent Colors - Rose/Coral (from logo) */
    --accent-50: #fef2f2;
    --accent-100: #fee4e2;
    --accent-200: #fecdd3;
    --accent-300: #fda4af;
    --accent-400: #fb7185;
    --accent-500: #f43f5e;
    --accent-600: #e11d48;
    --accent-700: #be123c;
    --accent-800: #9f1239;
    --accent-900: #881337;

    /* Secondary Colors - Amber/Gold */
    --secondary-50: #fffbeb;
    --secondary-100: #fef3c7;
    --secondary-200: #fde68a;
    --secondary-500: #f59e0b;
    --secondary-600: #d97706;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-2xl: 2.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* ============================================
   Tailwind Extension Classes
   ============================================ */

/* Primary Color Classes */
.text-primary-600 {
    color: var(--primary-600);
}

.bg-primary-600 {
    background-color: var(--primary-600);
}

.bg-primary-50 {
    background-color: var(--primary-50);
}

.bg-primary-100 {
    background-color: var(--primary-100);
}

.border-primary-500 {
    border-color: var(--primary-500);
}

.hover\:bg-primary-700:hover {
    background-color: var(--primary-700);
}

.hover\:text-primary-700:hover {
    color: var(--primary-700);
}

.focus\:ring-primary-500:focus {
    --tw-ring-color: var(--primary-500);
}

/* Accent Color Classes */
.text-accent-600 {
    color: var(--accent-600);
}

.bg-accent-600 {
    background-color: var(--accent-600);
}

.bg-accent-50 {
    background-color: var(--accent-50);
}

.bg-accent-100 {
    background-color: var(--accent-100);
}

.border-accent-500 {
    border-color: var(--accent-500);
}

.hover\:bg-accent-700:hover {
    background-color: var(--accent-700);
}

.hover\:text-accent-700:hover {
    color: var(--accent-700);
}

/* ============================================
   Animations & Keyframes
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Shake Animation (for errors) */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Shimmer Animation (for loading states) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Animation Classes */
.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-shake {
    animation: shake 0.3s ease-in-out;
}

/* ============================================
   Global Styles & Resets
   ============================================ */

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Focus visible improvements for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ============================================
   Custom Utility Classes
   ============================================ */

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   Component-Specific Styles
   ============================================ */

/* Survey Choice Buttons with Selected State */
.choice-btn.selected {
    background-color: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-600);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* Error Message Styling */
#error-message {
    animation: slideIn 0.3s ease-out;
}

/* Modal Overlay */
#surveyModal {
    animation: fadeIn 0.3s ease-out;
}

#surveyModal > div {
    animation: scaleIn 0.3s ease-out;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-600);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Responsive Utilities
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
}

/* Show only on mobile */
@media (min-width: 769px) {
    .show-mobile {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    header,
    footer,
    #surveyModal {
        display: none;
    }

    body {
        background: white;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-600);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 1000;
    transition: top var(--transition-fast);
}

.skip-to-main:focus {
    top: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-600: #0066cc;
        --accent-600: #cc0033;
    }

    button,
    a {
        text-decoration: underline;
    }
}

/* ============================================
   Dark Mode Support (Optional - Future Enhancement)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Uncomment if dark mode is needed in the future
    :root {
        --gray-50: #1f2937;
        --gray-900: #f9fafb;
    }

    body {
        background-color: var(--gray-900);
        color: var(--gray-100);
    }
    */
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* GPU acceleration for animations */
.will-animate {
    will-change: transform, opacity;
}

/* Prevent layout shift */
img,
video {
    max-width: 100%;
    height: auto;
}
