/* 
Tool Page CSS - CompressYogi
Changes:
- 2026-01-08: UX Fix - Delete button moved to top-right corner
  - Always visible, prevents accidental deletion on mobile scroll
  - Hover: red background, scale up, shadow
- 2025-12-26: Mobile-first Settings Section:
  - Floating bottom action bar (.mobile-action-bar)
  - Bottom sheet for settings (.mobile-settings-sheet)
  - Animations and safe area support
- 2025-12-25: Added trust badges below upload area
- 2025-12-25: Added PDFYogi-style primary button (.btn-pdfyogi)
- 2025-12-25: Added subtle grid patterns to settings/results workflow steps
- 2025-12-25: Added hero-title and hero-subtitle classes matching home page
- 2025-12-25: Updated icon-circle to rounded square style
- 2025-12-25: Added grid background + gradient glow to upload section (matching home page)
- 2025-11-23: Extracted all inline CSS from tool_page.html template
- Implements MailYogi multi-theme system (HSL-based design tokens)
- PDFyogi-inspired full-screen workflow sections
- Uses HSL format for flexible color manipulation
- Integrates with Tailwind's design token system
*/

/* CSS Variables for consistent spacing */
:root {
    --navbar-height: 64px;
}

/* Workflow sections - Default full viewport height */
.workflow-step {
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    transition: all 0.4s ease-out;
}

/* Ensure hidden class overrides display: flex */
.workflow-step.hidden {
    display: none !important;
}

/* ========== Upload Section - Hero Style Background ========== */
#step-upload.workflow-step {
    position: relative;
    min-height: calc(100vh - var(--navbar-height)) !important;
    min-height: calc(100dvh - var(--navbar-height)) !important; /* Use dvh for mobile */
    background: hsl(var(--background));
    overflow: hidden;
    padding-top: 3rem;
    padding-bottom: 2rem;
}

/* Grid background pattern */
#step-upload.workflow-step::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: 
        linear-gradient(hsl(var(--foreground) / 0.04) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--foreground) / 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Gradient glow overlay from top */
#step-upload.workflow-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 70%;
    z-index: 2;
    background: radial-gradient(
        ellipse 60% 80% at 50% 0%,
        hsl(var(--primary) / 0.15) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Ensure upload content is above background */
#step-upload.workflow-step > div {
    position: relative;
}

/* ========== Download Section - Theme-aware Background (same as home hero) ========== */
#step-download.workflow-step {
    position: relative;
    min-height: calc(100vh - var(--navbar-height)) !important;
    min-height: calc(100dvh - var(--navbar-height)) !important; /* Use dvh for mobile */
    background: hsl(var(--background));
    overflow: hidden;
    padding-top: 3rem;
    padding-bottom: 2rem;
}

/* Grid background pattern - same as upload/home hero */
#step-download.workflow-step::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: 
        linear-gradient(hsl(var(--foreground) / 0.04) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--foreground) / 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Theme-aware gradient glow - uses --primary (adapts to theme) */
#step-download.workflow-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 70%;
    z-index: 2;
    background: radial-gradient(
        ellipse 60% 80% at 50% 0%,
        hsl(var(--primary) / 0.15) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Ensure download content is above background */
#step-download.workflow-step > div {
    position: relative;
    z-index: 10;
}

/* ========== Upload Area - Theme-aware dotted border ========== */
.upload-area-fullscreen {
    position: relative;
    padding: 2.5rem 2rem;
    border: 2px dashed hsl(var(--border));
    border-radius: 16px;
    background: hsl(var(--card) / 0.5);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.upload-area-fullscreen:hover {
    border-color: hsl(var(--primary) / 0.5);
    background: hsl(var(--card) / 0.7);
}

/* Drag-over state */
#step-upload.drag-over .upload-area-fullscreen,
.upload-area-fullscreen.drag-over {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.05);
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.1);
}

/* Theme-aware text colors for upload area */
.upload-area-fullscreen .text-gray-500 {
    color: hsl(var(--muted-foreground)) !important;
}

.upload-area-fullscreen .text-gray-400 {
    color: hsl(var(--muted-foreground) / 0.7) !important;
}

.upload-area-fullscreen .text-gray-700 {
    color: hsl(var(--foreground)) !important;
}

