/* Fuentes custom */
@font-face {
    font-family: 'Delavan';
    src: url('fonts/delavan_.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Goudos';
    src: url('fonts/GOUDOS.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* declare colors in root */
:root {
    --primary-color: #af320c;
    --primary-color-muted: #431103;
    --secondary-color: #b86c16;
    --background-color: #1f2326;
    --text-color: #ffffff;
    --border-color: #ccc;
    --highlight-color: #ffa564;

}

/* Estilos generales */
body {
    font-family: sans-serif;
    background-color: black;
    color: var(--text-color);

    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Goudos', serif;
    font-size: 1rem;
}

body h1 {
    font-family: 'Delavan', sans-serif;
    font-size: 2rem;
    color: white;
    font-weight: normal;
    margin-bottom: 20px;
    line-height: 1;
}

button {
    font-family: 'Goudos', serif;
}


.app-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    /* max-width: 950px; */
    max-width: 100%;
    min-width: 800px;
    width: 100%;
    background-color: var(--background-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;

}

.ux-container {
    display: flex;
    flex-direction: column;
    padding-inline: 3rem;
    flex: 1;

    max-height: 90vh;
    overflow-y: auto;
}

.card-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Formulario de subida/URL */
#image-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 1rem;
}

.custom-file-label {
    display: inline-block;
    width: 100%;
    padding: 8px;
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.custom-file-label:hover {
    background-color: var(--secondary-color);

}

.creature-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 400px;
    align-self: center;
    /* margin-block: 2rem; */
}

.creature-type-icons {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 1rem;
    column-gap: 2.5rem;
    row-gap: 1.5rem;
    flex-direction: row;
    align-items: flex-start;
    margin-block: 1rem;
    flex-wrap: wrap;
}

.icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: .8rem;
    width: 50px;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.icon-container p {
    margin-top: 1px;
    font-size: 1rem;
    color: var(--secondary-color);

}

.icon-container img {
    width: 50px;
    height: 50px;
    border-radius: 50%;

}

/* select the first .icon-container */
.icon-container:first-child img {
    width: 45px;
    height: 45px;
    border: 2px solid gray;
    border-radius: 50%;

}

.icon-container img:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
    box-shadow: 0 0 15px var(--secondary-color);
}

.icon-thumb.active {
    box-shadow: 0 0 15px var(--primary-color);
}

/* Ocultar labels de iconos salvo en hover */
.icon-label {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.icon-container:hover .icon-label {
    display: block;
}

.icon-thumb.active+.icon-label {
    display: block;
}

/* Botones de posicion de Type */

.position-buttons {
    margin-top: 1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0px;
    width: 100%;

    align-items: center;
}

.position-buttons.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.position-buttons button {
    width: 100px;
    background-color: var(--primary-color-muted);
    color: var(--text-color);
    border: none;
    padding: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
    font-size: .8rem;
}

.position-buttons button:hover {
    background-color: var(--secondary-color);

}

.position-buttons #icon-left {
    border-radius: 15px 0 0 15px;
}

.position-buttons #icon-right {
    border-radius: 0 15px 15px 0;

}

#icon-left.active,
#icon-right.active,
#icon-center.active {
    background-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}


/* Selector de Clanes */
.clan-form-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 16px;
    gap: 4px;
}

.clan-form-container select {
    width: auto;
    padding: 8px;
    border: none;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.56);
    border-radius: 4px;
    font-size: .8rem;
    background-color: var(--background-color);
    color: var(--text-color);
}

.clan-form-container select:focus {
    outline: none;
}

/* Selector de bordes */

.border-title {

    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 8px;
    text-align: left;
}

#selected-border {
    /* span to look like a pill */
    display: inline-block;
    padding: 4px 8px;
    background-color: black;
    color: var(--secondary-color);
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}


#border-options {
    margin-bottom: 16px;
    text-align: left;
}

.border-thumb {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    margin: 0 4px;
    transition: border-color 0.2s;
}

.border-thumb.active {
    /* border-color: var(--primary-color); */
    box-shadow: 0 0 10px var(--primary-color);
}

/* Estilos de los ajustes de la imagen */
#adjustment-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 16px;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 12px;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.638);

}

/* Configuraciones de TEXTO de la Carta */
#text-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

.text-form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    margin-bottom: 8px;
}

input[type="text"],
input[type="url"],
textarea {
    width: auto;
    padding: 8px;
    border: none;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.56);
    border-radius: 4px;
    font-size: .8rem;
    background-color: var(--background-color);
    color: var(--text-color);
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
    outline: none;
    box-shadow: inset 0 0 10px var(--secondary-color);
}


