/*
╔═══════════════════════════════════════════════════════════════════════════╗
║  ETSY IMAGE OPTIMIZER - DESIGN SYSTEM                                     ║
║  Inspired by Robinhood (robinhood.com)                                    ║
║  Theme: Premium, Sophisticated, Modern, Tech-Forward                      ║
╚═══════════════════════════════════════════════════════════════════════════╝

DESIGN PRINCIPLES:
- Pure black backgrounds create luxury and sophistication (#0A0A0A)
- Neon green CTAs (#C9FF00) are eye-catching and energetic
- Purple accents (#B565FF) add depth and modern elegance
- High contrast white text on black for maximum readability
- Bold, confident typography with strong hierarchy
- Generous whitespace - premium feel, never cramped
- Subtle glows and shadows for depth and polish
- Pill-shaped buttons for modern, friendly interaction

COLOR SYSTEM:
- Backgrounds: Pure black → Dark gray → Lighter gray (creates depth)
- Primary Accent: Neon green (all CTAs, downloads, primary actions)
- Secondary Accent: Purple (badges, borders, hover states, indicators)
- Text: Pure white → Light gray → Medium gray (excellent readability)

TYPOGRAPHY:
- Font: Inter (clean, modern, professional)
- Scale: Strong hierarchy from 12px to 36px
- Weights: 400 (normal), 500 (medium), 600 (semibold), 700 (bold)
- Line Height: 1.6-1.7 for excellent readability
- White text creates brilliant contrast on black

INTERACTION DESIGN:
- Smooth transitions and hover effects
- Neon green glows on primary buttons
- Purple glows on cards and badges
- Transform on hover for premium feel
- High contrast ensures accessibility

*/

/* ============================================================================
   IMPORTS & RESET
   ========================================================================= */

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

/* Import Newsreader serif font for hero headline (Robinhood-style) */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:wght@400;500;600&display=swap');

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

/* ============================================================================
   DESIGN TOKENS - ROBINHOOD AESTHETIC
   ========================================================================= */