/* z-index already set above */
#step-upload.workflow-step > div {
    z-index: 10;
}

/* Hero Title - Matching home page */
#step-upload .hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
}

#step-upload .hero-title-highlight {
    display: inline;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    #step-upload .hero-title {
        font-size: 3.5rem;
        margin-bottom: 1.25rem;
    }
}

@media (min-width: 1024px) {
    #step-upload .hero-title {
        font-size: 4rem;
    }
}

#step-upload .hero-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: hsl(var(--muted-foreground));
    max-width: 540px;
    margin: 0 auto 2rem;
}

@media (min-width: 768px) {
    #step-upload .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Image Card Styles */
.image-card-wrapper {
    position: relative;
}

.image-card {
    border: 2px solid hsl(var(--border));
    transition: all 0.3s ease;
}

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

/* ========== Card Custom Settings States ========== */

/* Per-file custom settings - subtle theme primary color */
.image-card.custom-per-file {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.08);
}

.image-card.custom-per-file:hover {
    border-color: hsl(var(--primary) / 0.6);
    box-shadow: 0 4px 12px hsl(var(--primary) / 0.15);
}

/* Per-file custom - subtle primary tint on footer */
.image-card.custom-per-file > .p-3 {
    background-color: hsl(var(--primary) / 0.04);
}

/* Global custom settings (Apply to All) - subtle success green */
.image-card.custom-global {
    border-color: hsl(var(--success) / 0.5);
    box-shadow: 0 0 0 2px hsl(var(--success) / 0.08);
}

.image-card.custom-global:hover {
    border-color: hsl(var(--success) / 0.7);
    box-shadow: 0 4px 12px hsl(var(--success) / 0.15);
}

/* Global custom - subtle green tint on footer */
.image-card.custom-global > .p-3 {
    background-color: hsl(var(--success) / 0.04);
}

.card-actions {
    opacity: 0;
    transition: opacity 200ms ease;
}

.image-card:hover .card-actions {
    opacity: 1;
}

/* Delete Button (Top-Right Corner) - Always visible, matches serial badge style */
.image-card-wrapper .delete-btn {
    transition: all 0.2s ease;
}

.image-card-wrapper .delete-btn:hover {
    background: hsl(var(--destructive)) !important;
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px hsl(var(--destructive) / 0.4);
}

/* Status Badge Colors */
.status-badge.ready {
    background-color: hsl(var(--info) / 0.9);
}

.status-badge.compressing {
    background-color: hsl(var(--warning) / 0.9);
}

.status-badge.compressed {
    background-color: hsl(var(--success) / 0.9);
}

.status-badge.error {
    background-color: hsl(var(--destructive) / 0.9);
}

/* Grid responsive adjustments - 2 flexible columns on mobile, fixed width on desktop */
#image-cards-grid {
    display: grid;
    gap: 1rem; /* More breathing room between cards */
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 equal flexible columns */
}

/* Limit individual card width on mobile */
#image-cards-grid .image-card-wrapper {
    max-width: 200px;
}

@media (min-width: 768px) {
    #image-cards-grid {
        gap: 1.25rem; /* Desktop: even more space */
        grid-template-columns: repeat(auto-fill, 150px); /* Desktop: fixed 150px cards */
    }
    
    #image-cards-grid .image-card-wrapper {
        max-width: 150px;
    }
}

/* Empty state */
#empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Workflow container - simple container, no scroll snap */
.workflow-container {
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
    max-width: 100vw;
}

/* MailYogi-inspired theme backgrounds with smooth gradients */
/* Legacy #step-upload styles removed - now using .workflow-step styles above */

/* Full-screen dropzone indicator - entire section is the dropzone */
#step-upload.drag-over::before {
    content: 'Drop files anywhere to upload';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: hsl(var(--primary));
    opacity: 0.5;
    pointer-events: none;
    z-index: 10;
}

#step-settings {
    background: linear-gradient(135deg, hsl(var(--muted)) 0%, hsl(var(--accent)) 50%, hsl(var(--secondary)) 100%);
    padding: 0 !important;
}

/* Settings section container - full height */
#step-settings > div {
    height: calc(100vh - var(--navbar-height));
}

