/*!
 * Beelang Design System
 * Version: 1.0.0
 * Description: Complete design system for Beelang redesign
 */

/* ===== IMPORT FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    /* ===== TYPOGRAPHY ===== */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
/* Font sizes - Desktop (REVISED - larger) */
    --text-display: 2.75rem;
    --text-h1: 2rem;
    --text-h2: 1.75rem;
    --text-h3: 1.5rem;
    --text-body-lg: 1.375rem;
    --text-body: 1.125rem;
    --text-body-sm: 1rem;
    --text-caption: 0.9375rem;
    --text-small: 0.875rem;
    
    /* Line heights */
    --leading-tight: 1.2;
    --leading-snug: 1.3;
    --leading-normal: 1.4;
    --leading-relaxed: 1.5;
    --leading-loose: 1.6;
    
    /* Letter spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: -0.01em;
    --tracking-wide: 0;
    
    /* ===== COLORS - PRIMARY ===== */
    --color-primary: #1A77AA;
    --color-primary-dark: #15638e;
    --color-primary-darker: #0f4a70;
    --color-primary-light: #E8F4FD;
    --color-primary-lighter: #f0f9ff;
    
    /* ===== COLORS - ACCENT ===== */
    --color-accent: #89C51F;
    --color-accent-dark: #7AB319;
    --color-accent-light: #E8F5E9;
    
    /* ===== COLORS - SEMANTIC ===== */
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-error: #EF4444;
    --color-error-light: #FEE2E2;
    --color-info: #3B82F6;
    --color-info-light: #DBEAFE;
    
    /* ===== COLORS - NEUTRAL ===== */
    --color-white: #FFFFFF;
    --color-black: #000000;
    
    /* ===== COLORS - TEXT ===== */
    --color-text: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-tertiary: #94A3B8;
    --color-text-disabled: #CBD5E1;
    
    /* ===== COLORS - SURFACE ===== */
    --color-surface: #FFFFFF;
    --color-surface-subtle: #F8FAFC;
    --color-surface-raised: #F1F5F9;
    
    /* ===== COLORS - BORDER ===== */
    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;
    --color-border-focus: #1A77AA;
    
    /* ===== SHADOW COLOR (RGB) ===== */
    --shadow-primary: 26, 119, 170;
    --shadow-dark: 0, 0, 0;
    
    /* ===== SPACING ===== */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    
    /* ===== BORDER RADIUS ===== */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 50px;
    
    /* ===== TRANSITIONS ===== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ===== Z-INDEX ===== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-popover: 400;
    --z-tooltip: 500;
}

/* ===== BASE RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    font-family: var(--font-family);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-size: var(--text-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--leading-loose);
    color: var(--color-text);
    background-color: var(--color-surface);
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* ===== TYPOGRAPHY CLASSES ===== */
.text-display {
    font-size: var(--text-display);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}

.text-h1 {
    font-size: var(--text-h1);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--tracking-normal);
    line-height: var(--leading-snug);
}

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

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

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

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

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

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

.text-caption {
    font-size: var(--text-caption);
    font-weight: var(--font-weight-medium);
}

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

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-wrap-balance { text-wrap: balance; }
.text-wrap-pretty { text-wrap: pretty; }

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-primary { color: var(--color-text); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-tertiary); }
.text-accent { color: var(--color-accent); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }

/* ===== LAYOUT CLASSES ===== */
.container {
    width: 100%;
    max-width: var(--beelang-container-max, 1200px);
    margin: 0 auto;
    padding: 0 var(--beelang-container-padding-x, var(--space-4));
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-6);
    }
}

.section {
    margin-bottom: var(--space-8);
}

/* ===== BUTTON COMPONENTS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-size: var(--text-body);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    min-height: 3rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 4px 16px rgba(var(--shadow-primary), 0.25);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--shadow-primary), 0.35);
}

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

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

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary-light);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--color-white);
    box-shadow: 0 4px 16px rgba(137, 197, 31, 0.25);
}

.btn-accent:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(137, 197, 31, 0.35);
}

.btn-accent:active {
    transform: translateY(0) scale(0.98);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-ghost:hover {
    background-color: var(--color-primary-light);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-small);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-body);
}

/* ===== CARD COMPONENTS ===== */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(var(--shadow-primary), 0.15);
}

.card-interactive {
    text-decoration: none;
    display: block;
    cursor: pointer;
}

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

