/**
 * KIVO GLOBAL STYLES
 * Unified design system for visual consistency across all pages
 * 
 * USAGE: Include this file in all HTML pages:
 * <link rel="stylesheet" href="kivo-global-styles.css">
 */

/* ============================================
   1. CSS VARIABLES - SINGLE SOURCE OF TRUTH
   ============================================ */
:root {
    /* Primary Purple Scale */
    --primary-50: #faf5ff;
    --primary-100: #f3e8ff;
    --primary-200: #e9d5ff;
    --primary-300: #d8b4fe;
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --primary-700: #7c3aed;
    --primary-800: #6b21a8;
    --primary-900: #581c87;
    
    /* Consistent Gradients */
    --gradient-bg-light: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #ffffff 100%);
    --gradient-hero: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
    --gradient-cta: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #14b8a6 100%);
    --gradient-text: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-light: #f9fafb;
    
    /* Background Colors */
    --bg-primary: #e0d6f5;
    --bg-white: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.6);
    
    /* Border Radius - Consistent Across All Components */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;
    --radius-full: 9999px;
    
    /* Shadows - Consistent Depth */
    --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);
    
    /* Spacing Scale */
    --spacing-xs: 0.25rem;  /* 4px */
    --spacing-sm: 0.5rem;   /* 8px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-2xl: 3rem;    /* 48px */
    --spacing-3xl: 4rem;    /* 64px */
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   2. TYPOGRAPHY - CONSISTENT ACROSS ALL PAGES
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Heading Scale */
h1 {
    font-size: 2.5rem;      /* 40px */
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 2rem;        /* 32px */
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: 1.5rem;      /* 24px */
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h4 {
    font-size: 1.25rem;     /* 20px */
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

/* Mobile Typography Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }      /* 32px */
    h2 { font-size: 1.75rem; }   /* 28px */
    h3 { font-size: 1.25rem; }   /* 20px */
    h4 { font-size: 1.125rem; }  /* 18px */
}

/* ============================================
   3. BACKGROUND - FLUID INK DIFFUSION EFFECT
   ============================================ */
body {
    position: relative;
    min-height: 100vh;
}

/* Ensure all content appears above the fluid background */
body > * {
    position: relative;
    z-index: 1;
}

/* Fluid background design - ink diffusion effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background: 
        radial-gradient(ellipse 800px 600px at 20% 30%, rgba(212, 228, 247, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse 600px 800px at 80% 70%, rgba(201, 179, 230, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse 700px 500px at 50% 90%, rgba(212, 228, 247, 0.55) 0%, transparent 50%),
        radial-gradient(ellipse 500px 700px at 10% 80%, rgba(201, 179, 230, 0.45) 0%, transparent 50%);
    animation: fluidDiffusion 60s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes fluidDiffusion {
    0% {
        background: 
            radial-gradient(ellipse 800px 600px at 20% 30%, rgba(212, 228, 247, 0.6) 0%, transparent 50%),
            radial-gradient(ellipse 600px 800px at 80% 70%, rgba(201, 179, 230, 0.5) 0%, transparent 50%),
            radial-gradient(ellipse 700px 500px at 50% 90%, rgba(212, 228, 247, 0.55) 0%, transparent 50%),
            radial-gradient(ellipse 500px 700px at 10% 80%, rgba(201, 179, 230, 0.45) 0%, transparent 50%);
    }
    50% {
        background: 
            radial-gradient(ellipse 750px 650px at 25% 35%, rgba(212, 228, 247, 0.55) 0%, transparent 50%),
            radial-gradient(ellipse 650px 750px at 75% 65%, rgba(201, 179, 230, 0.55) 0%, transparent 50%),
            radial-gradient(ellipse 650px 550px at 55% 85%, rgba(212, 228, 247, 0.5) 0%, transparent 50%),
            radial-gradient(ellipse 550px 650px at 15% 75%, rgba(201, 179, 230, 0.5) 0%, transparent 50%);
    }
    100% {
        background: 
            radial-gradient(ellipse 700px 700px at 30% 40%, rgba(212, 228, 247, 0.5) 0%, transparent 50%),
            radial-gradient(ellipse 700px 700px at 70% 60%, rgba(201, 179, 230, 0.6) 0%, transparent 50%),
            radial-gradient(ellipse 600px 600px at 60% 80%, rgba(212, 228, 247, 0.6) 0%, transparent 50%),
            radial-gradient(ellipse 600px 600px at 20% 70%, rgba(201, 179, 230, 0.4) 0%, transparent 50%);
    }
}

/* ============================================
   4. BUTTONS - CONSISTENT STYLES & INTERACTIONS
   ============================================ */
.kivo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    min-height: 44px; /* Accessibility: Touch target size */
}

