/* ===========================================
   PUDGY/IGLOO PREMIUM DESIGN SYSTEM
   =========================================== */

:root {
    /* Brand Palette - Inspired by Igloo.inc */
    --color-bg: #F8FAFC;
    /* Clean light background */
    --color-primary: #383E4E;
    /* Deep Blue Grey (Igloo) */
    --color-accent: #3B82F6;
    /* Vibrant Tech Blue */
    --color-accent-hover: #2563EB;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;

    /* Surface Colors - Glassmorphism */
    --glass-surface: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --blur-strength: 16px;

    /* Typography */
    --font-heading: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;

    /* Geometry */
    --radius-sm: 0.5rem;
    /* 8px */
    --radius-md: 0.75rem;
    /* 12px */
    --radius-lg: 1rem;
    /* 16px */
    --radius-xl: 1.5rem;
    /* 24px - for cards */
    --radius-pill: 9999px;
    /* for buttons */
}

/* ===========================================
   CORE RESET & TYPOGRAPHY
   =========================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.025em;
    /* Tight tracking for modern feel */
    font-weight: 700;
}

/* ===========================================
   UTILITY CLASSES (GLASSMORPHISM)
   =========================================== */

.glass-panel {
    background: var(--glass-surface);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-xl);
}

.glass-header {
    background: rgba(255, 255, 255, 0.85);
    /* Slightly more opaque */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* ===========================================
   COMPONENTS
   =========================================== */

/* Premium Buttons */
.btn-primary {
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(56, 62, 78, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(56, 62, 78, 0.4);
}

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

.btn-accent {
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
}

/* Rounded Cards */
.card-premium {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* Inputs */
input,
select {
    border-radius: var(--radius-md) !important;
    border: 1px solid #E2E8F0 !important;
    background: #F8FAFC !important;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    background: white !important;
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none;
}

/* ===========================================
   SCANNER SPECIFIC
   =========================================== */

#scanner video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--radius-xl);
}

#scanner-overlay {
    border-radius: var(--radius-xl);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

/* Fade Up Entry (Classic modern reveal) */
.animate-fade-up {
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* Pulse Glow (for active states) */
@keyframes pulse-soft {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite;
}

/* Swipe Actions */
.swipe-item {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border-radius: var(--radius-lg);
}

/* ========================================
   RESPONSIVE LAYOUT
   ======================================== */
@media (min-width: 768px) {
    .scan-list-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    #app {
        max-width: 64rem;
        /* Standard max-w-5xl */
    }

    .scan-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem !important;
    }

    .btn-primary {
        padding: 0.875rem 1.5rem;
        width: 100%;
        justify-content: center;
        display: flex;
    }
}