/* Section Card with Tints */
.card-section {
    background-color: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

.card-section.light-tint {
    background: linear-gradient(180deg, #FAFBFC 0%, var(--color-surface-subtle) 100%);
}

.card-section.green-tint {
    background: linear-gradient(180deg, #FAFDF9 0%, var(--color-accent-light) 100%);
}

.card-section.blue-tint {
    background: linear-gradient(180deg, #F0F9FF 0%, var(--color-primary-light) 100%);
}

/* ===== INPUT COMPONENTS ===== */
.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: var(--text-body);
    color: var(--color-text);
    background-color: var(--color-surface);
    transition: all var(--transition-base);
}

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

.input:hover {
    border-color: var(--color-text-tertiary);
}

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

.input:disabled {
    background-color: var(--color-surface-subtle);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== GRID LAYOUTS ===== */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
    .grid-3 { grid-template-columns: 1fr; gap: var(--space-3); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}

/* ===== BADGE COMPONENTS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-small);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-sm);
}

.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-success {
    background-color: var(--color-success-light);
    color: #059669;
}

.badge-warning {
    background-color: var(--color-warning-light);
    color: #D97706;
}

.badge-error {
    background-color: var(--color-error-light);
    color: #DC2626;
}

.badge-pill {
    border-radius: var(--radius-full);
    padding: var(--space-1) var(--space-3);
}

/* Number badge */
.badge-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    border-radius: var(--radius-md);
    font-size: var(--text-small);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
}

/* ===== ALERT COMPONENTS ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

.alert-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-1);
}

.alert-message {
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
}

.alert-info {
    background-color: var(--color-primary-light);
    border: 1px solid var(--color-primary);
}

.alert-success {
    background-color: var(--color-success-light);
    border: 1px solid var(--color-success);
}

.alert-warning {
    background-color: var(--color-warning-light);
    border: 1px solid var(--color-warning);
}

.alert-error {
    background-color: var(--color-error-light);
    border: 1px solid var(--color-error);
}

/* ===== HERO COMPONENT ===== */
.hero {
    background-color: var(--color-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-8) var(--space-6);
    margin-bottom: var(--space-8);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(var(--shadow-primary), 0.25);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: var(--text-display);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-white);
    text-align: center;
    letter-spacing: var(--tracking-tight);
    margin: 0;
}

.hero-subtitle {
    font-size: var(--text-body);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-top: var(--space-2);
}

@media (max-width: 576px) {
    .hero {
        padding: var(--space-6) var(--space-4);
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
}

/* ===== ANIMATION KEYFRAMES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Animation Utility Classes */
.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.5s var(--transition-smooth) forwards;
}

.animate-fade-in-scale {
    opacity: 0;
    animation: fadeInScale 0.5s var(--transition-smooth) forwards;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.3s var(--transition-smooth) forwards;
}

.animate-slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.5s var(--transition-smooth) forwards;
}

.animate-slide-in-right {
    opacity: 0;
    animation: slideInRight 0.5s var(--transition-smooth) forwards;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* Stagger Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.15s; }
.delay-3 { animation-delay: 0.2s; }
.delay-4 { animation-delay: 0.25s; }
.delay-5 { animation-delay: 0.3s; }
.delay-6 { animation-delay: 0.35s; }

/* Card Stagger Animation */
.animate-card-item {
    opacity: 0;
    animation: fadeInUp 0.4s var(--transition-smooth) forwards;
}

.animate-card-item:nth-child(1) { animation-delay: 0.3s; }
.animate-card-item:nth-child(2) { animation-delay: 0.35s; }
.animate-card-item:nth-child(3) { animation-delay: 0.4s; }
.animate-card-item:nth-child(4) { animation-delay: 0.45s; }
.animate-card-item:nth-child(5) { animation-delay: 0.5s; }
.animate-card-item:nth-child(6) { animation-delay: 0.55s; }
.animate-card-item:nth-child(7) { animation-delay: 0.6s; }
.animate-card-item:nth-child(8) { animation-delay: 0.65s; }

/* Hover Animations */
.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

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

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 576px) {
    :root {
        --text-display: 1.5rem;
        --text-h1: 1.25rem;
        --text-h2: 1.125rem;
        --text-h3: 1rem;
        --text-h4: 0.9375rem;
    }
    
    .animate-fade-in-up {
        animation-duration: 0.35s;
    }
    
    .animate-card-item {
        animation-duration: 0.25s;
    }
    
    .animate-card-item:nth-child(n) {
        animation-delay: 0.15s;
    }
}