/* Primary Button */
.kivo-btn-primary {
    background: var(--gradient-hero);
    color: white;
    box-shadow: var(--shadow-lg);
}

.kivo-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.kivo-btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.kivo-btn-secondary {
    background: white;
    color: var(--primary-700);
    border: 2px solid var(--primary-200);
    box-shadow: var(--shadow-sm);
}

.kivo-btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
}

/* Outline Button */
.kivo-btn-outline {
    background: transparent;
    color: var(--primary-700);
    border: 2px solid var(--primary-500);
}

.kivo-btn-outline:hover {
    background: var(--primary-50);
}

/* Button Sizes */
.kivo-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.kivo-btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

/* ============================================
   5. CARDS - CONSISTENT STYLING
   ============================================ */
.kivo-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-slow);
}

.kivo-card-elevated {
    background-color: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
}

.kivo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

/* Card Variants */
.kivo-card-flat {
    box-shadow: var(--shadow-sm);
}

.kivo-card-elevated {
    box-shadow: var(--shadow-xl);
}

/* ============================================
   6. FORM INPUTS - CONSISTENT STYLING
   ============================================ */
.kivo-input,
.kivo-textarea,
.kivo-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: white;
    border: 2px solid var(--primary-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    min-height: 44px; /* Accessibility */
}

.kivo-input:focus,
.kivo-textarea:focus,
.kivo-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.kivo-input::placeholder,
.kivo-textarea::placeholder {
    color: var(--text-tertiary);
}

/* Textarea specific */
.kivo-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   7. NAVIGATION - CONSISTENT HEADER
   ============================================ */
.kivo-nav {
    background: white;
    border-bottom: 1px solid var(--primary-100);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.kivo-nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.kivo-nav-logo {
    height: 40px;
    width: auto;
    transition: transform var(--transition-base);
}

.kivo-nav-logo:hover {
    transform: scale(1.05);
}

.kivo-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-weight: 500;
}

.kivo-nav-link:hover {
    color: var(--primary-700);
    background: var(--primary-50);
}

/* ============================================
   8. FOOTER - CONSISTENT STYLING
   ============================================ */
.kivo-footer {
    background: white;
    border-top: 1px solid var(--primary-100);
    padding: var(--spacing-2xl) 0;
    margin-top: var(--spacing-3xl);
}

.kivo-footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.kivo-footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.kivo-footer-link:hover {
    color: var(--primary-700);
}

/* ============================================
   9. UTILITY CLASSES
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   10. ACCESSIBILITY & MOBILE OPTIMIZATIONS
   ============================================ */
/* iPhone Safari Auto-Zoom Fix */
input, select, textarea {
    font-size: 16px !important; /* Prevent Safari zoom */
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

html, body {
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

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

/* 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;
    }
}

/* ============================================
   11. RESPONSIVE BREAKPOINTS
   ============================================ */
/* Mobile: < 640px (default) */
/* Tablet: 640px - 1024px */
/* Desktop: > 1024px */

@media (min-width: 640px) {
    .kivo-card {
        padding: var(--spacing-2xl);
    }
}

@media (min-width: 1024px) {
    h1 { font-size: 3rem; }      /* 48px on large screens */
    h2 { font-size: 2.25rem; }   /* 36px on large screens */
}

