body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eff0f1;
    margin: 0;
    padding: 20px;
    display: block;
    /* Cambiado de flex para que el footer ocupe todo el ancho */
}

.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;
    /* Centrado horizontal */
}

/* Language Selector */
.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 Areas */
.content {
    display: flex;
    flex-direction: row;
    padding: 5px 10px;
    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: 5px;
    overflow-y: auto;
}

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

/* Inputs & Labels */
label {
    font-weight: bold;
    color: #0072df;
    margin-bottom: 1px;
    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;
}

textarea {
    width: 100%;
    height: 45px;
    padding: 6px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 2px;
}

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

/* Botones */
button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button.action-btn {
    background-color: #007ef6;
    color: white;
    padding: 6px;
    font-size: 14px;
    width: 100%;
    margin-top: 2px;
}

button.trash-btn {
    background-color: #222;
    color: white;
    padding: 5px 10px;
}

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

/* API Key Section (BYOP) */
.api-key-container {
    background: #eef7ff;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #cce5ff;
    margin-bottom: 2px;
}

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

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

/* Recuadro y Zoom/Pan */
#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;
}

#img-container:active {
    cursor: grabbing;
}

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

.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: 24px;
    color: #20303a;
    display: none;
    position: absolute;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    pointer-events: none;
}

/* Toast Notifications */
.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;
    animation: slideUp 0.3s ease-out;
    font-weight: bold;
    font-size: 14px;
}

@keyframes slideUp {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 20px; opacity: 1; }
}

/* Estilos para la zona de carga de archivos */
.drop-zone {
    border: 2px dashed #0082ff;
    background: #f0f7ff;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 10px;
    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;
    text-align: center;
}
