/* Variable Definitions - Dark Chocolate Theme */
:root {
  --bg: #0D0806; /* Deep Espresso */
  --bg-secondary: #1A1210; /* Dark Cocoa */
  --bg-tertiary: #2A1F1C; /* Milk Chocolate Dark */
  --fg: #F5E6D3; /* Cream */
  --muted: #9A8B7C; /* Latte */
  --muted-secondary: #1A1210;
  --accent: #C9979B; /* Muted Rose */
  --accent-dark: #A66F72;
  --accent-dark-secondary: #1A1210;
  --accent-light: #F8BBD0;
  --accent-gold: #D4AF37; /* Gold accent for stars */
  --card: rgba(26, 18, 16, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --success: #6B8E6B;
  --warning: #D4A574;
  --danger: #B56565;
  --info: #7CA4C9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
}

/* Background Effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 50% 0%, rgba(201, 151, 155, 0.05) 0%, transparent 60%);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.sidebar-logo svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
}

.sidebar-logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  color: var(--muted);
}

.nav-item:hover {
  background: rgba(201, 151, 155, 0.1);
  color: var(--fg);
}

.nav-item.active {
  background: rgba(201, 151, 155, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Main Content */
.main-content {
  margin-left: 260px;
  padding: 24px 32px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}

/* Stat Cards */
.stat-card {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold));
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 8px 0;
}

.stat-label {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(201, 151, 155, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(181, 101, 101, 0.2);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(181, 101, 101, 0.3);
}

.btn-success {
  background: rgba(107, 142, 107, 0.2);
  color: var(--success);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* Form Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 151, 155, 0.1);
}

.form-input::placeholder {
  color: var(--muted);
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239A8B7C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 0.875rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--fg);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: rgba(0,0,0,0.2);
  border-radius: 0 0 20px 20px;
}

/* Status Badges */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-pending { background: rgba(212, 165, 116, 0.15); color: var(--warning); }
.badge-confirmed { background: rgba(124, 164, 201, 0.15); color: var(--info); }
.badge-done { background: rgba(107, 142, 107, 0.15); color: var(--success); }
.badge-cancel { background: rgba(181, 101, 101, 0.15); color: var(--danger); }

.badge-bronze { background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%); color: white; }
.badge-silver { background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%); color: #333; }
.badge-gold { background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%); color: #1a1a1a; }

/* Progress Bar */
.progress-container { margin-top: 8px; }
.progress-bar { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-fill.bronze { background: linear-gradient(90deg, #cd7f32, #8b4513); }
.progress-fill.silver { background: linear-gradient(90deg, #c0c0c0, #808080); }
.progress-fill.gold { background: linear-gradient(90deg, #ffd700, #b8860b); }

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-header {
  text-align: center;
  padding: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  position: relative;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.calendar-day:hover {
  background: rgba(201, 139, 142, 0.1);
  border-color: var(--border);
}

.calendar-day.today {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.calendar-day.has-booking::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: var(--accent-gold);
  border-radius: 50%;
}

.calendar-day.today.has-booking::after {
  background: var(--bg);
}

.calendar-day.other-month {
  color: rgba(154, 139, 124, 0.5);
}

/* Search */
.search-box { position: relative; }
.search-box input { padding-left: 40px; }
.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 18px;
  height: 18px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s ease;
  min-width: 300px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
  border: 1px solid var(--border);
}

.tab {
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tab:hover { color: var(--fg); }

.tab.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-header { display: flex !important; }
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.hamburger {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 8px;
}

/* Animations */
.stagger-item {
  animation: staggerIn 0.5s ease forwards;
  opacity: 0;
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Recommendations */
.recommendation-card {
  background: rgba(201, 139, 142, 0.08);
  border: 1px solid rgba(201, 139, 142, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

/* Tier Cards */
.tier-card { transition: transform 0.2s; }
.tier-card:hover { transform: translateY(-2px); }


/* Voucher Card */
.voucher-card {
	border: 1px dashed var(--accent);
	background: rgba(255, 255, 255, 0.5);
	border-radius: 12px;
	padding: 16px;
	position: relative;
	transition: transform 0.2s;
}

.voucher-card:hover {
	transform: translateY(-2px);
}

.voucher-card .type {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--accent-dark-secondary);
	font-weight: 700;
}

.voucher-card .value {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--fg);
	margin: 8px 0;
}

.voucher-card .validity {
	font-size: 0.75rem;
	color: var(--muted-secondary);
}

.voucher-card .status-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	font-size: 0.6rem;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--success);
	color: white;
}

.voucher-card .status-badge.expired {
	background: var(--danger);
}

/* Journey Progress */
.journey-container {
	display: flex;
	justify-content: space-between;
	position: relative;
	margin: 20px 0;
}

.journey-container::before {
	content: '';
	position: absolute;
	top: 15px;
	left: 0;
	width: 100%;
	height: 4px;
	background: #eee;
	z-index: 0;
}

.journey-step {
	position: relative;
	z-index: 1;
	background: white;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #eee;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: bold;
	color: var(--muted);
}

.journey-step.filled {
	border-color: var(--accent);
	background: var(--accent);
	color: white;
}

.journey-step.reward {
	border: 2px solid var(--accent-dark);
	color: var(--accent-dark);
	font-size: 1rem;
}

/* Spin Wheel */
.wheel-container {
	position: relative;
	width: 250px;
	height: 250px;
}

.wheel {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 8px solid var(--accent-light);
	position: relative;
	overflow: hidden;
	transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
	background: conic-gradient(#EC407A 0deg 60deg,
			#F8BBD0 60deg 120deg,
			#D81B60 120deg 180deg,
			#FCE4EC 180deg 240deg,
			#FF80AB 240deg 300deg,
			#AD1457 300deg 360deg);
}

.wheel-segment {
	position: absolute;
	width: 50%;
	height: 50%;
	top: 0;
	right: 0;
	transform-origin: bottom left;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	font-weight: bold;
	color: white;
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.wheel-pointer {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 15px solid transparent;
	border-right: 15px solid transparent;
	border-top: 30px solid var(--accent-dark);
	z-index: 10;
}

.wheel-center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	background: white;
	border-radius: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	color: var(--accent);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
