/* --- VARIABLES Y CONFIGURACIÓN BASE --- */
:root {
    --primary: #2c2c2c;
    --primary-dark: #111111;
    --accent: #8b6f47;
    --accent-dark: #6b5030;
    --bg-light: #f5f2ee;
    --text-dark: #2c2c2c;
    --white: #ffffff;
    --border-color: #ddd;
    --success: #4a7c59;
}

body {
    font-family: 'Segoe UI', 'Georgia', Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    padding: 20px;
    color: var(--text-dark);
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- CABECERA --- */
.header-band {
    background: linear-gradient(135deg, #1a1a1a, #4a3728);
    color: white;
    padding: 30px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.display-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.display-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideUpFadeIn 0.5s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.fade-out {
    animation: fadeOutDown 0.8s ease-in forwards;
}

@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* --- ESTRUCTURA DE CONTENIDO --- */
.content {
    display: flex;
    padding: 40px;
    gap: 40px;
    min-height: 650px;
}

.content.hidden {
    display: none !important;
}

/* --- COLUMNA IZQUIERDA: CONTROLES --- */
.controls {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 1.5px;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
}

textarea {
    height: 70px;
    resize: none;
}

/* --- UPLOAD (reservado) --- */
.drop-zone {
    border: 2px dashed var(--primary);
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: 0.3s;
}

.drop-zone:hover {
    background: #f0f7ff;
}

/* BARRA DE ESTADO DE CARGA */
.upload-status-bar {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    min-height: 32px;
    box-sizing: border-box;
}

.mini-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.mini-btn:hover {
    background: #5a6268;
}

/* --- COLUMNA DERECHA: PREVISUALIZACIÓN --- */
.preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fdfdfd;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    border: 1px solid #f0f0f0;
}

.preview-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #b0a090;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 400;
}

/* EL RECUADRO DINÁMICO */
.img-container-box {
    border: 2px solid #c4a882;
    border-radius: 4px;
    background: #faf8f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    max-width: 100%;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* --- BOTONES DE ACCIÓN --- */
.action-btn {
    background: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* BOTÓN DE DESCARGA ELEGANTE */
.elegant-btn {
    background: linear-gradient(135deg, var(--accent), #c4a882);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(139,111,71,0.3);
    letter-spacing: 1px;
}

.elegant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139,111,71,0.4);
    filter: brightness(1.1);
}

/* --- ESTADOS DE CARGA (LOADING) --- */
.loading-text {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--accent);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--accent);
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 12px;
}

/* --- FOOTER --- */
#app-footer {
    text-align: center;
    padding: 25px;
    color: #888;
    font-size: 12px;
    border-top: 1px solid #eee;
    line-height: 1.5;
}

/* --- RESPONSIVIDAD BÁSICA --- */
@media (max-width: 900px) {
    .content {
        flex-direction: column;
        align-items: center;
    }
    .controls {
        width: 100%;
    }
    .img-container-box {
        max-width: 100%;
    }
}