:root {
    --bg-start: #08111f;
    --bg-end: #111827;
    --panel: rgba(14, 23, 40, 0.82);
    --panel-strong: rgba(19, 30, 52, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #bfd0e4;
    --primary: #38bdf8;
    --primary-strong: #0ea5e9;
    --neutral: #94a3b8;
    --neutral-strong: #cbd5e1;
    --success: #22c55e;
    --success-strong: #16a34a;
    --track: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
    background: var(--bg-end);
}

.srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    min-height: 100dvh;
    padding-inline: 40px;
    padding-block: 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    background:
        radial-gradient(circle at 20% 15%, rgba(56, 189, 248, 0.16) 0%, transparent 24%),
        radial-gradient(circle at 80% 8%, rgba(34, 197, 94, 0.12) 0%, transparent 22%),
        linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    color: var(--text);
}

#leftContainer {
    width: min(100%, 920px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

#actionBtnContainer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.actionBtn {
    all: unset;
    min-width: 116px;
    padding-inline: 14px;
    padding-block: 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #f8fafc;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.actionBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
}

.actionBtn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.actionBtn--primary:hover {
    background: linear-gradient(135deg, #67d1ff 0%, var(--primary-strong) 100%);
}

.actionBtn--neutral {
    background: linear-gradient(135deg, var(--neutral) 0%, #64748b 100%);
}

.actionBtn--neutral:hover {
    background: linear-gradient(135deg, var(--neutral-strong) 0%, #64748b 100%);
}

.actionBtn--success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);
}

.actionBtn--success:hover {
    background: linear-gradient(135deg, #4ade80 0%, var(--success-strong) 100%);
}

#imageScreen {
    height: 100%;
    width: 100%;
    min-height: 480px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.28);
    display: grid;
    place-items: center;
    overflow: hidden;
}

#imageScreen img {
    max-width: 100%;
    max-height: 76dvh;
    object-fit: contain;
}

#editor {
    width: 380px;
    height: fit-content;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.3);
}

.editorHeader {
    margin-bottom: 16px;
}

.editorHeader h1 {
    color: var(--text);
    margin-bottom: 6px;
    font-size: 1.5rem;
}

.editorHeader p {
    color: var(--muted);
    line-height: 1.4;
    font-size: 0.94rem;
}

.filtersGrid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.presetSection {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.presetSection h2 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 10px;
}

.presetButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.presetBtn {
    all: unset;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.45);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.presetBtn:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.16);
}

.presetBtn.is-active {
    border-color: rgba(56, 189, 248, 0.75);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(14, 165, 233, 0.34));
}

.filterItem {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.35);
}

label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #dbeafe;
    text-transform: capitalize;
    font-size: 0.92rem;
    font-weight: 600;
}

.controlValue {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    height: 6px;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: var(--track);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f8fafc;
    border: 3px solid var(--primary);
    margin-top: -6px;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16);
}

#imageInput {
    display: none;
}

@media (max-width: 980px) {
    .container {
        flex-direction: column;
        align-items: stretch;
        padding-inline: 16px;
        padding-block: 16px 22px;
        gap: 18px;
    }

    #actionBtnContainer {
        width: 100%;
        justify-content: stretch;
    }

    .actionBtn {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 12px;
        padding-block: 10px;
        font-size: 0.92rem;
    }

    #leftContainer,
    #editor {
        width: 100%;
    }

    #imageScreen {
        min-height: 300px;
        border-radius: 20px;
    }

    #imageScreen img {
        max-height: 50dvh;
    }

    #editor {
        padding: 16px;
        border-radius: 20px;
    }

    .editorHeader {
        margin-bottom: 12px;
    }

    .editorHeader h1 {
        font-size: 1.25rem;
    }

    .editorHeader p {
        font-size: 0.88rem;
    }

    .presetSection {
        margin-top: 12px;
        padding-top: 12px;
    }

    .presetButtons {
        gap: 8px;
    }

    .presetBtn {
        padding: 9px 12px;
        font-size: 0.84rem;
    }

    .filtersGrid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .filterItem {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 6px;
        padding: 9px 10px;
        border-radius: 14px;
        min-width: 0;
    }

    .filterItem label {
        line-height: 1.15;
        font-size: 0.8rem;
    }

    .controlValue {
        font-size: 0.72rem;
    }

    input[type="range"] {
        height: 4px;
    }

    input[type="range"]::-webkit-slider-runnable-track {
        height: 4px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
        margin-top: -6px;
    }
}