/* =========================================================
   MIDNIGHT SOCIETY
   WEBSITE 2
   FINAL POLISHED CSS
========================================================= */


/* =========================================================
   RESET
========================================================= */

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

html {
  width: 100%;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background: #070c14;
  color: #ffffff;
  line-height: 1.5;
}


/* =========================================================
   GENERAL
========================================================= */

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  -webkit-appearance: none;
  appearance: none;
}

.hidden {
  display: none !important;
}


/* =========================================================
   COMMON FORM ELEMENTS
========================================================= */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 17px;
}

.form-group label,
.ticket-search label,
.filter-group label {
  color: #b7c0cd;
  font-size: 13px;
  font-weight: 600;
}

.form-group input,
.form-group select,
.ticket-search input,
.ticket-filters select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #263548;
  border-radius: 9px;
  outline: none;
  background: #0e1622;
  color: #ffffff;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.form-group input::placeholder,
.ticket-search input::placeholder {
  color: #697586;
}

.form-group input:focus,
.form-group select:focus,
.ticket-search input:focus,
.ticket-filters select:focus {
  border-color: #71829a;
  background: #111b29;
}

select {
  background-image:
    linear-gradient(
      45deg,
      transparent 50%,
      #aeb8c5 50%
    ),
    linear-gradient(
      135deg,
      #aeb8c5 50%,
      transparent 50%
    );
  background-position:
    calc(100% - 17px) 21px,
    calc(100% - 12px) 21px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}


/* =========================================================
   LOGIN PAGE
========================================================= */

#loginPage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(
      circle at top,
      #111c2b 0%,
      #080e17 42%,
      #05090f 100%
    );
}

.login-container {
  width: 100%;
  max-width: 430px;
  padding: 32px 24px;
  border: 1px solid #263548;
  border-radius: 18px;
  background: rgba(13, 21, 32, 0.96);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45);
}

.login-logo {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  border: 1px solid #2c3b4e;
  border-radius: 50%;
  background: #121d2b;
  font-size: 30px;
}

.login-container h1 {
  text-align: center;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.login-container > p {
  margin-top: 5px;
  margin-bottom: 28px;
  text-align: center;
  color: #8f9aaa;
  font-size: 14px;
}

#loginButton {
  width: 100%;
  min-height: 49px;
  margin-top: 4px;
  border: 0;
  border-radius: 9px;
  background: #ffffff;
  color: #07101b;
  font-size: 15px;
  font-weight: 750;
}

#loginButton:active {
  transform: scale(0.99);
}

#loginError {
  min-height: 20px;
  margin-top: 13px;
  color: #ff9090;
  text-align: center;
  font-size: 13px;
}


/* =========================================================
   ADMIN HEADER
========================================================= */

#adminHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 16px;
  border-bottom: 1px solid #202f41;
  background: rgba(7, 12, 20, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#adminHeader h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#menuToggle {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid #263548;
  border-radius: 9px;
  background: #0e1622;
  color: #ffffff;
  font-size: 21px;
}

#menuToggle:active {
  background: #172231;
}


/* =========================================================
   MENU OVERLAY
========================================================= */

#menuOverlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}


/* =========================================================
   SIDEBAR
========================================================= */

#sideMenu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  width: min(86vw, 300px);
  padding: 18px;
  overflow-y: auto;
  border-right: 1px solid #263548;
  background: #0a111c;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

#sideMenu.open {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid #202f41;
}

.menu-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a3a4d;
  border-radius: 50%;
  background: #121d2b;
  font-size: 19px;
}

.menu-header h2 {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
}

#closeMenu {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  border: 1px solid #263548;
  border-radius: 8px;
  background: #101a27;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

#closeMenu:active {
  background: #192536;
}


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

#adminNavigation {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.menu-button {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #b9c3d0;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}

.menu-button:hover {
  background: #111b29;
  color: #ffffff;
}

.menu-button.active {
  border-color: #2b3b4f;
  background: #ffffff;
  color: #07101b;
}


/* =========================================================
   ADMIN CONTENT
========================================================= */

#adminContent {
  width: 100%;
  min-height: 100vh;
  padding: 88px 16px 35px;
}

