/* =================================================================
   CSS Variables and Utilities are loaded globally in app.html
   ================================================================= */

/* =================================================================
   CSS Reset and Base Styles
   ================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =================================================================
   Base Body Styles
   ================================================================= */
body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;

    /* Typography handled by typography.css */
}

/* =================================================================
   Typography Overrides for Components
   ================================================================= */

/* Headings - margin only, typography handled by typography.css */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

/* Links - color only, typography handled by typography.css */
a {
    color: var(--accent-primary);
}

a:hover {
    color: var(--accent-secondary);
}

/* Paragraphs - color and spacing */
p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Small text */
small {
    color: var(--text-muted);
}

/* =================================================================
   Layout Container
   ================================================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* =================================================================
   Button Styles
   ================================================================= 
   
   NOTE: All button styling is now handled by the Button.svelte component.
   Page-specific button styles have been removed as they're now
   implemented within the component.
   ================================================================= */

/* =================================================================
   Header and Main Layout
   ================================================================= */
header {
    text-align: center;
    padding: 3rem 0 2rem;
}

main {
    text-align: center;
    padding: 2rem 0;
}

/* =================================================================
   Landing Page Specific Styles
   ================================================================= */
.hero {
    background: linear-gradient(135deg, #2d2a33 0%, #3a3540 100%);
    padding: 6rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: var(--display-font-size);
    font-weight: var(--display-font-weight);
    line-height: var(--display-line-height);
    letter-spacing: var(--display-letter-spacing);
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero-description {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    color: rgb(255 255 255 / 90%);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* How It Works Section */
.how-it-works {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
    margin-top: 4rem;
}

/* =================================================================
   Shared Section Styles - Used across multiple pages
   ================================================================= */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary, #1a202c);
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-secondary, #2d3748);
    line-height: 1.6;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.step {
    background-color: #fff;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    transition: all var(--transition-normal);
    border: 1px solid #e8ecf0;
    box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
    animation: fadeIn 0.5s ease-out;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgb(95 140 107 / 15%);
    border-color: var(--color-primary);
}

.step-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: linear-gradient(135deg, #5f8c6b 0%, #4f7659 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 1.75rem;
    font-weight: bold;
    box-shadow: 0 4px 14px rgb(95 140 107 / 30%);
    margin-bottom: 1.5rem;
}

.step-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin-bottom: 1rem;
    color: #2d2a33;
}

.step-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =================================================================
   Upload Page Styles
   ================================================================= */

/* Note: drop-zone styles removed in Phase 6 - upload page uses .upload-area instead */

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* file-list and config-section styles removed in Phase 6 - unused patterns */

/* =================================================================
   Processing Page Styles
/* =================================================================
   Processing Specific
   ================================================================= */

/* processing-header and processing-subtitle removed in Phase 6 - unused patterns */

/* Batch Information Section - primary styles in processing-page.css */
.batch-info-section {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: 2rem;
}

/* Legacy batch-details - kept for backward compatibility, use batch-details-grid instead */
.batch-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
}

.batch-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.batch-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.batch-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.batch-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Overall Progress Section */
.overall-progress-section {
    margin-bottom: 3rem;
}

.progress-container {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.progress-bar {
    width: 100%;
    height: 40px;
    background-color: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

/* progress-fill patterns removed in Phase 6 - moved to ProgressIndicator component */

.progress-text {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    z-index: 1;
}

.progress-stats {
    text-align: center;
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
}

/* File Processing Grid */
.files-grid-section {
    margin-bottom: 2rem;
}

/* file-grid and file-status patterns removed in Phase 6 - moved to FileGrid component */

/* file-card-content removed in Phase 6 - relocated to dev components page as scoped CSS */

/* file-thumbnail, file-status, and file-progress patterns removed in Phase 6 - moved to FileGrid component */

/* =================================================================
   Results Page Styles
   ================================================================= */

/* Note: model-item styles removed in Phase 6 - no usage detected in codebase */

.model-preview {
    text-align: center;
    margin-top: 3rem;
    padding: var(--spacing-xl);
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.model-preview img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgb(0 0 0 / 30%);
}

/* #downloadAllBtn styles removed in Phase 6 - no usage detected in codebase */

/* =================================================================
   Utility Classes
   ================================================================= */

/* All utility classes removed in Phase 6 - replaced with design tokens in components */

/* =================================================================
   Additional UI Components
   ================================================================= */

/* Status badges and error patterns removed in Phase 6 - unused patterns */

/* =================================================================
   Footer Styles
   ================================================================= */

/* Footer styles have been moved to shared-components.css for reusability */

/* =================================================================
   Accessibility and Focus States
   ================================================================= */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

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

/* =================================================================
   Responsive Design - Mobile First
   ================================================================= */
@media (width <= 768px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Navigation and Headers */
    .hero {
        padding: 4rem 0;
    }
    
    /* Grid Adjustments */
    .steps {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .batch-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .batch-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .file-grid {
        grid-template-columns: 1fr;
    }
    
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    /* Progress Bar */
    .progress-bar {
        height: 30px;
    }
    
    /* File Cards - file-card-content removed in Phase 6 - relocated to dev components */
    
    .file-thumbnail,
    .file-thumbnail-placeholder {
        width: 50px;
        height: 50px;
    }
    
    /* Model Items removed in Phase 6 - no usage detected in codebase */
    
    /* Button overrides removed in Phase 6 - Button component owns all styling */
    
    /* Upload Drop Zone removed in Phase 6 - upload page uses .upload-area instead */
    
    /* Step Components */
    .step {
        padding: var(--spacing-xl);
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.5rem;
    }
}

@media (width <= 480px) {
    /* Typography Scaling */
    h1 { font-size: 1.75rem; }

    h2 { font-size: 1.5rem; }

    h3 { font-size: 1.25rem; }
    
    /* Grid Adjustments */
    .file-list {
        grid-template-columns: 1fr 1fr;
    }
    
    .batch-details {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .batch-details-grid {
        grid-template-columns: 1fr;
    }
    
    /* Step Components */
    .step {
        padding: var(--spacing-lg);
    }
    
    /* Model Items removed in Phase 6 - no usage detected in codebase */
}

/* =================================================================
   Print Styles
   ================================================================= */
@media print {
    body {
        background-color: #fff;
        color: #000;
    }
    
    .btn,
    .action-section,
    .site-footer {
        display: none;
    }
    
    .container {
        max-width: 100%;
    }
}

/* =================================================================
   Animations
   ================================================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* =================================================================
   Dark Mode Support (System Preference)
   ================================================================= */
@media (prefers-color-scheme: light) {
    /* Users who prefer light mode could get an adjusted theme here */

    /* For now, we maintain dark theme as default */
}

/* =================================================================
   High Contrast Mode Support
   ================================================================= */
@media (prefers-contrast: more) {
    :root {
        --border-color: #666;
        --text-secondary: #ddd;
    }
    
    .btn:focus-visible,
    *:focus-visible {
        outline-width: 3px;
    }
}

/* =================================================================
   Error Toast Notification
   ================================================================= */
.error-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--brand-vibrant-red);
    color: #fff;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-red);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    max-width: 400px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    font-weight: 500;
}

.error-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.error-toast svg {
    flex-shrink: 0;
}

@media (width <= 480px) {
    .error-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}
