/**
 * Optimitz Modern Design System
 * Inspired by Canva - Vibrant, Colorful, Playful
 * Version: 4.0 - Colorful & Aesthetic
 */

/* ============================================
   COLOR SYSTEM - VIBRANT & PLAYFUL
   ============================================ */

:root {
    /* Backgrounds - Colorful theme */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FEF3C7;
    --bg-tertiary: #E0E7FF;
    --bg-quaternary: #FCE7F3;
    --bg-quinary: #D1FAE5;

    /* Text colors */
    --text-primary: #0F1419;
    --text-secondary: #536471;
    --text-tertiary: #8B98A5;

    /* Vibrant Brand Colors */
    --purple: #8B5CF6;
    --purple-light: #A78BFA;
    --purple-dark: #7C3AED;
    --pink: #EC4899;
    --pink-light: #F472B6;
    --orange: #F97316;
    --orange-light: #FB923C;
    --yellow: #FBBF24;
    --yellow-light: #FCD34D;
    --cyan: #06B6D4;
    --cyan-light: #22D3EE;
    --green: #10B981;
    --green-light: #34D399;
    --blue: #3B82F6;
    --blue-light: #60A5FA;

    /* Primary/Secondary for compatibility */
    --primary: var(--purple);
    --primary-light: var(--purple-light);
    --secondary: var(--cyan);
    --secondary-light: var(--cyan-light);

    /* Vibrant Gradients */
    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-secondary: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
    --gradient-sunset: linear-gradient(135deg, #F97316 0%, #EC4899 50%, #8B5CF6 100%);
    --gradient-rainbow: linear-gradient(135deg, #8B5CF6 0%, #EC4899 25%, #F97316 50%, #FBBF24 75%, #10B981 100%);
    --gradient-ocean: linear-gradient(135deg, #3B82F6 0%, #06B6D4 50%, #10B981 100%);
    --gradient-fire: linear-gradient(135deg, #F97316 0%, #FBBF24 100%);
    --gradient-berry: linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);

    /* Colorful Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
    --shadow-purple: 0 8px 24px rgba(139, 92, 246, 0.3);
    --shadow-pink: 0 8px 24px rgba(236, 72, 153, 0.3);
    --shadow-cyan: 0 8px 24px rgba(6, 182, 212, 0.3);
    --shadow-rainbow: 0 12px 32px rgba(139, 92, 246, 0.2);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    
    /* Font sizes - Bigger, bolder */
    --text-xs: 14px;
    --text-sm: 16px;
    --text-base: 18px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-2xl: 32px;
    --text-3xl: 40px;
    --text-4xl: 48px;
    --text-5xl: clamp(40px, 8vw, 64px);
    
    /* Font weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    
    /* Line heights - Tighter for impact */
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* Spacing - More generous */
    --space-2xs: 8px;
    --space-xs: 12px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 80px;
    --space-4xl: 120px;
    
    /* Border radius - Softer */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-2xl: 48px;
    --radius-full: 9999px;
    
    /* Container widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    
    /* Z-index scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal: 1050;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES & RESET
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */

.text-hero {
    font-size: var(--text-5xl);
    font-weight: var(--weight-extrabold);
    line-height: var(--leading-tight);
}

.text-display {
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
}

.text-h1 {
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
}

.text-h2 {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
}

.text-h3 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
}

.text-lg {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

.text-base {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

.text-sm {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.text-xs {
    font-size: var(--text-xs);
}

/* Text colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* Gradient text */
.text-gradient {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 8s ease infinite;
}

.text-gradient-sunset {
    background: var(--gradient-sunset);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 10s ease infinite;
}

.text-gradient-rainbow {
    background: var(--gradient-rainbow);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 12s ease infinite;
}

.text-gradient-ocean {
    background: var(--gradient-ocean);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 9s ease infinite;
}

@keyframes gradientTextShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Font weights */
.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }
.font-extrabold { font-weight: var(--weight-extrabold); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

@media (min-width: 640px) {
    .container {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flex utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Gap utilities */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ============================================
   SPACING UTILITIES
   ============================================ */

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }
.m-auto { margin: 0 auto; }

/* ============================================
   BORDER RADIUS
   ============================================ */

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   SHADOWS
   ============================================ */

.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ============================================
   TRANSITIONS
   ============================================ */

.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* ============================================
   ACCESSIBILITY
   ============================================ */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    z-index: 9999;
    border-radius: var(--radius-sm);
}

.skip-to-main:focus {
    top: var(--space-sm);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================
   MAX WIDTH UTILITIES
   ============================================ */

.max-w-sm { max-width: var(--container-sm); }
.max-w-md { max-width: var(--container-md); }
.max-w-lg { max-width: var(--container-lg); }
.max-w-xl { max-width: var(--container-xl); }
.max-w-full { max-width: 100%; }