:root {
    /* ═══ BACKGROUNDS - Black & Dark Gray ═══ */
    /* Pure black creates luxury and sophistication */
    --bg-primary: #0A0A0A;          /* Near black - main background (premium!) */
    --bg-secondary: #1A1A1A;        /* Dark gray - cards and panels */
    --bg-tertiary: #252525;         /* Lighter gray - nested elements */
    --bg-hover: #2A2A2A;            /* Hover state - subtle interaction */
    --bg-modal: rgba(0, 0, 0, 0.9); /* Modal overlay - deep black */

    /* ═══ ACCENT COLORS - Neon Green (PRIMARY) ═══ */
    /* Bright, energetic, impossible to miss - Robinhood signature */
    --accent-green: #C9FF00;        /* Neon green - PRIMARY CTAs (download, optimize) */
    --accent-green-hover: #D1FF33;  /* Lighter green on hover */
    --accent-green-dark: #B8E600;   /* Darker green for depth */
    --accent-green-glow: rgba(201, 255, 0, 0.25); /* Glow effect */

    /* ═══ ACCENT COLORS - Purple (SECONDARY) ═══ */
    /* Sophisticated, modern, complements neon green beautifully */
    --accent-purple: #B565FF;       /* Purple - badges, borders, accents */
    --accent-purple-light: #C084FC; /* Lighter purple */
    --accent-purple-dark: #9333EA;  /* Darker purple for contrast */
    --accent-purple-glow: rgba(181, 101, 255, 0.25); /* Glow effect */

    /* ═══ SEMANTIC COLORS ═══ */
    /* Clear communication through color */
    --success: #00C805;             /* Green for success states */
    --success-light: rgba(0, 200, 5, 0.15); /* Light green background */
    --warning: #FFA500;             /* Orange for warnings */
    --warning-light: rgba(255, 165, 0, 0.15); /* Light orange background */
    --danger: #FF5C5C;              /* Red for errors/remove */
    --danger-light: rgba(255, 92, 92, 0.15); /* Light red background */

    /* ═══ TEXT COLORS - White & Gray ═══ */
    /* High contrast for excellent readability on black */
    --text-primary: #FFFFFF;        /* Pure white - main text */
    --text-secondary: #A0A0A0;      /* Light gray - supporting text */
    --text-tertiary: #6B7280;       /* Medium gray - hints & metadata */
    --text-on-green: #000000;       /* Black text on neon green buttons */

    /* ═══ BORDERS - Subtle Gray & Accents ═══ */
    /* Define structure without being heavy */
    --border-primary: #2A2A2A;      /* Subtle gray - default borders */
    --border-secondary: #333333;    /* Medium gray - emphasized borders */
    --border-accent-green: #C9FF00; /* Neon green for active states */
    --border-accent-purple: #B565FF; /* Purple for special states */

    /* ═══ SHADOWS - Depth & Glows ═══ */
    /* Darker shadows for black backgrounds + special glows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.8);
    --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.9);

    /* Special glows for premium feel */
    --glow-green: 0 0 20px rgba(201, 255, 0, 0.3);
    --glow-green-hover: 0 0 30px rgba(201, 255, 0, 0.4);
    --glow-purple: 0 0 20px rgba(181, 101, 255, 0.3);
    --glow-purple-hover: 0 0 30px rgba(181, 101, 255, 0.4);

    /* Button-specific shadows with glow */
    --shadow-green-sm: 0 4px 12px rgba(201, 255, 0, 0.25);
    --shadow-green-lg: 0 8px 24px rgba(201, 255, 0, 0.35);
    --shadow-purple-sm: 0 4px 12px rgba(181, 101, 255, 0.25);
    --shadow-purple-lg: 0 8px 24px rgba(181, 101, 255, 0.35);

    /* ═══ TYPOGRAPHY SCALE ═══ */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */

    /* ═══ FONT WEIGHTS ═══ */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* ═══ SPACING SCALE ═══ */
    --space-xs: 0.5rem;      /* 8px */
    --space-sm: 0.75rem;     /* 12px */
    --space-md: 1rem;        /* 16px */
    --space-lg: 1.5rem;      /* 24px */
    --space-xl: 2rem;        /* 32px */
    --space-2xl: 3rem;       /* 48px */
    --space-3xl: 4rem;       /* 64px */

    /* ═══ BORDER RADIUS ═══ */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 24px;     /* Pill-shaped buttons - Robinhood style */
    --radius-full: 9999px;

    /* ═══ TRANSITIONS ═══ */
    --transition-fast: 300ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================================================
   BASE STYLES
   ========================================================================= */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden; /* Prevent body scroll, let main-content handle it */
}

/* ============================================================================
   UTILITY CLASSES
   ========================================================================= */

.hidden {
    display: none !important;
}

/* ============================================================================
   APP CONTAINER & LAYOUT
   ========================================================================= */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-primary);
    overflow: hidden;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

#app-main {
    flex: 1;
    padding: var(--space-xl);
}

.optimizer-container {
    /* Container for the existing optimizer tool */
}

/* ============================================================================
   SIDEBAR
   ========================================================================= */

.sidebar {
    width: 260px;
    background: #000000; /* Pure black for sidebar - darker than main bg */
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    padding: var(--space-xl) var(--space-md);
    flex-shrink: 0;
}

.sidebar-header {
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-xl);
}

.sidebar-header .logo {
    color: var(--text-primary);
    font-weight: var(--font-bold);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.sidebar-header .logo-tagline {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    margin: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-purple-glow);
    color: var(--accent-purple-light);
    font-weight: var(--font-semibold);
    box-shadow: var(--shadow-purple-sm);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-primary);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    text-align: center;
}

/* ============================================================================
   HERO SECTION
   ========================================================================= */

