:root {
    --primary-color: #6a89cc;
    --secondary-color: #4a69bd;
    --background-color: #e0efff;
    --card-background: #ffffff;
    --border-color: #bbd5ff;
    --text-color: #333;
    --drop-zone-bg: #f9fbfd;
    --drop-zone-border: #a4c9ff;
    --hover-bg: #f0f8ff;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --locked-color: #ffb4a2;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
    flex-direction: column;
}
.container {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-medium);
    padding: 30px;
    max-width: 1000px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 0 auto;
}
h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    font-size: 2.5em;
    font-weight: 600;
}
h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}
h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}
section {
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--hover-bg);
    box-shadow: 0 4px 15px var(--shadow-light);
}
.frame-loading-section {
    display: flex;
    flex-direction: column;
}
.frame-loaders {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
}
.frame-loader {
    flex: 1;
    min-width: 300px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px var(--shadow-light);
}
.drop-zone {
    width: 100%;
    max-width: 350px;
    height: 120px;
    border: 3px dashed var(--drop-zone-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.1em;
    color: var(--secondary-color);
    background-color: var(--drop-zone-bg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}
.drop-zone:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
}
.drop-zone.drag-over {
    background-color: #dbeaff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(106, 137, 204, 0.3);
}
.drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}
.image-preview-container {
    width: 100%;
    max-width: 350px;
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #f0f0f0;
    margin: 0 auto;
}
.image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}
.image-preview[src]:not([src="#"]) {
    display: block;
}
.frame-controls {
    width: 100%;
    max-width: 350px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    display: none;
    flex-direction: column;
    gap: 15px;
}
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.control-group label {
    font-weight: 600;
    color: var(--secondary-color);
}
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.slider-group span {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}
.slider-group > div {
    display: flex;
    align-items: center;
}
input[type="range"] {
    flex-grow: 1;
    cursor: pointer;
}
input[type="color"] {
    width: 100%;
    height: 35px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    background-color: transparent;
}
input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.lock-button {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--secondary-color);
    background-color: var(--hover-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-right: 5px;
}
.lock-button:hover {
    background-color: var(--border-color);
    transform: scale(1.1);
}
.lock-button.locked {
    background-color: var(--locked-color);
    color: white;
    border-color: #e5989b;
}
.composition-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.canvas-container {
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-medium);
    background-color: #000000;
}
#compositionCanvas {
    display: block;
    background-color: transparent;
    cursor: grab;
}
#compositionCanvas.dragging {
    cursor: grabbing;
}
button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}
button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.utility-button {
    background-color: #a8a8a8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.utility-button:hover {
    background-color: #8c8c8c;
}
#resetButton {
    background-color: #e5989b;
}
#resetButton:hover {
    background-color: #d98084;
}
@media (max-width: 920px) {
    .frame-loaders {
        flex-direction: column;
        align-items: center;
    }
    .frame-loader {
        width: 100%;
        max-width: 400px;
    }
}
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    h1 { font-size: 2em; }
    h2 { font-size: 1.5em; }
    .drop-zone, .image-preview-container, .frame-controls { max-width: none; }
}
header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
h1 {
    margin: 0;
    font-size: 2.5em;
}
.section-title {
    text-align: center;
    width: 100%;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}
.frame-loading-section, .composition-section {
    align-items: center;
}
.frame-loaders {
    justify-content: center;
    width: 100%;
}
footer {
    text-align: center;
    font-size: 0.8em;
    color: #888;
    margin-top: auto;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}
.control-item-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
}

/* Extend color and balance controls to the full width */
.frame-controls .control-group,
.frame-controls .control-item-row {
    width: 100%;
}