.admin-section {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.section-header p {
  margin-top: 5px;
  color: #7f8b9b;
  font-size: 14px;
}


/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.dashboard-card {
  min-height: 128px;
  padding: 20px;
  border: 1px solid #202f41;
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      #101a27,
      #0c141f
    );
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.15);
}

.dashboard-card h3 {
  margin-bottom: 13px;
  color: #8f9aaa;
  font-size: 13px;
  font-weight: 600;
}

.dashboard-card p {
  color: #ffffff;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.6px;
}

.recent-purchases {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #202f41;
  border-radius: 14px;
  background: #0d1622;
}

.recent-purchases h3 {
  margin-bottom: 16px;
  font-size: 17px;
}

#recentPurchasesList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#recentPurchasesList > p {
  color: #7f8b9b;
  font-size: 14px;
}


/* =========================================================
   TICKET MANAGEMENT
========================================================= */

.ticket-search {
  margin-bottom: 16px;
}

.ticket-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

#ticketList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#ticketList > p {
  color: #7f8b9b;
  font-size: 14px;
}


/* =========================================================
   TICKET CARDS
========================================================= */

.ticket-card-item {
  padding: 18px;
  border: 1px solid #202f41;
  border-radius: 13px;
  background:
    linear-gradient(
      145deg,
      #101a27,
      #0c141f
    );
}

.ticket-card-item h3 {
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.ticket-card-item p {
  margin-bottom: 6px;
  color: #8f9aaa;
  font-size: 13px;
}

.ticket-card-item p strong {
  color: #cbd3dd;
  font-weight: 600;
}

.ticket-card-item button {
  width: 100%;
  min-height: 43px;
  margin-top: 12px;
  border: 1px solid #2b3b4f;
  border-radius: 8px;
  background: #172332;
  color: #ffffff;
  font-size: 13px;
  font-weight: 650;
}

.ticket-card-item button:hover {
  background: #1c2a3c;
}


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

.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ticket-details-card,
.confirmation-card {
  width: 100%;
  max-width: 500px;
  padding: 24px;
  border: 1px solid #2a3b4f;
  border-radius: 15px;
  background: #0e1723;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.55);
}

.ticket-details-card {
  position: relative;
}

#closeTicketDetails {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 36px;
  height: 36px;
  border: 1px solid #263548;
  border-radius: 8px;
  background: #152131;
  color: #ffffff;
  font-size: 21px;
  line-height: 1;
}

.ticket-details-card h3,
.confirmation-card h3 {
  margin-bottom: 20px;
  padding-right: 40px;
  font-size: 19px;
}

#ticketDetailsContent {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 22px;
  padding: 15px;
  border: 1px solid #202f41;
  border-radius: 10px;
  background: #0a111b;
}

#ticketDetailsContent p {
  color: #aeb8c5;
  font-size: 13px;
  word-break: break-word;
}

#ticketDetailsContent strong {
  color: #e3e8ee;
}

#deleteTicketButton,
#confirmAction,
#saveSettingsButton {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #07101b;
  font-weight: 750;
}


/* =========================================================
   QR SCANNER
========================================================= */

#scannerSection {
  width: 100%;
}

#qrReader {
  width: 100%;
  max-width: 540px;
  min-height: 280px;
  margin: 0 auto 16px;
  overflow: hidden;
  border: 1px solid #263548;
  border-radius: 14px;
  background: #080e16;
}

#qrReader video {
  width: 100% !important;
  border-radius: 12px;
}

#qrReader__dashboard_section_csr button {
  border-radius: 7px !important;
}

.scanner-result {
  width: 100%;
  max-width: 540px;
  min-height: 80px;
  margin: 0 auto 14px;
  padding: 17px;
  border: 1px solid #202f41;
  border-radius: 11px;
  background: #0d1622;
}

.scanner-result p {
  color: #b9c3d0;
  font-size: 14px;
}

.scanner-result p strong {
  color: #ffffff;
}

#startScannerButton,
#stopScannerButton {
  width: 100%;
  max-width: 540px;
  min-height: 46px;
  display: block;
  margin: 8px auto;
  border: 1px solid #2a3b4f;
  border-radius: 8px;
  background: #162333;
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
}

#startScannerButton:hover,
#stopScannerButton:hover {
  background: #1c2b3d;
}


/* =========================================================
   SETTINGS
========================================================= */

