/* ====== RESET & BASE ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* BACKGROUND */
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  display: flex;
  flex-direction: column;
}

/* ====== NAVBAR ====== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  font-size: 1.75rem;
  line-height: 1;
}

.brand {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon {
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

.icon:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.95);
}

@media (hover: hover) {
  .icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
  }
}

.nav-link {
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.nav-link:active {
  background: rgba(99, 102, 241, 0.2);
}

.admin-text {
  display: none;
}

@media (min-width: 768px) {
  .admin-text {
    display: inline !important;
  }
}

@media (hover: hover) {
  .nav-link:hover {
    background: rgba(99, 102, 241, 0.2);
  }
}

/* ====== MAIN CONTENT ====== */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

/* CONTAINER */
.container {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
}

/* TITLE */
.title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: fadeIn 1s ease;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

/* ====== CARDS ====== */
.card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 1s ease;
}

#reader video {
  border-radius: 12px;
  width: 100%;
  height: auto;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  }
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* CARD CONTENT */
.card-content {
  padding: 1.5rem;
  text-align: center;
}

.card-content h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.card-content p {
  color: #cbd5f5;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* ====== BUTTONS ====== */
button {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  transition: all 0.3s ease;
  font-weight: 500;
  min-height: 2.75rem;
  touch-action: manipulation;
}

button:active {
  transform: scale(0.98);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

@media (hover: hover) {
  button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
  }
}

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

/* ====== INPUTS & SELECTS ====== */
input,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

input::placeholder,
select:invalid {
  color: #cbd5f5;
}

input:focus,
select:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select option {
  background: rgba(0, 0, 0, 0.8);
  color: white;
}

/* ====== TICKET CARD ====== */
.ticket-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.8s ease;
  max-width: 500px;
}

.ticket-card h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.sub {
  color: #cbd5f5;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* QR BOX */
.qr-box {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  display: inline-block;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

.qr-box canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* TICKET ID & NAME */
.ticket-id {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 1rem;
  word-break: break-all;
}

.user-name {
  margin-top: 0.5rem;
  font-weight: 500;
  font-size: 1.1rem;
}

/* STATUS */
.status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: bold;
  font-size: 0.95rem;
}

.status.valid {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== RESPONSIVE DESIGN ====== */

/* Tablets - 768px and up */
@media (min-width: 768px) {
  main {
    padding: 2rem 1rem;
  }

  .container {
    max-width: 600px;
    padding: 2rem;
  }

  .card-content {
    padding: 2rem;
  }

  .ticket-card {
    padding: 2.5rem;
  }

  .navbar {
    padding: 1.25rem 2rem;
    gap: 2rem;
  }

  .card-content p {
    font-size: 1rem;
  }
}

/* Desktops - 1024px and up */
@media (min-width: 1024px) {
  main {
    padding: 3rem 1rem;
  }

  .container {
    max-width: 700px;
    padding: 3rem;
  }

  .card-content {
    padding: 2.5rem;
  }

  .ticket-card {
    padding: 3rem;
  }

  button {
    margin-top: 0.5rem;
  }

  .navbar {
    padding: 1.5rem 3rem;
  }
}

/* Large Desktops - 1440px and up */
@media (min-width: 1440px) {
  .container {
    max-width: 800px;
  }

  main {
    padding: 4rem 2rem;
  }
}

/* Small phones - under 360px */
@media (max-width: 359px) {
  .container {
    padding: 0.75rem;
  }

  .card-content {
    padding: 1rem;
  }

  .title {
    margin-bottom: 1rem;
  }

  .navbar {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .brand {
    font-size: 1rem;
  }
}

/* Landscape orientation optimization */
@media (orientation: landscape) and (max-height: 600px) {
  main {
    padding: 1rem;
  }

  .container,
  .ticket-card {
    padding: 1rem;
  }

  .title {
    margin-bottom: 0.5rem;
  }

  .card-content {
    padding: 1rem;
  }

  button {
    min-height: 2.5rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .navbar,
  .title,
  button {
    display: none;
  }

  .ticket-card,
  .card {
    box-shadow: none;
    background: white;
    color: black;
  }
}