/*
 * ARTISAN IMAGE PROCESSOR - LAYOUT STYLES
 * 
 * This file contains all CSS related to page layout, structure, and positioning.
 * It defines how the main application components are arranged on the page.
 * 
 * Structure Overview:
 * - Global layout variables and base styles
 * - Main container and page layout
 * - Two-column layout (left panel + right panel)
 * - Section spacing and card-like appearances
 * - Responsive design considerations
 */

/* ===== GLOBAL LAYOUT VARIABLES & BASE STYLES ===== */
/* CSS custom properties for consistent styling throughout the app - matches original Artisan app */
:root {
    /* Color scheme - matches original Artisan styling */
    --primary-color: #333;
    --primary-hover: #555;
    --text-primary: #333;
    --text-secondary: #666;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --border-color: #ddd;
    --accent-blue: #e8f9ff;
    --accent-green: #ecfae5;
    --danger-color: #ff4d4d;
    --danger-hover: #dc2626;
    
    /* Spacing and sizing - matches original proportions */
    --h2-border-width: 1px;
    --section-padding: 25px;
    --section-margin: 30px;
    --panel-gap: 20px;
    --border-radius: 12px;
    --box-shadow-light: 3px 3px 12px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 4px 4px 16px rgba(0, 0, 0, 0.12);
    
    /* Form control variables - matches original button/input styling */
    --button-padding: 8px 20px;
    --input-padding: 8px;
    --button-radius: 20px;
    --input-radius: 6px;
}

/* Main page styling - sets font and background for entire application */
body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Utility class for hiding elements (used by JavaScript) */
.hidden {
    display: none;
}

/* ===== MAIN PAGE LAYOUT STRUCTURE ===== */
/* Main wrapper - centers content and limits maximum width for readability */
.container {
    max-width: 2000px;        /* Prevents content from getting too wide on large screens */
    margin: 0 auto;           /* Centers the container horizontally */
    padding: 30px;            /* Provides breathing room around edges */
}

/* Page title styling - large centered heading */
h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

/* Main application layout container - creates flexible two-column layout */
.app-container {
    display: flex;            /* Enables flexible layout */
    flex-wrap: wrap;          /* Allows panels to wrap on small screens */
    gap: var(--panel-gap);    /* Space between left and right panels */
    margin-top: 20px;
}

/* ===== PANEL LAYOUT SYSTEM ===== */
/* Left panel - contains upload and size selection sections */
.left-panel {
    flex: 2;                  /* Takes up 2/5 of the space (40%) */
    min-width: 300px;         /* Minimum width before wrapping */
}

/* Middle panel - contains preview and main content */
.middle-panel {
    flex: 1;                  /* Takes up 1/5 of the space (20%) - easily adjustable */
    min-width: 800px;         /* Minimum width for content visibility */
}

/* Right panel - contains preview and options sections */
.right-panel {
    flex: 2;                  /* Takes up 2/5 of the space (40%) */
    min-width: 300px;         /* Minimum width before wrapping */
}

/* Panel base styling - transparent containers that hold sections */
.panel {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

/* ===== SECTION CARD SYSTEM ===== */
/* Individual sections - creates card-like appearance for each major feature */
.section {
    margin-bottom: var(--section-margin);    /* Space between sections */
    background-color: white;                 /* Clean white background */
    border-radius: var(--border-radius);     /* Rounded corners */
    box-shadow: var(--box-shadow-light);     /* Subtle shadow for depth */
    padding: var(--section-padding);         /* Internal spacing */
    transition: all 0.2s ease;              /* Smooth hover animations */
    border: 1px solid rgba(0, 0, 0, 0.05);  /* Very subtle border */
}

/* Section hover effect - creates interactive feeling */
.section:hover {
    box-shadow: var(--box-shadow-hover);     /* Enhanced shadow on hover */
    transform: translateY(-1px);             /* Subtle lift effect */
}

/* Extra spacing for the last section (Process & Download) to separate it visually */
.section:last-child {
    margin-top: 40px;
}

/* Alternative targeting for process section spacing (using Tailwind class) */
.section.mt-6 {
    margin-top: 40px !important;
}

/* ===== RESPONSIVE DESIGN CONSIDERATIONS ===== */
/* On smaller screens, panels stack vertically instead of side-by-side */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;    /* Stack panels vertically */
    }
    
    .left-panel,
    .right-panel {
        min-width: 100%;          /* Full width on small screens */
        flex: 1;                  /* Equal sizing */
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .container {
        padding: 15px;            /* Reduced padding on mobile */
    }
    
    .section {
        padding: 20px;            /* Reduced section padding */
        margin-bottom: 20px;      /* Reduced section spacing */
    }
    
    h1 {
        font-size: 24px;          /* Smaller title on mobile */
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
/* Focus states for keyboard navigation - using subtle palette color */
.section:focus-within {
    outline: 2px none #fbfbfb;  /* Subtle color instead of distracting black */
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .section,
    .section:hover {
        transition: none;
        transform: none;
    }
}