body, html {
    background: #1a1539;
    color: white;
    font-family: "Nunito", sans-serif;
    margin: 0;
    padding: 0;
}

.navbar {
    margin-top: 20px;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 65px;
}

.nav-button-container {
    width: 150px; /* Fixed width to prevent shifting */
    display: flex;
    justify-content: center;
}

.nav-center {
    display: flex;
    justify-content: center;
}

.navbar ul {
    list-style: none;
    margin: 0 15px;
    padding: 0;
    display: flex;
    justify-content: center;
}

.navbar ul li {
    margin: 0 15px;
}

.navbar ul li a {
    cursor: default;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 15px;
    position: relative;
    transition: color 0.3s;
    pointer-events: none;
    opacity: .5;
}

.navbar ul li a::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 2px;
    background-color: transparent;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    transition: width 0.3s, background-color 0.3s;
}

.navbar ul li a.active {
    opacity: 1;
}

.navbar ul li a:hover::after,
.navbar ul li a.active::after {
    width: 50%;
    background-color: #4b4bff;
}

.nav-button {
    color: #ffffff;
    font-weight: 600;
    border-radius: 10px;
    padding: 15px 35px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border: none;
}

#back-button {
    background-color: rgba(64, 64, 160, 0.77);
}

#next-button {
    background-color: #1589c3;
}

#back-button:hover {
    background-color: rgba(100, 100, 200, 0.9);
}

#next-button:hover {
    background-color: #1ba1e2;
}

.box {
    position: relative;
    overflow: hidden;
    width: 96%;
    max-width: 660px;
    margin: 40px auto;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 32px;
    box-sizing: border-box;
}

canvas {
    display: block;
}

.message {
    display: block;
    padding: 16px;
    background: #c2c2ff;
    border: 3px solid #4b4bff;
    color: #10106e;
    margin-top: 20px;
    border-radius: 6px;
}

.message.error {
    background: #ffeaea;
    border-color: #ff4b4b;
    color: #5e0000;
}

#process {
    position: relative;
    overflow: hidden;
}
#process video {
    position: absolute;
    top: 150%;
    left: 150%;
}

#process canvas {
    position: absolute;
    top: 150%;
    left: 150%;
}

#process img {
    width: 240px;
    max-width: 75%;
    height: auto;
    margin: 0 auto 40px;
    display: block;
}

#preview canvas {
    margin: 0 auto;
}

#play {
    display: none;
    position: relative;
    overflow: hidden;
}

.model-selection {
    margin: 30px 0px;
    display: flex;
    justify-content: center;
    gap: 70px;
}

.model-selection img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, border 0.3s ease;
}

.model-selection img:hover {
    transform: scale(1.25);
}

.model-selection img.active {
    border: 2px solid #4b4bff;
    transform: scale(1.4);
}


#play:before {
    content: "";
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('/assets/bg.jpg');
    opacity: .05;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

#play canvas {
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Media Queries */
@media only screen and (max-width: 1024px) {
    .navbar ul {
        flex-direction: row;
    }

    .navbar ul li {
        margin: 10px 0;
    }

    .model-selection {
        flex-direction: row;
        gap: 30px;
    }

    #play {
        height: 80vh;
    }

    .box {
        width: 90%;
        max-width: none;
        margin: 20px auto;
    }

    .nav-button-container {
        width: 40px;
        padding: 0 10px;
    }

    .nav-button {
        padding: 13px 20px;
    }

}


/* Replay Button */

#replay-button {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: red;
  color: white;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 8px;
  opacity: 0; /* Initially hidden */
  transition: opacity 0.3s ease; /* Smooth transition for showing/hiding */
}

#replay-button.visible {
  display: block;
  opacity: 1; /* Visible state */
}

#replay-button:hover {
  background-color: #555;
}