.hero-section {
    padding: var(--space-3xl) var(--space-2xl);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 20% 50%, rgba(181, 101, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(201, 255, 0, 0.05) 0%, transparent 50%),
        linear-gradient(145deg, var(--bg-secondary) 0%, #0D0D0D 50%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-primary);
    margin-bottom: var(--space-xl);
    animation: fadeIn 0.6s ease-in-out;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(181, 101, 255, 0.02) 2px,
            rgba(181, 101, 255, 0.02) 4px
        );
    pointer-events: none;
    opacity: 0.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: var(--space-3xl);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    /* Robinhood uses a serif font for headlines - gives it gravitas */
    font-family: 'Newsreader', 'Georgia', 'Times New Roman', serif;
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    font-weight: 400; /* Serif fonts look better at normal weight */
    letter-spacing: -0.03em;
}

.hero-text p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 50ch;
    margin-bottom: var(--space-2xl);
    line-height: 1.7;
}

.btn-hero-primary {
    background: var(--accent-green);
    color: var(--text-on-green);
    border: none;
    border-radius: var(--radius-pill);
    padding: 1.2rem 2.8rem;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-green-sm);
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-hero-primary:hover {
    background: var(--accent-green-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-green-lg);
}

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

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image svg {
    max-width: 100%;
    height: auto;
    opacity: 0.85;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

/* ============================================================================
   HOW IT WORKS SECTION
   ========================================================================= */

.how-it-works {
    margin-top: var(--space-3xl);
    text-align: center;
}

.how-it-works h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    letter-spacing: -0.02em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.step {
    background: rgba(181, 101, 255, 0.05);
    border: 1px solid var(--border-accent-purple);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 300ms ease;
}

.step:hover {
    background: rgba(181, 101, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: var(--glow-purple);
}

.step-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    background: var(--accent-purple);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-purple-sm);
}

.step-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.step h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.step p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================================
   KEY OPTIMIZATIONS SECTION
   ========================================================================= */

.key-optimizations {
    margin-top: var(--space-2xl);
    text-align: center;
}

.key-optimizations h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    letter-spacing: -0.02em;
}

.optimizations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.optimization-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    text-align: left;
    transition: all 300ms ease;
}

.optimization-item:hover {
    border-color: var(--accent-green);
    box-shadow: var(--glow-green);
}

.optimization-icon {
    width: 40px;
    height: 40px;
    background: rgba(201, 255, 0, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.optimization-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-green);
}

.optimization-item strong {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.optimization-item span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================================================
   TRUST BADGE
   ========================================================================= */

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(0, 200, 5, 0.15);
    border: 1px solid var(--success);
    border-radius: var(--radius-pill);
    padding: 0.7rem 1.5rem;
    margin-top: var(--space-lg);
    transition: all 300ms ease;
}

.trust-badge:hover {
    background: rgba(0, 200, 5, 0.25);
    box-shadow: 0 0 20px rgba(0, 200, 5, 0.3);
}

.trust-badge svg {
    width: 20px;
    height: 20px;
    color: var(--success);
}

.trust-badge span {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--success);
    letter-spacing: 0.02em;
}

/* ============================================================================
   HEADER
   ========================================================================= */

header {
    background: var(--bg-secondary);
    padding: var(--space-xl) var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    flex-shrink: 0; /* Prevent header from shrinking */
}

header h1 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

