/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --success-hover: #059669;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Text */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4);
}

/* Bezel Builder Banner */
.bezel-builder-banner {
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--success-color);
    position: relative;
    overflow: hidden;
}

.bezel-builder-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
}

.banner-content i.fas {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
    color: white;
}

.banner-text strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.banner-text span {
    font-size: 0.9rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.builder-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.builder-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.builder-link:active {
    transform: translateY(0);
}

.builder-link i {
    font-size: 0.8rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: var(--space-12);
    padding: var(--space-8) 0;
}

.header-content {
    background: var(--bg-primary);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.title i {
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Section Styles */
.config-section,
.generator-section,
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-8);
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.model-info {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.model-tag,
.pricing-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.config-content,
.generator-form {
    padding: var(--space-8);
}

/* Form Styles */
.form-section {
    margin-bottom: var(--space-8);
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-wrapper,
.seed-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input.invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.toggle-visibility {
    position: absolute;
    right: var(--space-3);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
}

.toggle-visibility:hover {
    color: var(--primary-color);
}

/* Random Seed Button */
.random-seed-btn {
    position: absolute;
    right: var(--space-2);
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.random-seed-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.random-seed-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.seed-input-wrapper input {
    padding-right: 48px;
}

/* Seed Controls */
.seed-controls {
    margin-top: var(--space-3);
}

.seed-mode-text {
    font-weight: 500;
    font-size: 0.9rem;
}

.seed-description {
    display: block;
    margin-top: var(--space-2);
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
}

/* Cache Controls */
.cache-controls {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.clear-cache-btn {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-sm);
}

.clear-cache-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.clear-cache-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.clear-cache-btn i {
    font-size: 0.85rem;
}

.input-help {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.input-help a:hover {
    text-decoration: underline;
}

/* API Key Validation Messages */
.api-key-validation-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeIn 0.3s ease;
}

.api-key-validation-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeIn 0.3s ease;
}

.api-key-cache-loaded {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeIn 0.3s ease;
}

.image-upload-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeIn 0.3s ease;
}

.seed-generated-message {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeIn 0.3s ease;
    font-weight: 500;
}

.cache-cleared-message {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-3);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: fadeIn 0.3s ease;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

/* Slider Styles */
.slider-group {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.slider {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

.slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--gray-100);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: var(--space-3);
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 3px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Visual feedback for disabled preprocessors */
.checkbox-label.disabled {
    opacity: 0.7;
}

.checkbox-label.disabled .checkmark {
    border-color: var(--error-color);
    background: #fef2f2;
}

.checkbox-label.disabled::after {
    content: " (DISABLED)";
    color: var(--error-color);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: var(--space-2);
}

/* Enable toggle styling */
.enable-toggle {
    font-weight: 600;
    font-size: 0.9rem;
}

.toggle-text {
    margin-left: var(--space-2);
}

/* Processing explanations */
.processing-explanation {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.processing-explanation p {
    margin: 0;
    font-size: 0.85rem;
    color: #1f2937;
    font-style: italic;
    font-weight: 500;
}

/* Preprocessing options */
.preprocessing-options {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-200);
}

.preprocessing-options h7 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    display: block;
}

/* Radio button styling */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-3);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-bg);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-mark {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    background: var(--bg-primary);
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-label input[type="radio"]:checked + .radio-mark {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.radio-content {
    flex: 1;
}

.radio-content strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.radio-content small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}



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

/* Section Title with Toggle */
.section-title-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--gray-200);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.section-title-with-toggle h3 {
    margin: 0;
}

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 32px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.toggle-labels {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.toggle-label.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Input Sections */
.input-section {
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    max-height: none;
}

.input-section.hidden {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Unified Input Section */
.unified-control-group {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--gray-200);
}

.unified-header {
    margin-bottom: var(--space-6);
    text-align: center;
}

.unified-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    font-style: italic;
}

/* Processing Controls */
.processing-controls {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--gray-200);
}

.processing-controls h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    text-align: center;
}