#settingsForm {
  width: 100%;
  max-width: 720px;
}

#settingsMessage {
  min-height: 20px;
  margin-top: 12px;
  color: #aeb8c5;
  font-size: 13px;
}


/* =========================================================
   DANGER ZONE
========================================================= */

.danger-zone {
  width: 100%;
  max-width: 720px;
  margin-top: 35px;
  padding: 20px;
  border: 1px solid #4a3036;
  border-radius: 13px;
  background: #160f13;
}

.danger-zone h3 {
  margin-bottom: 7px;
  color: #ffb5b5;
  font-size: 17px;
}

.danger-zone p {
  margin-bottom: 17px;
  color: #a99399;
  font-size: 13px;
  line-height: 1.6;
}

#deleteAllTicketsButton {
  width: 100%;
  min-height: 46px;
  border: 1px solid #663b42;
  border-radius: 8px;
  background: #27151a;
  color: #ffb5b5;
  font-size: 14px;
  font-weight: 700;
}

#deleteAllTicketsButton:hover {
  background: #321a20;
}


/* =========================================================
   CONFIRMATION MODAL
========================================================= */

.confirmation-card p {
  margin-bottom: 22px;
  color: #aeb8c5;
  font-size: 14px;
  line-height: 1.6;
}

.confirmation-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#cancelConfirmation {
  min-height: 46px;
  border: 1px solid #29394d;
  border-radius: 8px;
  background: #172333;
  color: #ffffff;
  font-weight: 650;
}

#confirmAction {
  min-height: 46px;
}


/* =========================================================
   TABLET
========================================================= */

@media (min-width: 600px) {

  #adminContent {
    padding:
      92px
      24px
      40px;
  }

  .login-container {
    padding: 36px 32px;
  }

  .dashboard-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 15px;
  }

  .ticket-filters {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    max-width: 650px;
  }

  .ticket-card-item {
    padding: 20px;
  }

}


/* =========================================================
   LAPTOP / DESKTOP
========================================================= */

@media (min-width: 1000px) {

  #adminHeader {
    left: 285px;
    height: 70px;
    padding: 0 30px;
  }

  #adminHeader h1 {
    font-size: 19px;
  }

  #menuToggle {
    display: none;
  }


  /* Sidebar stays permanently visible */

  #sideMenu {
    width: 285px;
    transform: translateX(0);
    transition: none;
    padding: 22px 18px;
  }


  #menuOverlay {
    display: none !important;
  }


  #adminContent {
    width: calc(100% - 285px);
    margin-left: 285px;
    padding:
      100px
      34px
      50px;
  }


  .admin-section {
    max-width: 1320px;
  }


  .dashboard-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    gap: 16px;
  }


  .dashboard-card {
    min-height: 140px;
    padding: 22px;
  }


  .dashboard-card p {
    font-size: 30px;
  }


  .recent-purchases {
    padding: 22px;
  }


  .ticket-filters {
    grid-template-columns:
      repeat(2, 250px);
  }


  #ticketList {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .ticket-card-item {
    height: 100%;
  }


  #settingsForm,
  .danger-zone {
    max-width: 760px;
  }

}


/* =========================================================
   LARGE LAPTOP / DESKTOP
========================================================= */

@media (min-width: 1300px) {

  #adminContent {
    padding-left: 45px;
    padding-right: 45px;
  }

  #ticketList {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}


/* =========================================================
   SMALL PHONE
========================================================= */

@media (max-width: 380px) {

  #loginPage {
    padding: 14px;
  }

  .login-container {
    padding: 26px 18px;
    border-radius: 14px;
  }

  .login-container h1 {
    font-size: 23px;
  }

  #adminContent {
    padding-left: 13px;
    padding-right: 13px;
  }

  .section-header h2 {
    font-size: 22px;
  }

  .dashboard-card {
    padding: 16px;
  }

  .dashboard-card p {
    font-size: 25px;
  }

  .ticket-details-card,
  .confirmation-card {
    padding: 20px 17px;
  }

  .confirmation-buttons {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   TOUCH DEVICES
========================================================= */

@media (hover: none) {

  button:hover {
    background: inherit;
  }

  .menu-button.active:hover {
    background: #ffffff;
    color: #07101b;
  }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

}