/* Files list column - flexible width, takes remaining space */
#step-settings .md\:flex-1 > div {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Settings panel column - fixed width from Tailwind */
#step-settings .md\:w-\[350px\] > div,
#step-settings .lg\:w-\[412px\] > div {
    height: 100%;
    overflow-y: auto;
}

#step-download {
    background: linear-gradient(135deg, hsl(var(--muted)) 0%, hsl(var(--accent)) 50%, hsl(var(--secondary)) 100%);
}

/* Smooth fade-in animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Icon circle with theme colors and smooth hover effects */
.icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: hsl(var(--primary) / 0.12);
    border: 1px solid hsl(var(--primary) / 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    transition: all 0.3s ease;
}

.icon-circle svg {
    width: 32px;
    height: 32px;
    stroke: hsl(var(--primary));
    transition: all 0.3s ease;
}

.icon-circle:hover {
    transform: translateY(-2px);
    background: hsl(var(--primary) / 0.18);
    border-color: hsl(var(--primary) / 0.3);
}

.icon-circle:hover svg {
    transform: scale(1.1);
}

/* PDFyogi-style gradient buttons using MailYogi design tokens */
.btn-pdfyogi {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: calc(var(--radius) * 1.5);
    border: none;
    box-shadow: 0 4px 16px hsl(var(--primary) / 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-pdfyogi:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px hsl(var(--primary) / 0.35);
    background: hsl(var(--primary) / 0.9);
}

.btn-pdfyogi:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px hsl(var(--primary) / 0.25);
}

.btn-pdfyogi:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Success button (green gradient, fixed - doesn't change with theme) */
.btn-pdfyogi-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 1.125rem;
}

.btn-pdfyogi-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.btn-pdfyogi-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Files summary section styling */
.files-summary {
    background: hsl(var(--card));
    border-radius: calc(var(--radius) * 2);
    padding: 1.5rem;
    box-shadow: 0 2px 12px hsl(var(--foreground) / 0.08);
    margin-bottom: 2rem;
    border: 1px solid hsl(var(--border));
}

/* Feature cards styling */
.feature-card {
    background: hsl(var(--card));
    border-radius: calc(var(--radius) * 2);
    padding: 1.5rem;
    box-shadow: 0 2px 8px hsl(var(--foreground) / 0.05);
    transition: all 0.3s ease;
    border: 1px solid hsl(var(--border));
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px hsl(var(--foreground) / 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, hsl(var(--muted)) 0%, hsl(var(--accent)) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: hsl(var(--primary));
}

/* Upload constraints text */
.upload-constraints {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* Theme-aware utility classes */
.text-theme-primary {
    color: hsl(var(--primary));
}

.border-theme {
    border-color: hsl(var(--border));
}

.bg-theme-light {
    background-color: hsl(var(--muted));
}

.text-theme-foreground {
    color: hsl(var(--foreground));
}

.text-theme-muted {
    color: hsl(var(--muted-foreground));
}

/* ========== Apply to All - Card Pulse Animation ========== */
/* Brief green glow to confirm "Apply to All" affected these cards */
@keyframes cardPulse {
    0% {
        box-shadow: 0 0 0 0 hsl(var(--success) / 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px 4px hsl(var(--success) / 0.4);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 hsl(var(--success) / 0);
        transform: scale(1);
    }
}

.image-card.pulse-success {
    animation: cardPulse 0.6s ease-out;
}

/* ========== Compression Progress Animation ========== */
/* Visible pulse animation for the file size card while compressing */
@keyframes compressionPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 hsl(var(--primary) / 0.4);
        border-color: hsl(var(--primary) / 0.3);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 20px 4px hsl(var(--primary) / 0.3);
        border-color: hsl(var(--primary) / 0.6);
    }
}

.compressing-pulse {
    animation: compressionPulse 1.5s ease-in-out infinite;
    border: 2px solid hsl(var(--primary) / 0.3) !important;
}

/* Shimmer effect on the status text */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.compressing-pulse #compression-status {
    background: linear-gradient(
        90deg,
        hsl(var(--muted-foreground)) 0%,
        hsl(var(--primary)) 50%,
        hsl(var(--muted-foreground)) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
}

/* Toast slide animations */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

/* ========== Theme-Aware Toggle Switch ========== */
/* Custom toggle that respects theme colors */
/* 2026-01-08: Added flex-shrink: 0 to prevent toggle from shrinking in flex containers */
.theme-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    min-width: 36px; /* Prevent shrinking */
    flex-shrink: 0;  /* Prevent flex shrink */
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    background: hsl(var(--muted-foreground));
    transition: all 0.3s ease;
}

