/* Layout Styles - Grid and Flexbox */
body {
    font-family: var(--font-primary);
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: var(--header-height);
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--primary-light);
}

.logo-icon {
    font-size: var(--text-3xl);
}

.tagline {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-top: var(--space-xs);
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-lg);
    gap: var(--space-lg);
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-width: 0;
}

.image-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    flex: 1;
    min-height: 500px;
}

.canvas-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 400px;
}

#imageCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

/* Drop Zone */
.drop-zone {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    border: 3px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.95);
    cursor: pointer;
    transition: all var(--transition-base);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.drop-zone.drag-over {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.01);
}

.drop-zone.hidden {
    display: none;
}

.drop-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.drop-text {
    font-size: var(--text-lg);
    color: var(--text);
    font-weight: 600;
}

.drop-hint {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Image Info */
.image-info {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.image-info.active {
    display: flex;
}

/* Controls Panel */
.controls-panel {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height) - var(--space-lg) * 2);
}

.control-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Grids */
.sample-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    max-height: 450px;
    overflow-y: auto;
    padding: var(--space-xs);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-hover);
}
