:root {
  /* Brand Colors */
  --primary: #8223d2;
  --primary-hover: #590099;
  --accent: #aa55f0;

  /* Light Mode Defaults */
  --bg-color: #f8f9fa;
  --text-color: #1a1a1a;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(255, 255, 255, 0.4);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --modal-overlay: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
  --bg-color: #0f0f13;
  --text-color: #f0f0f0;
  --card-bg: rgba(30, 30, 35, 0.85);
  --card-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  flex: 1;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding: 0 1rem;
  /* Add padding to prevent edge touches */
}

#admin-toggle-btn {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#admin-toggle-btn:hover {
  opacity: 1;
}

/* Typography */
h1 {
  font-weight: 800;
  letter-spacing: -0.05rem;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  margin-bottom: 1rem;
}

/* Glassmorphism Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Grid for Dashboard */
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Buttons */
.kiosk-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 160px;
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: 16px;
  color: var(--text-color);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  padding: 1rem;
}

.kiosk-btn:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(130, 35, 210, 0.25);
  color: var(--primary);
}

.kiosk-btn.primary {
  background: var(--primary);
  color: white;
  border: none;
}

.kiosk-btn.primary:hover {
  background: var(--primary-hover);
  color: white;
}

/* Admin Styles */
.admin-panel {
  display: none;
  /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: var(--bg-color);
  overflow-y: auto;
  padding: 2rem;
}

.admin-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
select,
textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  /* Slightly transparent */
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(130, 35, 210, 0.2);
}

/* Admin Buttons */
.admin-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
}

.admin-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.admin-btn.primary {
  background: var(--primary);
  color: white;
  border: none;
}

.admin-btn.primary:hover {
  background: var(--primary-hover);
}

.admin-btn.danger {
  background: #ff4757;
  color: white;
  border: none;
}

.admin-btn.danger:hover {
  background: #ff6b81;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 3000;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(26px);
}