/* Download buttoon */

#export-btn {
    display: inline-block;
    font-family: 'Goudos', serif;
    text-align: center;
    padding: 4px 4px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1.5rem;
    text-decoration: none;
    width: 50%;
    box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.649);
    transition: background-color 0.2s, transform 0.2s;
}

#export-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(0.99);
    box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.649), inset 0px 2px 5px rgba(0, 0, 0, 0.553);

}

/* Card container */

#card-wrapper {
    position: relative;
    display: flex;
    height: 1050px;
    width: 100%;
    /* Usamos zoom para que el contenedor se reduzca en layout */
    zoom: 0.7;
    /* display: inline-block; */
    /* Ajusta el ancho al contenido escalado */
    margin: 20px auto 10px;
    overflow: visible;
    /* Permite que los iconos sobresalgan */
    align-items: flex-start;
    justify-content: center;
}

#card {
    position: relative;
    width: 663px;
    height: 996px;
    overflow: visible;
    background-color: #ffffff00;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start
}

/* Fondo de la carta */
.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #dddddd00;
    z-index: 0;
}

/* Iconos superpuestos */
.icon {
    position: absolute;
    width: 28px;
    height: 28px;
    z-index: 2;
}

.type-icon {
    width: 70px;
    height: 70px;
    z-index: 10;
}

.type-icon.center {
    width: 70px;
    height: 70px;
    top: -15px;
    right: 50%;
    transform: translateX(50%);
    z-index: 10;
    filter: drop-shadow(0px 3px 5px rgba(0, 0, 0, 0.5));
}

.type-icon.left {
    width: 120px;
    height: 120px;
    top: 3px;
    left: 7px;
    transform: translateX(0%);
    z-index: 10;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.5));
}

.type-icon.right {
    width: 120px;
    height: 120px;
    top: 3px;
    right: 7px;
    transform: translateX(0%);
    z-index: 10;
    filter: drop-shadow(-3px 3px 5px rgba(0, 0, 0, 0.5));
}

.clan-icon {
    width: 120px;
    height: auto;
    bottom: 200px;
    right: 90%;
    transform: translateX(50%);
    z-index: 5;
    /* image shadow, no "box" */
    filter: drop-shadow(5px -2px 10px rgba(0, 0, 0, 0.5));

}


/* Borde de la carta */
.border-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    pointer-events: none;
    z-index: 3;
    /* shadow from the image, not box */
    filter: drop-shadow(0px 12px 5px rgba(0, 0, 0, 0.558));
}

/* Imagen del usuario */
/* Contenedor de imagen: posición relativa y overflow oculto */
.user-image {
    position: relative;
    /* top: 20px; */
    /* left: 300px; */
    /* transform: translateX(-50%); */
    width: 88%;
    height: 75%;
    overflow: hidden;
    z-index: 1;
    margin: 5% auto;
    margin-bottom: 0;

}

.user-image img {
    position: absolute;
    top: 0;
    left: 0;
    /* Tamaño natural para permitir movimiento */
    width: auto;
    height: auto;
}

/* Controles de ajuste */
#adjustments-container {
    margin-bottom: 16px;
    padding: 0 8px;
}

.slider-group {
    margin: 8px 0;
}

.slider-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.slider-group input[type="range"] {
    width: 100%;
}

/* Título */

.card-text {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 84%;
    height: 14%;
    text-align: center;
    font-weight: bold;
    color: #333;
    z-index: 10;
    /* background-color: rgba(0, 0, 0, 0.273); */
    overflow: hidden;
    color: white;
    text-shadow: 3px 3px 1px rgb(0, 0, 0);
    margin-top: 3.5%;
}

.card-title {
    font-size: 2rem;
    line-height: 1.3;
    font-family: 'Delavan', sans-serif;
    z-index: 14;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    width: 90%;
    margin-top: .5rem;
    /* padding-inline: 3rem; */
}

/* Descripción */
.card-description {
    width: 92%;
    font-size: 1.5rem;
    font-family: 'Goudos', serif;
    line-height: 1.2;
    z-index: 4;
    text-align: center;
    overflow: hidden;
    word-break: break-word;
    white-space: pre-wrap;
    margin: 0;
    margin-top: .5rem;
    color: rgba(255, 255, 255, 0.731);
}

.text-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: -1;
}

.text-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;

}





.hidden {
    display: none;
}