header h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.header-tagline {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.photo-count-indicator {
    display: none; /* Hidden by default, shown when images are uploaded */
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

#photoCount {
    font-weight: var(--font-bold);
    font-size: var(--text-2xl);
    color: var(--accent-purple);  /* PURPLE counter - user requirement */
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

.status-badge.optimal {
    background: var(--accent-purple-glow);  /* PURPLE badge - user requirement */
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

/* ============================================================================
   MAIN CONTENT
   ========================================================================= */

main {
    /* Main is now #app-main inside .main-content wrapper */
    /* Padding is handled by #app-main */
}

/* ============================================================================
   SECTIONS
   ========================================================================= */

section {
    margin-bottom: var(--space-3xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

section h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ============================================================================
   EMPTY STATE
   ========================================================================= */

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: var(--bg-secondary);
    border: 2px dashed var(--border-accent-purple);  /* PURPLE dashed border - user requirement */
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.empty-state:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--glow-purple);
}

.empty-state p {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-hint {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================================
   IMAGE CARDS (UPLOAD VIEW)
   ========================================================================= */

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.image-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-purple);  /* PURPLE border on hover - user requirement */
    box-shadow: var(--glow-purple);      /* PURPLE glow - user requirement */
}

.image-role-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--accent-purple);    /* PURPLE badge - user requirement */
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    z-index: 10;
    box-shadow: var(--shadow-purple-sm);
}

/* Special styling for thumbnail (first image) - emphasized with gradient */
.image-card:first-child .image-role-badge {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
    box-shadow: var(--shadow-purple-lg);
}

.image-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.image-info {
    padding: var(--space-md);
    background: var(--bg-secondary);
}

.image-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-size {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.btn-remove {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 32px;
    height: 32px;
    background: var(--danger);
    border: 2px solid var(--bg-secondary);
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.image-card:hover .btn-remove {
    opacity: 1;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ============================================================================
   OPTIMIZATION PREVIEW
   ========================================================================= */

.optimization-preview {
    margin-top: var(--space-2xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent-green);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 300ms ease;
}

.optimization-preview h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    text-align: center;
    letter-spacing: -0.02em;
}

.preview-checklist {
    display: grid;
    gap: var(--space-md);
}

.preview-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    transition: all 300ms ease;
}

.preview-item:hover {
    border-color: var(--accent-green);
    transform: translateX(4px);
}

.preview-item svg {
    width: 24px;
    height: 24px;
    color: var(--accent-green);
    flex-shrink: 0;
    margin-top: 2px;
}

.preview-item span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================================
   UPLOAD ACTIONS
   ========================================================================= */

.upload-actions {
    margin-top: var(--space-2xl);
    text-align: center;
}

.btn-optimize {
    padding: 1.2rem 3.5rem;
    background: var(--accent-green);     /* NEON GREEN - user requirement */
    color: var(--text-on-green);         /* Black text on green */
    border: none;
    border-radius: var(--radius-pill);   /* Pill-shaped - Robinhood style */
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-green-sm);
    letter-spacing: -0.01em;
}

.btn-optimize:hover {
    background: var(--accent-green-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-green-lg);
}

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

/* ============================================================================
   OPTIMIZED IMAGES SECTION
   ========================================================================= */

.thumbnail-nav {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    scroll-behavior: smooth;
}

.thumbnail-nav::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 300ms ease;
}

.thumbnail-item:hover {
    border-color: var(--accent-purple);
    transform: scale(1.05);
    box-shadow: var(--glow-purple);
}

.thumbnail-item.active {
    border-color: var(--accent-green);
    box-shadow: var(--glow-green);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.3rem 0.5rem;
    text-align: center;
}

.btn-download-all {
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all 300ms ease;
    border: none;
    background: var(--accent-green);
    color: var(--text-on-green);
    box-shadow: var(--shadow-green-lg);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-download-all svg {
    width: 20px;
    height: 20px;
}

.btn-download-all:hover {
    background: var(--accent-green-hover);
    transform: translateY(-3px);
    box-shadow: var(--glow-green-hover);
}

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

.optimized-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.optimized-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.optimized-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-secondary);
}

.optimized-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

.optimized-header h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.ready-badge {
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    background: var(--accent-purple-glow);  /* PURPLE badge - user requirement */
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-purple-sm);
}

/* ============================================================================
   BEFORE/AFTER COMPARISON
   ========================================================================= */

.before-after {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-xl);
    align-items: center;
    margin-bottom: var(--space-xl);
}

.before-after-item {
    text-align: center;
}

.before-after-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: var(--font-bold);
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.before-after-item img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    padding: var(--space-sm);
}

.before-after-arrow {
    font-size: 2.5rem;
    color: var(--accent-purple);  /* PURPLE arrow - user requirement */
    font-weight: var(--font-bold);
}

