/* ===== Basic Body Setup ===== */
body {
  background-image: url('background.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  height: 100vh;
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  position: relative;
}

/* ===== Container ===== */
.container {
  text-align: center;
  padding: 50px;
  z-index: 1;
}

/* ===== Logo ===== */
.logo {
  width: 300px;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeIn 2s forwards;
}

/* ===== Description Text ===== */
.description-text {
  font-size: 20px;
  font-weight: bold;
  color: black;
  max-width: 1000px;
  margin: 20px auto 40px;
  opacity: 0;
  animation: fadeIn 2s forwards;
}

/* ===== Keyframes ===== */
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes slideDown {
  0% { opacity: 0; transform: translate(-50%, -52%); }
  100% { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes fadeOutModal {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* ===== Video Section ===== */
.video-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
}
.tutorial-video iframe {
  border-radius: 15px;
  border: 2px solid white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  margin-top: 20px;
  pointer-events: auto;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.tutorial-video iframe:hover {
  border: 2px solid red;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.7);
}

/* ===== Main Button ===== */
.compile-avatar-button .compile-button {
  font-family: 'Arial', sans-serif;
  padding: 20px 50px;
  font-size: 28px;
  font-weight: bold;
  color: white;
  background-color: black;
  border: none;
  border-radius: 8px;
  transition: 0.3s;
  margin-left: 80px !important;
}
.compile-avatar-button .compile-button:hover {
  background-color: #333;
  transform: scale(1.05);
}

/* ===== Footer Buttons ===== */
.footer-buttons {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 1;
}
.footer-btn {
  background: white;
  color: black;
  font-weight: bold;
  padding: 12px 25px;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}
.footer-btn:hover {
  transform: scale(1.1);
  background-color: #f0f0f0;
}

/* ===== Modals ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ===== Modal Content ===== */
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  color: black;
  text-align: center;
  animation: slideDown 0.5s ease forwards;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.modal-content.compile-modal-glow {
  box-shadow: 0 0 16px 4px #fff, 0 0 32px 8px rgba(255,255,255,0.15);
}
.modal-content.fade-out {
  animation: fadeOutModal 0.5s forwards;
}
.modal-content h2 {
  font-size: 28px;
  margin-bottom: 15px;
}
.modal-content p {
  font-size: 16px;
}

/* ===== Close Button ===== */
.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
}
.close:hover { color: red; }

/* ===== Modal Textarea (restored to original) ===== */
textarea {
  width: 90%;
  height: 150px;
  border-radius: 8px;
  padding: 20px;
  font-size: 1rem;
  margin: 0 auto 20px;
  display: block;
  box-sizing: border-box;
}

/* ===== Modal Buttons ===== */
.modal-content button {
  font-size: 24px;
  padding: 20px 50px;
  background: black;
  color: white;
  border: none;
  border-radius: 8px;
  margin: 20px auto 0 auto;
  cursor: pointer;
  transition: 0.3s;
}
.modal-content button:hover {
  background-color: #333;
}

/* ===== Roblox Loader Animation ===== */
.roblox-loader {
  display: inline-block;
  position: relative;
  width: 40px;
  height: 14px;
  margin: 0 auto;
}

.roblox-loader div {
  position: absolute;
  top: 0;
  width: 10px;
  height: 10px;
  background: gray;
  border-radius: 2px;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.roblox-loader div:nth-child(1) {
  left: 0;
  animation: roblox-loader1 0.6s infinite;
}

.roblox-loader div:nth-child(2) {
  left: 15px;
  animation: roblox-loader2 0.6s infinite;
}

.roblox-loader div:nth-child(3) {
  left: 30px;
  animation: roblox-loader3 0.6s infinite;
}

@keyframes roblox-loader1 {
  0% { transform: scale(0); background: gray; }
  50% { transform: scale(1); background: white; }
  100% { transform: scale(0); background: gray; }
}

@keyframes roblox-loader2 {
  0% { transform: scale(1) translateX(0); background: gray; }
  50% { transform: scale(1.2) translateX(3px); background: white; }
  100% { transform: scale(1) translateX(0); background: gray; }
}

@keyframes roblox-loader3 {
  0% { transform: scale(1); background: gray; }
  50% { transform: scale(0); background: white; }
  100% { transform: scale(1); background: gray; }
}

/* ===== Loading Spinner Overlay ===== */
#loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 64px;
  height: 64px;
  border: 8px solid #f3f3f3;
  border-top: 8px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-message {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0;
  letter-spacing: 1px;
}

/* ===== Alert Box ===== */
.alert-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  display: none;
  opacity: 1;
  transition: opacity 0.5s;
}
.error-alert {
  background: #ff3333;
  color: white;
}