/* style.css */
:root {
    --primary-color: #4A90E2; /* Friendly Blue */
    --accent-color: #FFB03A; /* Friendly Orange */
    --success-color: #2ECC71; /* Green */
    --danger-color: #E74C3C; /* Red */
    --bg-color: #FDFBF7; /* Warm white */
    --text-color: #333333;
    --wood-color: #D4A373;
    --wood-dark: #A67C52;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background-image: url('img/Ristorante.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* HEADER STATS */
.stats-bar {
    background-color: rgba(166, 124, 82, 0.8); /* var(--wood-dark) transparente */
    backdrop-filter: blur(5px);
    color: white;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    z-index: 10;
}

/* MAIN CONTAINER & SCREENS */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 5;
}

.screen {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    text-align: center;
    transition: opacity 0.3s ease;
    border: 3px solid var(--wood-color);
    max-height: 85vh;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.warning-text {
    color: var(--danger-color);
    font-weight: 700;
}

/* FORMULARIOS */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.peso-group label {
    color: var(--danger-color);
}

/* BOTONES */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-primary { background-color: var(--primary-color); color: white; }
.btn-success { background-color: var(--success-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }

/* PUERTAS */
.door-container {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.door {
    width: 150px;
    height: 200px;
    border: 8px solid var(--wood-dark);
    border-radius: 10px;
    background-color: var(--wood-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.door:hover {
    transform: scale(1.05);
}

.door-panel {
    background: rgba(255,255,255,0.9);
    width: 80%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333;
    border-radius: 5px;
    position: absolute;
    top: 20px;
    font-weight: 900;
    font-size: 0.9rem;
}

.door-vet { background-color: #E0F7FA; border-color: #00BCD4; }
.door-carne { background-color: #FFEBEE; border-color: #F44336; }

/* Efecto glitch */
.glitch {
    background-color: var(--danger-color) !important;
    border-color: #8B0000 !important;
}
.glitch .door-panel {
    background: black;
    color: red;
    transform: rotate(5deg);
}

/* RESULTADOS */
#ticketText {
    background: #fdf5e6;
    border: 1px dashed #ccc;
    padding: 15px;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
    margin-bottom: 20px;
    max-height: 250px;
    overflow-y: auto;
}

/* CINTA TRANSPORTADORA REINVENTADA */
.map-container {
    height: 220px;
    background: transparent;
    position: relative;
    overflow: hidden;
    z-index: 10;
    margin-top: 10px;
}

.conveyor-belt {
    position: absolute;
    height: 60px;
    background: var(--wood-dark);
    padding: 8px 0;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    z-index: 1;
}

.belt-main {
    top: 50%;
    left: -5%; 
    width: 76%; 
    transform: translateY(-50%);
    border-radius: 0 10px 10px 0;
}

.belt-vet {
    top: 50%;
    left: 70%;
    transform-origin: left center;
    border-radius: 10px;
}

.belt-carne {
    top: 50%;
    left: 70%;
    transform-origin: left center;
    border-radius: 10px;
}

.conveyor-track {
    width: 100%;
    height: 100%;
    background-color: #333; 
    background-image: repeating-linear-gradient(
        90deg,
        #222,
        #222 20px,
        #333 20px,
        #333 40px
    );
    animation: moveBelt 1.5s linear infinite;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

@keyframes moveBelt {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}

.node {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #FF5722;
    border: 4px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    z-index: 2;
}

.node span {
    position: absolute;
    top: 45px;
    color: #333;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255,255,255,0.8);
    padding: 2px 5px;
    border-radius: 5px;
}

.node-vet { background: #00BCD4; }
.node-carne { background: #F44336; }

/* EL AVATAR ANIMADO (FOTO DEL ANIMAL) */
.avatar {
    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%); /* Centro alineado con el nodo */
    transition: left 0.8s ease-in-out, top 0.8s ease-in-out;
    z-index: 20;
    pointer-events: none; /* Para no bloquear clicks */
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: normal; 
    /* Efecto de salto al moverse */
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0) scale(2.2); }
    to { transform: translateY(-10px) scale(2.2); }
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-box {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    border: 4px solid var(--danger-color);
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}