/* ============================================================================
   OPTIMIZATION SUMMARY
   ========================================================================= */

.optimization-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-primary);
}

.summary-step {
    padding: 0.6rem 0;
    font-size: var(--text-base);
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    line-height: 1.6;
    position: relative;
    cursor: help;
    transition: all 300ms ease;
}

.summary-step:hover {
    color: var(--accent-green);
}

.summary-step::before {
    content: '✓';
    color: var(--success);
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.summary-step[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    box-shadow: var(--glow-green);
    animation: tooltipFadeIn 300ms ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   BUTTONS
   ========================================================================= */

.optimized-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.btn-download {
    padding: 0.9rem 2rem;
    border-radius: var(--radius-pill);   /* Pill-shaped - Robinhood style */
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    background: var(--accent-green);     /* NEON GREEN - user requirement */
    color: var(--text-on-green);         /* Black text on green */
    box-shadow: var(--shadow-green-sm);
}

.btn-download:hover {
    background: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-green-lg);
}

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

.btn-primary, .btn-secondary {
    padding: 0.9rem 1.8rem;
    border-radius: var(--radius-pill);   /* Pill-shaped - Robinhood style */
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--accent-green);     /* NEON GREEN - user requirement */
    color: var(--text-on-green);         /* Black text on green */
    border: none;
    box-shadow: var(--shadow-green-sm);
}

.btn-primary:hover {
    background: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-green-lg);
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-purple);  /* PURPLE border on hover - user requirement */
}

/* ============================================================================
   MODAL
   ========================================================================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.90);     /* Deeper black overlay */
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.modal-close {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    background: var(--accent-green);     /* NEON GREEN - user requirement */
    border: none;
    color: var(--text-on-green);         /* Black text on green */
    font-size: var(--text-2xl);
    cursor: pointer;
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-pill);   /* Pill-shaped - Robinhood style */
    transition: all var(--transition-base);
    z-index: 1001;
    box-shadow: var(--shadow-green-lg);
    font-weight: var(--font-bold);
}

.modal-close:hover {
    background: var(--accent-green-hover);
    transform: scale(1.05);
    box-shadow: var(--glow-green-hover);
}

.modal-nav {
    position: fixed;
    bottom: 6rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-accent-purple);  /* PURPLE border - user requirement */
    color: var(--text-primary);
    font-size: var(--text-xl);
    padding: 1.1rem 1.6rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border-radius: var(--radius-md);
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    font-weight: var(--font-bold);
}

.modal-nav:hover {
    background: var(--accent-purple-glow);  /* PURPLE hover - user requirement */
    border-color: var(--accent-purple);
    box-shadow: var(--glow-purple-hover);
}

.modal-nav-prev {
    left: 50%;
    margin-left: -120px;
}

.modal-nav-next {
    left: 50%;
    margin-left: 20px;
}

.modal-image-container {
    max-width: 100%;
    display: flex;
    justify-content: center;
}

#modalImage {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-secondary);
}

.modal-summary {
    width: 100%;
    max-width: 800px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.modal-summary h3 {
    margin-bottom: var(--space-lg);
    color: var(--accent-purple);  /* PURPLE heading - user requirement */
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.modal-summary .summary-step {
    padding: 0.5rem 0;
    font-size: var(--text-base);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

/* ============================================================================
   LOADING INDICATOR
   ========================================================================= */

.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    padding: var(--space-2xl) var(--space-3xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    z-index: 3000;
    text-align: center;
    min-width: 280px;
    box-shadow: var(--shadow-xl);
}

.loading-indicator.active {
    display: block;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-primary);
    border-top-color: var(--accent-purple);  /* PURPLE spinner - user requirement */
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-lg);
}

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

#loadingText {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

/* ============================================================================
   FOOTER
   ========================================================================= */

.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-xl) var(--space-2xl);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-content p {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all 300ms ease;
}

