/* ===========================
   GLOBAL RESET & BASE STYLES
   =========================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

body {
  background: linear-gradient(#f0f4f8, #d9e2ec);
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 10px;
  color: #333;
}

/* ===========================
   HEADER
   =========================== */
header h1,
header p {
  text-align: center;
}

header h1 {
  margin-bottom: 0.7em;
}

/* ===========================
   THEATER SCREEN STYLES
   =========================== */
.screen {
  background: linear-gradient(#444, #222);
  color: white;
  padding: 1.5rem;
  text-align: center;
  margin: 1rem auto;
  width: 80%;
  border-radius: 10px;
  transform: perspective(400px) rotateX(119deg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* ===========================
   SEAT MAP LAYOUT
   =========================== */

#seat-map {
  display: flex;
  gap: 40px;
  justify-content: center;
  padding: 20px;
}

/* ===========================
   SEAT STYLING
   =========================== */

.seat {
  width: 40px;
  height: 40px;
  border: 2px solid #333;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  background: #eee;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.seat.reserved {
  background: #b22222;
  cursor: not-allowed;
  color: #fff;
  border-color: #7f0000;
}

/* ===========================
   SELECT DROPDOWN
   =========================== */
#seat-section-select {
  display: none;
  margin: 1rem auto;
  padding: 0.5rem;
  font-size: 1rem;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  gap: 8px;
}

.seat.available:hover {
  background: #90ee90;
  border-color: #228b22;
  transform: scale(1.05);
}

.seat.available:focus {
  outline: 2px solid #006400;
  outline-offset: 2px;
}

#seat-layout-image {
  display: none;
  width: 100%;
  max-width: 500px;
  margin-top: 1rem;
}

#layout-disclaimer {
  display: none;
}

#layout-disclaimer strong {
  color: red;
}

/* ===========================
   MODALS
   =========================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.modal-content {
  background: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-family: "Inter", sans-serif;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.hidden {
  display: none;
}

.modal-content p {
  margin-bottom: 1.2rem;
  color: #333;
  font-size: 1rem;
}

.modal-content strong {
  color: #e8c21a;
}

/* ===========================
   FORMS
   =========================== */
#user-name {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  transition: border-color 0.2s;
}
#user-name:focus {
  border-color: #1a73e8;
  outline: none;
}

/* ===========================
   BUTTONS
   =========================== */

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #111;
}

#confirm-booking {
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}
#confirm-booking:hover {
  background-color: #0f5ec2;
}

/* ===========================
   RESPONSIVE (MOBILE)
   =========================== */

@media (max-width: 768px) {
  html,
  body {
    min-height: 100vh;
  }

  #seat-map {
    flex-direction: column;
    gap: 20px;
    padding: 5px;
  }

  .screen {
    display: none;
  }

  #theater-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #seat-layout-image {
    display: flex;
    height: 80%;
    width: 80%;
    align-content: center;
    margin-bottom: 1em;
  }

  #layout-disclaimer {
    display: block;
    text-align: center;
  }

  .row {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .seat {
    width: 4em;
    height: 4em;
    font-size: 0.5rem;
    margin: 2px;
  }

  #seat-section-select {
    display: block;
  }

  .column {
    display: none;
  }

  #seat-map.show-left #left-column,
  #seat-map.show-center #center-column,
  #seat-map.show-right #right-column {
    display: flex;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }
}
