/* HEADER ESPECÍFICO PARA TOOLS */
.tools-hero {
    position: relative;
    height: 50vh;
    /* Un poco más bajo que el perfil, más funcional */

    /* FONDO: Opción A (Color Sólido Técnico) */
    background-color: #0d1117;
    /* Un gris/azul muy oscuro estilo GitHub/VS Code */

    /* FONDO: Opción B (Imagen de Código o Abstracta) - Descomenta si prefieres imagen */
    /* background: linear-gradient(rgba(0, 59, 92, 0.9), rgba(0, 59, 92, 0.9)), 
                url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?auto=format&fit=crop&w=1500');
    background-size: cover;
    background-position: center;
    */

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-top: 60px;
    /* Espacio para el navbar */
    border-bottom: 4px solid #00A4E4;
    /* Línea Cyan abajo para marcar el borde tech */
}

/* El botón de volver en Tools puede ser más discreto */
.tools-hero .back-btn {
    margin-top: 25px;
    display: inline-block;
    color: #00A4E4;
    /* Cyan */
    border: 1px solid #00A4E4;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tools-hero .back-btn:hover {
    background: #00A4E4;
    color: #fff;
}

/* --- CONTENEDOR PRINCIPAL DE LA HERRAMIENTA --- */
.tools-section {
    padding: 60px 20px;
    background-color: var(--sand-white);
    min-height: 80vh;
}

.section-title {
    text-align: center;
    color: var(--deep-blue);
    margin-bottom: 10px;
    font-size: 2rem;
}

.tools-section p {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

/* --- BARRA DE CONTROLES (INPUTS) --- */
.controls-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Alinea los botones con los inputs abajo */
    gap: 20px;
    flex-wrap: wrap;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto 40px auto;
}

.controls-wrapper-paleta {

    justify-content: center;
    align-items: flex-end;
    /* Alinea los botones con los inputs abajo */
    gap: 20px;
    flex-wrap: wrap;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto 40px auto;
}

/* Etiquetas (Labels) */
.controls-wrapper label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--deep-blue);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;

}

/* Etiquetas (Labels) */
.controls-wrapper-paleta label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--deep-blue);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;

}

/* Inputs y Selects */
.controls-wrapper input[type="file"],
.controls-wrapper select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    min-width: 200px;
    cursor: pointer;
    transition: 0.3s;

}

/* Inputs y Selects */
.controls-wrapper-paleta input[type="file"] {
    padding: 10px;
     border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--deep-blue);
}

.controls-wrapper input[type="file"]:hover,
.controls-wrapper select:hover {
    border-color: var(--cyan-bright);
}

.controls-wrapper select:focus {
    outline: none;
    border-color: var(--cyan-bright);
    box-shadow: 0 0 0 3px rgba(0, 164, 228, 0.2);
}

/* Botón Reset */
#resetButton {
    background-color: var(--deep-blue);
    color: #fff;
    border: none;
    padding: 12px 25px !important;
    /* Forza el padding sobre el estilo en línea */
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    transition: 0.3s;
    height: 46px;
    /* Para igualar la altura de los inputs visualmente */
}

#resetButton:hover {
    background-color: var(--cyan-bright);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- EL CINE (ÁREA DE VISUALIZACIÓN) --- */
#container {
    background-color: #000;
    /* Fondo negro cine */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    /* Sombra dramática */
    max-width: 25%;
    margin: 0 auto;
    min-height: 200px;
    /* Altura mínima cuando está vacío */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #1a1a1a;
    /* Marco del monitor */
}

/* Marco interno */
#frame {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Imagen subida */
#preview {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Barras rojas (Letterbox) */
.letterbox {
    background: #8B0000;
    width: 100%;
    height: 0px;
    /* JS controla esto */
    transition: height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Animación suave cinematográfica */
    z-index: 10;
    position: absolute;

}

#top-bar {
    top: 0;
}

#bottom-bar {
    bottom: 0;
}


/* Placeholder (texto cuando no hay imagen) */
/* Agrega este párrafo en tu HTML dentro de #container si quieres que aparezca */
.placeholder-text {
    color: #444;
    font-size: 1.2rem;
    pointer-events: none;
    text-align: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-wrapper>div {
        width: 100%;
    }

    .controls-wrapper input,
    .controls-wrapper select,
    #resetButton {
        width: 100%;
    }
}

/* --- ESTILOS DEL CONVERSOR DE SUBTÍTULOS --- */

/* Contenedor de los controles (Barra superior) */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Input de Archivo */
.controls input[type="file"] {
    font-size: 0.9rem;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px dashed #ccc;
    cursor: pointer;
    color: var(--deep-blue);
}

/* Select (Desplegable) */
.controls select {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    color: var(--deep-blue);
    cursor: pointer;
    transition: 0.3s;
}

.controls select:hover,
.controls select:focus {
    border-color: var(--cyan-bright);
    outline: none;
}

/* Botón Convertir */
.controls button {
    background-color: var(--deep-blue);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0, 59, 92, 0.3);
}

.controls button:hover {
    background-color: var(--cyan-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 164, 228, 0.4);
}

/* Botón de Descarga (aparece después de convertir) */
#downloadLink {
    display: inline-block;
    margin: 20px 0;
    padding: 15px 40px;
    background-color: #2ecc71;
    /* Un verde éxito para diferenciar */
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    transition: 0.3s;
    text-align: center;
}

#downloadLink:hover {
    background-color: #27ae60;
    transform: translateY(-3px);
}

/* Área de Texto (Resultado) */
#outputText {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border: 2px solid #eee;
    border-radius: 8px;
    background-color: #fcfcfc;
    /* Un gris muy muy claro */
    font-family: 'Courier New', Courier, monospace;
    /* Fuente monoespaciada tipo código */
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    resize: vertical;
    /* Permite estirar hacia abajo */
    transition: 0.3s;
}

#outputText:focus {
    outline: none;
    border-color: var(--cyan-bright);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 164, 228, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls input,
    .controls select,
    .controls button {
        width: 100%;
    }
}


/* --- ESTILOS GENERADOR DE PALETAS --- */

/* Contenedor de la imagen */
.image-container {
    text-align: center;
    margin-bottom: 30px;
    background-color: #f4f4f4;
    border-radius: 8px;
    padding: 10px;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #ddd;
    /* Efecto "zona de carga" cuando está vacío */
}

.image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Rejilla de colores */
.palette-grid {
    display: grid;
    /* Crea columnas automáticas de mínimo 100px */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #fff;
}

/* El bloque de color individual */
.color-swatch {
    height: 100px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.color-swatch:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* El código HEX dentro del bloque */
.color-code {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Fondo semitransparente */
    color: #fff;
    font-size: 0.75rem;
    text-align: center;
    padding: 8px 0;
    font-family: monospace;
    backdrop-filter: blur(2px);
    transition: 0.3s;
}

.color-swatch:hover .color-code {
    background: rgba(0, 0, 0, 0.8);
    font-weight: bold;
    color: var(--cyan-bright);
    /* Se ilumina al pasar el mouse */
}




#imagePreview {
    max-width: 300px;
    margin-top: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#palette {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.colorBlock {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}

.colorBlock span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #ccc;
}