.theme-toggle:checked {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

.theme-toggle:checked::before {
    transform: translateX(16px);
    background: hsl(var(--primary-foreground));
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.3);
}

/* ========== Theme-Aware Range Slider ========== */
.theme-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: hsl(var(--muted));
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.theme-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px hsl(var(--foreground) / 0.2);
}

.theme-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px hsl(var(--primary) / 0.4);
}

.theme-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px hsl(var(--foreground) / 0.2);
}

.theme-range::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px hsl(var(--primary) / 0.4);
}

.theme-range::-moz-range-track {
    background: hsl(var(--muted));
    border-radius: 3px;
    height: 6px;
}

.theme-range:focus {
    outline: none;
}

.theme-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.3);
}

/* ========== Trust Badges ========== */
.upload-trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    padding: 0.375rem 0.75rem;
    background: hsl(var(--card) / 0.6);
    border: 1px solid hsl(var(--border) / 0.5);
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.trust-badge-item:hover {
    border-color: hsl(var(--primary) / 0.3);
    color: hsl(var(--foreground));
}

.trust-badge-item svg {
    width: 14px;
    height: 14px;
    stroke: hsl(var(--primary));
}

@media (min-width: 768px) {
    .upload-trust-badges {
        gap: 1.25rem;
    }
    
    .trust-badge-item {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
    
    .trust-badge-item svg {
        width: 16px;
        height: 16px;
    }
}

/* ========== PDFYogi-Style Primary Button ========== */
.btn-pdfyogi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--primary-foreground));
    background: hsl(var(--primary));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px hsl(var(--primary) / 0.25);
}

.btn-pdfyogi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsl(var(--primary) / 0.35);
}

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

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

@media (min-width: 768px) {
    .btn-pdfyogi {
        padding: 1rem 2.5rem;
        font-size: 1.0625rem;
    }
}

/* ========== Workflow Step Backgrounds ========== */
/* Settings Step (Step 2) - Subtle pattern + soft gradient */
#step-settings.workflow-step {
    position: relative;
    background: hsl(var(--background));
    /* Override centering - need full width stretch */
    justify-content: stretch;
    align-items: stretch;
    padding: 0;
}

/* Inner container needs full width */
#step-settings.workflow-step > div {
    width: 100%;
    position: relative;
}

/* Settings Panel Cards - With gradient glow + grid pattern */
.settings-panel-card {
    position: relative;
    z-index: 1;
    background: 
        linear-gradient(
            180deg,
            hsl(var(--primary) / 0.08) 0%,
            hsl(var(--primary) / 0.03) 40%,
            transparent 70%
        ),
        linear-gradient(hsl(var(--foreground) / 0.02) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--foreground) / 0.02) 1px, transparent 1px),
        hsl(var(--card));
    background-size: 100% 100%, 32px 32px, 32px 32px, 100% 100%;
    box-shadow: 0 4px 12px hsl(var(--foreground) / 0.05);
}

/* Right Panel - Settings sidebar */
.settings-sidebar {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 4px 12px hsl(var(--foreground) / 0.05);
}

/* Theme-aware Image Cards */
.image-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 2px 8px hsl(var(--foreground) / 0.04);
    transition: all 0.2s ease;
}

.image-card:hover {
    border-color: hsl(var(--primary) / 0.3);
    box-shadow: 0 8px 24px hsl(var(--foreground) / 0.08);
}

/* Custom settings state - primary border */
.image-card.custom-per-file {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 1px hsl(var(--primary) / 0.2), 0 4px 12px hsl(var(--primary) / 0.1);
}

/* Global custom state - success border */
.image-card.custom-global {
    border-color: hsl(var(--success));
    box-shadow: 0 0 0 1px hsl(var(--success) / 0.2), 0 4px 12px hsl(var(--success) / 0.1);
}