.footer-links a:hover {
    color: var(--accent-green);
}

.footer-links svg {
    width: 18px;
    height: 18px;
}

/* ============================================================================
   SCROLLBAR STYLING
   ========================================================================= */

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);  /* PURPLE scrollbar on hover - user requirement */
}

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

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        max-width: 400px;
        margin: 0 auto;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .optimizations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .before-after {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .before-after-arrow {
        transform: rotate(90deg);
    }

    .sidebar {
        width: 220px;
        padding: var(--space-lg) var(--space-sm);
    }

    .nav-item {
        padding: var(--space-sm);
        font-size: var(--text-xs);
    }

    .nav-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-md) var(--space-lg);
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
    }

    .sidebar-header {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .sidebar-header .logo {
        font-size: var(--text-xl);
    }

    .sidebar-header .logo-tagline {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: var(--space-sm);
    }

    .nav-item span {
        display: none; /* Hide text, show only icons on mobile */
    }

    .nav-item {
        padding: var(--space-sm);
    }

    .sidebar-footer {
        display: none;
    }

    #app-main {
        padding: var(--space-lg);
    }

    .hero-section {
        padding: var(--space-2xl) var(--space-lg);
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text p {
        font-size: var(--text-base);
    }

    .btn-hero-primary {
        padding: 1rem 2rem;
        font-size: var(--text-base);
    }

    .how-it-works h3,
    .key-optimizations h3 {
        font-size: var(--text-xl);
    }

    .step h4 {
        font-size: var(--text-base);
    }

    .optimization-item {
        padding: var(--space-md);
    }

    .btn-download-all {
        padding: 0.8rem 1.5rem;
        font-size: var(--text-base);
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-lg);
    }

    header h1, header h2 {
        font-size: var(--text-2xl);
    }

    .header-controls {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-md);
    }

    .optimized-card {
        padding: var(--space-lg);
    }

    .optimized-actions {
        flex-direction: column;
    }

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

    .modal-close {
        top: var(--space-md);
        right: var(--space-md);
        padding: 0.7rem 1.1rem;
        font-size: var(--text-xl);
    }

    .modal-nav {
        padding: 0.8rem 1.2rem;
        font-size: var(--text-lg);
    }

    #modalImage {
        max-height: 50vh;
    }

    .btn-optimize {
        padding: 1rem 2.5rem;
        font-size: var(--text-lg);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .thumbnail-nav {
        padding: var(--space-sm);
    }

    .thumbnail-item {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .sidebar-header .logo {
        font-size: var(--text-lg);
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }

    .hero-section {
        padding: var(--space-xl) var(--space-md);
    }

    header h1, header h2 {
        font-size: var(--text-xl);
    }

    #photoCount {
        font-size: var(--text-xl);
    }

    .empty-state p {
        font-size: var(--text-lg);
    }

    .images-grid {
        grid-template-columns: 1fr;
    }
}

/*
╔═══════════════════════════════════════════════════════════════════════════╗
║  END OF DESIGN SYSTEM                                                     ║
║  Etsy Image Optimizer - Premium Dashboard, Robinhood-Inspired            ║
║                                                                            ║
║  KEY FEATURES:                                                            ║
║  • Dashboard layout with sidebar navigation                              ║
║  • Engaging hero section with serif headline and abstract illustration   ║
║  • Pure black backgrounds (#0A0A0A) for luxury feel                      ║
║  • Neon green CTAs (#C9FF00) for all primary actions                     ║
║  • Purple accents (#B565FF) throughout badges, borders, and hover states ║
║  • High contrast white text for excellent readability                    ║
║  • Pill-shaped buttons inspired by Robinhood                             ║
║  • Subtle glows and shadows for depth and polish                         ║
║  • Smooth animations and transitions for premium feel                    ║
║  • Fully responsive - sidebar collapses to horizontal nav on mobile      ║
║  • Dynamic content switching between hero and optimizer                  ║
╚═══════════════════════════════════════════════════════════════════════════╝
*/
