/* theme.css - Professional Compact Design */
:root {
    /* Modern color palette */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    
    /* Neutral colors optimized */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-surface: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Optimized spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    
    /* Smooth transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* Main Layout */
main {
    min-height: 100vh;
    padding: var(--space-lg);
    max-width: 1600px;
    margin: 0 auto;
}

section {
    display: flex;
    gap: var(--space-xl);
    height: calc(100vh - 40px);
    min-height: 650px;
}

/* Left Panel - Narrow Top, Broad Bottom */
.left {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: var(--space-md); /* Reduced gap for compactness */
    min-width: 0;
    min-height: 0; /* Allow flex children to determine height */
}

/* Compact Button Row */
.top {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Prevent shrinking */
    height: 64px; /* Fixed height for compactness */
    align-items: center;
}

/* Compact Buttons */
.btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex: 1;
    min-width: 120px;
    max-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* Button Variations */
#reset-btn {
    background: linear-gradient(135deg, var(--secondary), #7c3aed);
}

#Download-btn {
    background: linear-gradient(135deg, var(--success), #059669);
}

/* Image Canvas Area - Broad & Centered */
.bottom {
    flex: 1;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    min-height: 0; /* Allow flex to determine height */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    
}

/* Centered Placeholder */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-xl);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 10;
}

.placeholder i {
    font-size: 56px;
    color: var(--primary);
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.placeholder p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 300px;
}

#image-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: filter var(--transition-normal);
}

/* Right Panel - Filters */
.right {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Section Headers */
.right h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Controls */
.pafilters {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filters p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.filters p::after {
    content: attr(data-value);
    font-weight: 600;
    color: var(--primary);
    font-size: 12px;
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

/* Range Sliders */
.filters input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 3px;
    outline: none;
    margin: var(--space-xs) 0;
}

.filters input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
}

.filters input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Presets Grid */
.presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.presets .btn {
    padding: 8px var(--space-sm);
    font-size: 12px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: auto;
    max-width: none;
    flex: none;
}

.presets .btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Scrollbar */
.right::-webkit-scrollbar {
    width: 6px;
}

.right::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.right::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.right::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 1366px) { /* Laptop screens */
    section {
        height: calc(100vh - 32px);
        gap: var(--space-lg);
    }
    
    .right {
        width: 340px;
    }
    
    .btn {
        padding: 9px 16px;
        min-width: 110px;
    }
    
    .placeholder i {
        font-size: 48px;
    }
    
    .placeholder p {
        font-size: 15px;
    }
}

@media (max-width: 1024px) { /* Small laptops & tablets */
    section {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }
    
    .right {
        width: 100%;
        max-height: 400px;
    }
    
    .left {
        min-height: 50px ;
    }
    
    .presets {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) { /* Tablets */
    main {
        padding: var(--space-md);
    }
    
    .top {
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        gap: var(--space-xs);
    }
    
    .btn {
        min-width: calc(33.333% - var(--space-xs));
        max-width: none;
        padding: 10px var(--space-sm);
        font-size: 12px;
    }
    
    .presets {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .placeholder i {
        font-size: 42px;
    }
    
    .placeholder p {
        font-size: 14px;
        padding: 0 var(--space-md);
    }
}

@media (max-width: 480px) { /* Mobile */
    section {
        gap: var(--space-lg);
    }
    
    .left, .right {
        border-radius: var(--radius-lg);
    }
    
    .top {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1 0 calc(50% - var(--space-xs));
        margin-bottom: var(--space-xs);
    }
    
    .presets {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .placeholder i {
        font-size: 36px;
    }
    
    .placeholder p {
        font-size: 13px;
    }
}

/* Focus states */
.btn:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Active states */
.btn:active {
    transform: scale(0.98);
}

/* Value change animation */
@keyframes valueChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.filters p[data-value] {
    transition: color var(--transition-fast);
}

.filters input[type="range"]:active + * {
    color: var(--primary);
}

/* Print styles */
@media print {
    .top, .right {
        display: none !important;
    }
    
    .left {
        background: none;
        border: none;
        box-shadow: none;
        height: 100vh;
    }
    
    .bottom {
        background: none;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    
    #image-canvas {
        max-height: 100vh;
        max-width: 100vw;
    }
}