/* ========================================
   Workshop Ticket System — Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
  --primary: #C40000;
  --primary-dark: #9B0000;
  --primary-light: #FF2D2D;
  --secondary: #FFFFFF;
  --accent: #111111;
  --bg: #F8F8F8;
  --bg-card: #FFFFFF;
  --border: #E5E5E5;
  --text: #333333;
  --text-light: #777777;
  --text-muted: #AAAAAA;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --transition: all 0.3s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1200px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--accent);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

/* ========================================
   Navbar
   ======================================== */
.navbar {
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

.navbar__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.navbar__menu {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.navbar__menu a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  color: var(--text);
}

.navbar__menu a:hover {
  background: var(--bg);
  color: var(--primary);
}

.navbar__logout {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: var(--transition);
}

.navbar__toggle--active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.navbar__toggle--active span:nth-child(2) {
  opacity: 0;
}
.navbar__toggle--active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: white;
}
.btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196,0,0,0.3);
}

.btn--outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn--outline:hover {
  background: var(--primary);
  color: white;
}

.btn--secondary {
  background: var(--accent);
  color: white;
}
.btn--secondary:hover {
  background: #333;
}

.btn--success {
  background: var(--success);
  color: white;
}

.btn--danger {
  background: var(--danger);
  color: white;
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.card__body {
  padding: 20px;
}

.card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card__text {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card__price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.card__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--accent);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--secondary);
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,0,0,0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23777' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ========================================
   Grid
   ======================================== */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ========================================
   Hero Slider
   ======================================== */
.hero-slider {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
}

.hero-slider__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-slider__slide--active {
  opacity: 1;
}

.hero-slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.55) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.hero-slider__overlay h2 {
  color: white;
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
  letter-spacing: -0.5px;
}

.hero-slider__overlay p {
  color: rgba(255,255,255,0.92);
  font-size: 1.15rem;
  max-width: 560px;
  margin-bottom: 28px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

.hero-slider__overlay .btn {
  font-size: 1.05rem;
  padding: 14px 36px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(196,0,0,0.35);
}

.hero-slider__overlay .btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(196,0,0,0.45);
}

/* Slider Dots */
.hero-slider__dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.hero-slider__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: 2px solid rgba(255,255,255,0.7);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.hero-slider__dot--active {
  background: white;
  transform: scale(1.2);
}

/* Slider Arrows */
.hero-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.hero-slider__arrow:hover {
  background: rgba(255,255,255,0.35);
}

.hero-slider__arrow--prev { left: 16px; }
.hero-slider__arrow--next { right: 16px; }

/* ========================================
   Section
   ======================================== */
.section {
  padding: 60px 0;
}

.section__title {
  text-align: center;
  margin-bottom: 40px;
}

.section__title h2 {
  margin-bottom: 8px;
}

.section__title p {
  color: var(--text-light);
  font-size: 1.05rem;
}

/* ========================================
   Badge
   ======================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--pending {
  background: #FEF3C7;
  color: #92400E;
}

.badge--approved {
  background: #D1FAE5;
  color: #065F46;
}

.badge--cancelled {
  background: #FEE2E2;
  color: #991B1B;
}

.badge--used {
  background: #DBEAFE;
  color: #1E40AF;
}

/* ========================================
   Table
   ======================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table tr:hover td {
  background: #FAFAFA;
}

.table .actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* ========================================
   Stats Cards
   ======================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.stat-card__label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-card--primary .stat-card__value { color: var(--primary); }
.stat-card--success .stat-card__value { color: var(--success); }
.stat-card--warning .stat-card__value { color: var(--warning); }
.stat-card--info .stat-card__value { color: var(--info); }

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal__header h3 {
  font-size: 1.25rem;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-light);
  transition: var(--transition);
}

.modal__close:hover {
  background: var(--bg);
  color: var(--accent);
}

.modal__footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ========================================
   Toast
   ======================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.toast--visible {
  transform: translateY(0);
  opacity: 1;
}

.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--info { background: var(--info); }
.toast--warning { background: var(--warning); }

/* ========================================
   Page Header
   ======================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.75rem;
}

/* ========================================
   Filters
   ======================================== */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filters .form-control {
  width: auto;
  min-width: 180px;
}

/* ========================================
   Category Selector
   ======================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.category-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.category-card:hover {
  border-color: var(--primary);
}

.category-card.active {
  border-color: var(--primary);
  background: #FFF5F5;
}

.category-card__icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.category-card__price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
}

/* ========================================
   Participant Counter
   ======================================== */
.counter {
  display: flex;
  align-items: center;
  gap: 16px;
}

.counter__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  transition: var(--transition);
  background: var(--bg-card);
}

.counter__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.counter__value {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

/* ========================================
   Summary Box
   ======================================== */
.summary {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}

.summary__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
}

.summary__row--total {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}

.summary__row--total span:last-child {
  color: var(--primary);
  font-size: 1.25rem;
}

/* ========================================
   Success Page
   ======================================== */
.success-box {
  text-align: center;
  max-width: 500px;
  padding: 16px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.success-box__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #D1FAE5;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
}

/* Reservation Summary Table */
.res-summary {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  text-align: left;
  font-size: 0.9rem;
}

.res-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.res-summary__row:last-child {
  border-bottom: none;
}

.res-summary__row--highlight {
  background: var(--bg);
}

.res-summary__row--total {
  background: var(--bg);
  font-weight: 700;
  font-size: 1rem;
}

.res-summary__row--total .res-summary__value {
  color: var(--primary);
  font-size: 1.1rem;
}

.res-summary__label {
  color: var(--text-light);
  flex-shrink: 0;
}

.res-summary__value {
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* ========================================
   QR Scanner
   ======================================== */
.scanner-container {
  max-width: 500px;
  margin: 0 auto;
}

.scanner-video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

.scanner-result {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  margin-top: auto;
  background: var(--accent);
  color: rgba(255,255,255,0.6);
  padding: 32px 0 20px;
  font-size: 0.85rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
  align-items: start;
}

.footer__link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.footer__link:hover {
  color: white;
}

.footer__social {
  display: flex;
  gap: 12px;
}

.footer__social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
}

.footer__social-link--ig {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.footer__social-link--wa {
  background: #25D366;
}

.footer__social-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.footer__copy {
  text-align: center;
}

/* Floating WhatsApp Button */
.fab-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  z-index: 999;
  transition: var(--transition);
  animation: fab-pulse 2s ease-in-out infinite;
}

.fab-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}

@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,0.4); }
  50% { box-shadow: 0 4px 24px rgba(37,211,102,0.6); }
}

/* ========================================
   Loading
   ======================================== */
.loading {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  
  .hero-slider { height: 380px; }
  .hero-slider__overlay h2 { font-size: 1.8rem; }
  .hero-slider__overlay p { font-size: 0.95rem; }
  .hero-slider__arrow { display: none; }
  
  .section { padding: 40px 0; }
  
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .navbar__toggle {
    display: flex;
  }

  .navbar__menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--secondary);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .navbar__menu--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar__menu a {
    padding: 12px 16px;
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table th, .table td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .modal {
    width: 95%;
    padding: 24px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }

  .footer__social {
    justify-content: center;
  }

  .fab-whatsapp {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