.processing-group {
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all 0.2s ease;
}

.processing-group:hover {
    box-shadow: var(--shadow-md);
}

.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
}

.processing-header h6 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.processing-settings {
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    max-height: none;
}

.processing-settings.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Control Headers (for separate mode) */
.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
}

.control-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.control-content {
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    max-height: none;
}

.control-content.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Control Images (for separate mode) */
.control-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-8);
}

.control-group {
    background: var(--bg-secondary);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.control-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--gray-50);
}

.file-upload-area.drag-over {
    border-color: var(--success-color);
    background: #f0fdf4;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.file-upload-area.drag-over i {
    color: var(--success-color);
    transform: scale(1.1);
}

.file-upload-area.drag-over span {
    color: var(--success-color);
    font-weight: 600;
}

.file-upload-area i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
}

.file-upload-area span {
    display: block;
    color: var(--text-secondary);
    font-weight: 500;
}

.image-preview {
    margin-top: var(--space-4);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: none;
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}

.image-preview.show {
    display: block;
}

/* Generate Button */
.form-actions {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 2px solid var(--gray-200);
}

.generate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    justify-content: center;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-btn.loading {
    background: var(--gray-400);
}

.generate-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Results Section */
.results-content {
    padding: var(--space-8);
}

.status-area {
    text-align: center;
    padding: var(--space-8);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 2rem;
}

.image-result {
    text-align: center;
    margin-top: var(--space-6);
}

.result-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 4px solid white;
}

.result-info {
    background: var(--bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-top: var(--space-4);
    display: inline-block;
    min-width: 200px;
}

.result-info p {
    margin: var(--space-1) 0;
    font-size: 0.9rem;
}

.result-info strong {
    color: var(--primary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-8) 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.hidden-file-input {
    display: none;
}

/* Error States */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid #fecaca;
    margin-top: var(--space-4);
}

.success-message {
    background: #ecfdf5;
    color: #065f46;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid #a7f3d0;
    margin-top: var(--space-4);
}

/* Image Gallery Styles */
.image-gallery {
    width: 100%;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--gray-200);
}

.gallery-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.clear-session-btn {
    background: var(--error-color);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.clear-session-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}

.image-card {
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.image-thumbnail {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.image-thumbnail:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 1.5rem;
}

.image-thumbnail:hover .image-overlay {
    opacity: 1;
}

.image-info {
    padding: var(--space-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.image-dimensions {
    font-weight: 500;
    color: var(--text-primary);
}

.image-size {
    color: var(--text-secondary);
}

.image-actions {
    display: flex;
    gap: var(--space-2);
}

.download-btn,
.preview-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.download-btn:hover,
.preview-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.preview-btn {
    background: var(--secondary-color);
}

.preview-btn:hover {
    background: #7c3aed;
}

.image-timestamp {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-secondary);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--gray-200);
}

.no-images {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--space-8);
    font-style: italic;
}

/* Fullscreen Modal Styles */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#fullscreenImage {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-controls {
    margin-top: var(--space-4);
    display: flex;
    gap: var(--space-3);
}

.modal-download {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.modal-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

body.modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--space-2);
    }
    
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .control-images {
        grid-template-columns: 1fr;
    }
    
    .config-content,
    .generator-form,
    .results-content {
        padding: var(--space-4);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-3);
    }

    .gallery-header {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .modal-close {
        top: -40px;
        right: 0;
    }

    #fullscreenImage {
        max-height: calc(95vh - 60px);
    }

    /* Bezel Builder Banner responsive */
    .banner-content {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .banner-content i.fas {
        font-size: 1.5rem;
    }

    .banner-text strong {
        font-size: 1rem;
    }

    .builder-link {
        align-self: stretch;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
    }
    
    .generate-btn {
        padding: var(--space-3) var(--space-6);
        font-size: 1rem;
        min-width: 160px;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --bg-tertiary: #0f172a;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
    }
    
    .file-upload-area:hover {
        background: var(--gray-800);
    }
}
