body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eff0f1;
    margin: 0;
    padding: 20px;
    display: block;
}

.container {
    width: 1100px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.language-selector select {
    padding: 8px 12px;
    border: 2px solid #0082ff;
    border-radius: 4px;
    background-color: white;
    color: #0082ff;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

.content {
    display: flex;
    flex-direction: row;
    padding: 5px 10px;
    min-height: 680px;
    box-sizing: border-box;
}

/* Left Controls */
.controls {
    width: 320px;
    padding-right: 15px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-bottom: 10px;
}

/* Right Preview */
.preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #fafafa;
    margin-left: 10px;
    padding: 0 5px 10px 5px;
    position: relative;
    overflow-y: auto;
    min-height: 600px;
}

label {
    font-weight: bold;
    color: #0072df;
    margin-bottom: 2px;
    display: block;
    font-size: 12px;
}

select, input[type="text"], input[type="password"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: opacity 0.2s;
}
button:hover { opacity: 0.85; }

button.action-btn {
    background-color: #d63b7a;
    color: white;
    padding: 8px;
    font-size: 15px;
    width: 100%;
    margin-top: 4px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

button.trash-btn {
    background-color: #dc3545;
    color: white;
    padding: 4px 10px;
    font-size: 11px;
}

button.secondary-btn {
    background-color: #7a00ff;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
}

button.gallery-btn {
    background-color: #0082ff;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
    width: 100%;
}

button.hair-btn {
    background-color: #2e7d32;
    color: white;
    padding: 8px;
    font-size: 15px;
    width: 100%;
    font-weight: bold;
}

button.ai-all-btn {
    background: linear-gradient(135deg, #e65100, #f9a825);
    color: white;
    padding: 10px;
    font-size: 15px;
    width: 100%;
    font-weight: bold;
    letter-spacing: 0.5px;
    border-radius: 6px;
}

/* API Key */
.api-key-container {
    background: #eef7ff;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #cce5ff;
}

.api-row {
    display: flex;
    gap: 5px;
}

#getApiKeyBtn {
    background-color: #28a745;
    color: white;
    white-space: nowrap;
    padding: 0 10px;
    font-size: 13px;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed #0082ff;
    background: #f0f7ff;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    color: #0072df;
    font-size: 13px;
}
.drop-zone:hover { background: #e1f0ff; border-color: #0058fe; }
.drop-zone.dragover { background: #0082ff; color: white; }

.status-msg {
    font-size: 12px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 5px;
}

/* Section divider */
.section-divider {
    border-top: 2px solid #f0d6ea;
    padding-top: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #d63b7a;
    text-align: center;
}

/* Color picker rows */
.color-picker-row {
    background: #fff5fa;
    border: 1px solid #f5c0d8;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.color-name {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* Swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.swatch:hover { transform: scale(1.2); }
.swatch.active { border-color: #333; transform: scale(1.15); }

.custom-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.custom-color-row label { margin: 0; font-size: 11px; color: #888; font-weight: normal; }
.custom-color-row input[type="color"] {
    width: 36px;
    height: 26px;
    padding: 1px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.opacity-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.opacity-row label { margin: 0; color: #888; font-weight: normal; white-space: nowrap; }
.opacity-row input[type="range"] { flex: 1; }
.opacity-row span { color: #555; min-width: 32px; font-size: 11px; }

/* Preview canvas/img container */
#img-container {
    border: 5px solid #0058fe;
    border-radius: 5px;
    overflow: hidden;
    background-color: #fff;
    transition: width 0.3s ease, height 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 400px;
    height: 400px;
    cursor: grab;
    position: relative;
    margin-top: 8px;
}
#img-container:active { cursor: grabbing; }

#img-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

#makeupCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    position: absolute;
    top: 0; left: 0;
}

.zoom-control {
    width: 80%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

input[type=range] { width: 100%; cursor: pointer; }

.loading-text {
    font-size: 20px;
    color: #20303a;
    display: none;
    z-index: 20;
    background: rgba(255,255,255,0.92);
    padding: 10px 20px;
    border-radius: 8px;
    pointer-events: none;
    margin-top: 10px;
    text-align: center;
}

/* Detection info */
.detection-panel {
    margin-top: 8px;
    font-size: 12px;
    color: #28a745;
    background: #f0fff4;
    border: 1px solid #b2dfdb;
    border-radius: 6px;
    padding: 6px 12px;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    font-weight: bold;
    font-size: 14px;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 20px; opacity: 1; }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 14px 20px;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
    background: #fafafa;
    width: 1100px;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0 0 8px 8px;
}
.app-footer strong { color: #333; }
