/* ===========================
   CSS Variables / Theme
   =========================== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --danger-color: #dc2626;
    --warning-color: #ea580c;
    
    --bg-color: #ffffff;
    --bg-gray: #f8fafc;
    --bg-dark: #1e293b;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    --transition: all 0.2s ease;
}

/* ===========================
   Reset & Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--primary-hover);
}

.small-caps {
    font-variant: small-caps;
    font-weight: 600;
}

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

/* ===========================
   Sticky Navigation
   =========================== */
.sticky-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-lg);
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
}

.nav-container a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-container a:hover {
    color: var(--primary-color);
    background: var(--bg-gray);
}

/* ===========================
   Hero / Header Section
   =========================== */
.hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
    background: linear-gradient(to bottom, var(--bg-gray), var(--bg-color));
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

.authors {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    background: var(--bg-color);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

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

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.btn:disabled:hover {
    transform: none;
}

.btn-icon {
    font-size: 1.2em;
}

/* ===========================
   Sections
   =========================== */
.section {
    padding: var(--spacing-xl) 0;
}

.section-gray {
    background: var(--bg-gray);
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===========================
   Abstract Section
   =========================== */
.abstract-content {
    max-width: var(--container-width);
    margin: 0 auto;
    background: var(--bg-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.abstract-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

/* ===========================
   Results Gallery
   =========================== */
.results-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

/* When hovering on gallery, shrink all cards */
.results-gallery:hover .result-card {
    transform: scale(0.75);
    opacity: 0.4;
    filter: blur(1px);
}

/* The hovered card scales up dramatically */
.results-gallery:hover .result-card:hover {
    transform: scale(1.35);
    opacity: 1;
    filter: blur(0);
    z-index: 100;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.result-card {
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease,
                opacity 0.4s ease,
                filter 0.4s ease;
    cursor: pointer;
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
}

.result-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
}

.result-image-wrapper {
    position: relative;
    border-radius: var(--border-radius);
}

.result-image-wrapper .image-label {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.result-card:hover .image-label {
    opacity: 1;
}

.result-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.result-prompt-compact {
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.result-prompt-compact p {
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-prompt-compact p strong {
    color: var(--primary-color);
}

/* ===========================
   Demo Modules (Stacked Layout)
   =========================== */
.demo-module {
    margin-bottom: var(--spacing-xl);
}

.module-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    margin-right: var(--spacing-sm);
}

/* ===========================
   Decomposer Module
   =========================== */
.decomposer-card,
.editor-card {
    background: var(--bg-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.decomposer-card h3,
.editor-card h3 {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.instruction-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Example Selector */
.example-selector {
    margin-bottom: var(--spacing-lg);
}

.example-selector h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.example-thumbnails {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.example-thumb {
    cursor: pointer;
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    text-align: center;
    background: var(--bg-gray);
}

.example-thumb:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.example-thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.example-thumb img {
    width: 180px;
    height: 120px;
    object-fit: cover;
    display: block;
}

.example-thumb span {
    display: block;
    padding: var(--spacing-xs);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Decompose Input */
.decompose-input {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    animation: slideDown 0.3s ease-out;
    text-align: center;
}

.decompose-input .prompt-area {
    text-align: left;
    max-width: 500px;
    margin: 0 auto var(--spacing-md);
}

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

.decompose-input .prompt-area label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.decompose-input .prompt-area textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

.decompose-input .prompt-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Progress Button */
.btn-progress {
    position: relative;
    overflow: hidden;
}

.btn-progress .btn-text,
.btn-progress .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
}

.btn-progress .btn-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-progress .btn-loading.hidden {
    display: none;
}

.btn-progress .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.8), rgba(255,255,255,0.3));
    transition: width 3s ease-out;
}

.btn-progress.loading .btn-text {
    opacity: 0;
}

.btn-progress.loading .btn-loading {
    display: flex;
}

.btn-progress.loading .progress-bar {
    width: 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.btn-progress.loading {
    pointer-events: none;
    background: linear-gradient(90deg, var(--primary-color), #4f86f7, var(--primary-color));
    background-size: 200% 100%;
    animation: gradientMove 2s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Decomposer Results */
.decomposer-results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
    align-items: start;
}

.original-section,
.background-section {
    display: flex;
    flex-direction: column;
}

.original-result,
.background-result {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.original-section img,
.background-section img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.hidden {
    display: none !important;
}

.decomposer-output {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-gray);
    border-radius: var(--border-radius);
}

.decomposer-output h4 {
    margin-bottom: var(--spacing-md);
}

.output-section {
    margin-bottom: var(--spacing-lg);
}

.output-section h5 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.background-result {
    text-align: center;
}

.background-result img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--spacing-sm);
    max-width: 800px;
}

.instance-item {
    text-align: center;
    padding: var(--spacing-xs);
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.instance-item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xs);
}

.instance-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.output-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    justify-content: center;
}

/* ===========================
   VLA Editor
   =========================== */
.editor-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.editor-top-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--spacing-md);
    height: 450px;
}

.editor-sidebar {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.scroll-arrows {
    display: flex;
    gap: 4px;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.scroll-arrow:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.element-library {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    overflow-y: auto;
    flex: 1;
}

.library-item {
    cursor: pointer;
    padding: var(--spacing-xs);
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
}

.library-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

/* Element is on canvas */
.library-item.on-canvas {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.library-item.on-canvas::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Currently selected element */
.library-item.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.library-item.selected::before {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.library-item img {
    width: 100%;
    height: 60px;
    object-fit: contain;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    margin-bottom: 4px;
}

.library-item.on-canvas img {
    opacity: 0.7;
}

.library-item p {
    font-size: 0.7rem;
    margin: 0;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-item.on-canvas p {
    color: #10b981;
    font-weight: 500;
}

.library-item.selected p {
    color: var(--primary-color);
    font-weight: 600;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: var(--spacing-sm);
}

.editor-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    height: 100%;
}

.canvas-toolbar {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    flex-shrink: 0;
}

.canvas-container {
    flex: 1;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    overflow: auto;
}

.editor-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 380px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
    transition: outline 0.2s ease;
}

.canvas-element img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.canvas-element.selected {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.canvas-element:hover:not(.selected) {
    outline: 2px dashed var(--primary-color);
    outline-offset: 2px;
}

/* Editor Controls (Bottom) */
.editor-controls {
    background: var(--bg-gray);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
}

.editor-controls h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scale-value {
    padding: 0 var(--spacing-xs);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.layer-controls {
    align-items: center;
}

.layer-input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.layer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Hide number input arrows */
.layer-input::-webkit-outer-spin-button,
.layer-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.layer-input[type=number] {
    -moz-appearance: textfield;
}

.info-display-inline {
    display: flex;
    gap: var(--spacing-sm);
}

.info-display-inline small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.control-buttons {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: center;
}

.control-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.control-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    color: var(--text-primary);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.control-btn.btn-danger:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.control-btn.btn-warning:hover {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.control-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.scale-display {
    text-align: center;
    padding: var(--spacing-xs);
    background: var(--bg-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--primary-color);
}

.element-info {
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.info-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-display small {
    color: var(--text-secondary);
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--bg-dark);
    color: white;
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-xs);
}

.footer-note {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .results-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .editor-top-row {
        grid-template-columns: 150px 1fr;
        height: 400px;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .nav-container {
        gap: var(--spacing-sm);
    }
    
    .results-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .results-gallery:hover .result-card {
        transform: scale(0.85);
        opacity: 0.5;
    }
    
    .results-gallery:hover .result-card:hover {
        transform: scale(1.2);
        opacity: 1;
    }
    
    .editor-top-row {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .editor-sidebar {
        max-height: 200px;
    }
    
    .element-library {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .library-item {
        width: calc(33% - 8px);
    }
    
    .controls-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .results-gallery {
        grid-template-columns: 1fr;
    }
    
    .result-images {
        grid-template-columns: 1fr 1fr;
    }
}