/* Pulse animation for Apply to All */
@keyframes pulse-success {
    0%, 100% { box-shadow: 0 0 0 0 hsl(var(--success) / 0.4); }
    50% { box-shadow: 0 0 0 8px hsl(var(--success) / 0); }
}

.image-card.pulse-success {
    animation: pulse-success 0.6s ease-out;
}

/* ========== Theme-aware Shadows for Below-Fold Content ========== */
/* Feature Cards */
.below-fold .rounded-lg {
    box-shadow: 0 2px 8px hsl(var(--foreground) / 0.04);
    transition: box-shadow 0.2s ease;
}

.below-fold .rounded-lg:hover {
    box-shadow: 0 4px 16px hsl(var(--foreground) / 0.08);
}

/* FAQ Collapse Items */
.below-fold .collapse {
    box-shadow: 0 2px 8px hsl(var(--foreground) / 0.04);
    border: 1px solid hsl(var(--border));
}

.below-fold .collapse:hover {
    box-shadow: 0 4px 12px hsl(var(--foreground) / 0.06);
}

#step-settings.workflow-step::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(hsl(var(--foreground) / 0.02) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--foreground) / 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Soft primary gradient glow from top */
#step-settings.workflow-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 60%;
    background: radial-gradient(
        ellipse 50% 80% at 50% 0%,
        hsl(var(--primary) / 0.08) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

/* Content wrapper styles merged into earlier rule */

/* Results Step (Step 3) - Success accent */
#step-results.workflow-step {
    position: relative;
    background: hsl(var(--background));
}

#step-results.workflow-step::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(hsl(var(--foreground) / 0.015) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--foreground) / 0.015) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

#step-results.workflow-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 40%;
    background: radial-gradient(
        ellipse 60% 100% at 50% 0%,
        hsl(142 76% 36% / 0.06) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

#step-results.workflow-step > div {
    position: relative;
    z-index: 1;
}

/* ========== MOBILE: Floating Action Bar ========== */
.mobile-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    /* display controlled by JavaScript - don't use !important */
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: hsl(var(--card) / 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid hsl(var(--border) / 0.5);
    box-shadow: 0 -4px 20px hsl(var(--foreground) / 0.08);
}

/* Settings Icon Button (icon only) */
.mobile-settings-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-settings-icon-btn:active {
    transform: scale(0.95);
    background: hsl(var(--muted) / 0.8);
}

.mobile-settings-icon-btn svg {
    color: hsl(var(--foreground));
}

/* ========== MOBILE: Settings Bottom Sheet ========== */
.mobile-settings-sheet {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.mobile-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: hsl(var(--foreground) / 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-sheet-content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    background: hsl(var(--card));
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -10px 40px hsl(var(--foreground) / 0.15);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.mobile-sheet-handle {
    width: 40px;
    height: 4px;
    background: hsl(var(--border));
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

.mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.mobile-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-sheet-close:active {
    transform: scale(0.95);
}

.mobile-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem;
}

.mobile-sheet-footer {
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background: hsl(var(--muted) / 0.3);
    border-top: 1px solid hsl(var(--border) / 0.3);
}

.mobile-sheet-done-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.625rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.mobile-sheet-done-btn:active {
    transform: scale(0.98);
}

/* Hide mobile elements on desktop */
@media (min-width: 768px) {
    .mobile-action-bar,
    .mobile-settings-sheet {
        display: none !important;
    }
}

/* ========== Section with Gradient Glow (Alternating Sections) ========== */
/* Used for below-fold sections that need visual distinction without the hero grid pattern */
.section-with-glow {
    position: relative;
    background: hsl(var(--background));
    overflow: hidden;
}

/* Subtle radial gradient glow - similar to hero but softer */
.section-with-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 100%;
    z-index: 1;
    background: radial-gradient(
        ellipse 70% 50% at 50% 0%,
        hsl(var(--primary) / 0.06) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Bottom glow for visual balance */
.section-with-glow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 50%;
    z-index: 1;
    background: radial-gradient(
        ellipse 70% 60% at 50% 100%,
        hsl(var(--primary) / 0.04) 0%,
        transparent 70%
    );
    pointer-events: none;
}

