/* ============================================
   PROMPTZAP REDESIGN - DESIGN SYSTEM
   Based on Apple App Store aesthetic
   Warm, confident, generous whitespace
   ============================================ */

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

/* Font stack prioritizes system fonts for performance */
:root {
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
}

/* ============================================
   COLOR SYSTEM - WARM PALETTE
   ============================================ */
:root {
    /* Backgrounds - Warm dark base */
    --bg-primary: #1a1614;      /* Warm dark base */
    --bg-secondary: #242020;    /* Elevated surfaces */
    --bg-card: #2a2524;         /* Card backgrounds */

    /* Text - Warm whites and grays */
    --text-primary: #faf8f7;    /* Primary text - warm white */
    --text-secondary: #a8a3a0;  /* Secondary text - warm gray */

    /* Accent - Coral/Amber gradient */
    --accent-coral: #ff6b4a;    /* Primary accent */
    --accent-amber: #ffb347;    /* Secondary accent */
    --accent-glow: rgba(255, 107, 74, 0.15);  /* Glow effects */

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);

    /* Semantic Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #06B6D4;
}

/* ============================================
   TYPOGRAPHY SCALE
   ============================================ */
:root {
    /* Font Sizes */
    --text-hero: clamp(3rem, 8vw, 5.5rem);     /* Hero headlines */
    --text-h1: 2.5rem;                          /* Section headers */
    --text-h2: 1.5rem;                          /* Card titles */
    --text-h3: 1.25rem;                         /* Subsection headers */
    --text-body: 1rem;                          /* Body text */
    --text-small: 0.875rem;                     /* Captions, labels */
    --text-tiny: 0.75rem;                       /* Tags, badges */

    /* Letter Spacing */
    --tracking-tight: -0.03em;    /* Headlines */
    --tracking-normal: 0;         /* Body */
    --tracking-wide: 0.1em;       /* Labels, uppercase */

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Font Weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
}

/* ============================================
   SPACING SYSTEM
   ============================================ */
:root {
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 100px;
}

/* ============================================
   BORDER RADIUS
   ============================================ */
:root {
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-full: 9999px;  /* For pills/badges */
}

/* ============================================
   COMPONENT STYLES - BUTTONS
   ============================================ */

/* Primary CTA Button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-amber));
    color: var(--bg-primary);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: var(--weight-semibold);
    font-size: var(--text-body);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 107, 74, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: var(--weight-medium);
    font-size: var(--text-body);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    border-color: var(--accent-coral);
    color: var(--text-primary);
}

/* ============================================
   COMPONENT STYLES - CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Card with accent glow on top */
.card-featured {
    position: relative;
}

.card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-coral), transparent);
}

/* ============================================
   COMPONENT STYLES - INPUT FIELDS
   ============================================ */

.input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: var(--text-body);
    font-family: var(--font-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent-coral);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input::placeholder {
    color: var(--text-secondary);
}

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

/* ============================================
   COMPONENT STYLES - PILLS/TAGS
   ============================================ */

.pill {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--text-small);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pill:hover {
    border-color: var(--accent-coral);
    color: var(--text-primary);
}

.pill.active {
    background: var(--accent-glow);
    border-color: var(--accent-coral);
    color: var(--accent-coral);
}

/* ============================================
   COMPONENT STYLES - BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--text-small);
    color: var(--text-secondary);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-coral);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   COMPONENT STYLES - MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 22, 20, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ============================================
   UTILITY CLASSES - GRADIENTS
   ============================================ */

.gradient-coral-amber {
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-amber));
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   UTILITY CLASSES - GLASS EFFECTS
   ============================================ */

.glass {
    background: rgba(42, 37, 36, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

.glass-nav {
    background: rgba(26, 22, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

/* ============================================
   UTILITY CLASSES - ANIMATIONS
   ============================================ */

/* Fade in animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out both;
}

/* Staggered delays for sequential animations */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* Hover lift effect */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* ============================================
   UTILITY CLASSES - SPACING
   ============================================ */

/* Margin utilities */
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

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

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

/* ============================================
   UTILITY CLASSES - LAYOUT
   ============================================ */

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet and below */
@media (max-width: 768px) {
    :root {
        --text-hero: clamp(2rem, 10vw, 3rem);
        --text-h1: 2rem;
        --text-h2: 1.25rem;
    }

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --space-lg: 24px;
        --space-xl: 32px;
        --space-2xl: 48px;
    }

    .container {
        padding: 0 var(--space-sm);
    }
}

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

/* Focus visible styles */
*:focus-visible {
    outline: 2px solid var(--accent-coral);
    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;
    }
}

/* ============================================
   CUSTOM SCROLLBAR (Webkit)
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
