@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #edf4f9;
  --bg-secondary: #fdfefe;
  --card-bg: #ffffff;
  --card-border: rgba(68, 77, 142, 0.12);
  --text-main: #343b6e;
  --text-muted: #6f8cc8;
  --primary-color: #444D8E; /* Huisstijl Diepblauw */
  --secondary-color: #BC2474; /* Huisstijl Magenta */
  --accent-color: #4F72B2; /* Huisstijl Middenblauw */
  --light-blue: #6F8CC8; /* Huisstijl Lichtblauw */
  
  --btn-gradient: linear-gradient(135deg, #BC2474 0%, #E371A3 100%);
  --btn-gradient-hover: linear-gradient(135deg, #a01e62 0%, #bc2474 100%);
  --accent-gradient: linear-gradient(135deg, #444D8E 0%, #BC2474 100%);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.25);
  
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.08);
  --error-border: rgba(239, 68, 68, 0.2);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --warning-border: rgba(245, 158, 11, 0.2);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: #40B8E8;
  background-image: url('../images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Header & Logos */
header {
  text-align: center;
  margin-bottom: 25px;
  animation: fadeIn 0.8s ease-out;
}

.logo-image {
  max-width: 280px;
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(68, 77, 142, 0.1));
}

.subtitle {
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
  max-width: 480px;
  margin: 0 auto;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.45);
}

/* Premium Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 40px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 15px 35px rgba(68, 77, 142, 0.08);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--btn-gradient);
}

/* Mascot Display in Card */
.mascot-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.mascot-image {
  max-height: 120px;
  width: auto;
  filter: drop-shadow(0 6px 12px rgba(68, 77, 142, 0.12));
  animation: gentleFloat 4s ease-in-out infinite alternate;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  font-size: 1.2rem;
  pointer-events: none;
}

input[type="email"],
input[type="text"],
input[type="password"] {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid rgba(68, 77, 142, 0.15);
  border-radius: 14px;
  padding: 16px 16px 16px 52px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(227, 113, 163, 0.15);
  background: #ffffff;
}

/* Buttons */
.btn {
  width: 100%;
  background: var(--btn-gradient);
  border: none;
  border-radius: 14px;
  padding: 16px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(188, 36, 116, 0.25);
}

.btn:hover {
  background: var(--btn-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(188, 36, 116, 0.35);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #ffffff;
  border: 1.5px solid rgba(68, 77, 142, 0.25);
  color: var(--primary-color);
  box-shadow: none;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(68, 77, 142, 0.08);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s ease infinite;
}

/* Alerts & Status Boxes */
.alert {
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeIn 0.4s ease;
  text-align: left;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #065f46;
}

.alert-danger {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #92400e;
}

/* Voucher/Code Container */
.voucher {
  background: linear-gradient(135deg, #fdfefe 0%, #f1f5f9 100%);
  border: 2.5px dashed var(--secondary-color);
  border-radius: 18px;
  padding: 24px;
  margin: 25px 0;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 15px rgba(68, 77, 142, 0.05);
}

.voucher::after,
.voucher::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background-color: var(--bg-primary);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}

.voucher::before {
  left: -13px;
  border-right: 1.5px solid rgba(68, 77, 142, 0.1);
}

.voucher::after {
  right: -13px;
  border-left: 1.5px solid rgba(68, 77, 142, 0.1);
}

.voucher-label {
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 700;
}

.voucher-code {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--primary-color);
  font-family: monospace;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(68, 77, 142, 0.05);
}

.voucher-instruction {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
}

/* Success Checkmark Animation */
.success-checkmark {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px auto;
  border-radius: 50%;
  background: var(--success-bg);
  border: 3.5px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 2.3rem;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
  animation: bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 20px;
  width: 100%;
}

footer,
footer p,
footer a {
  color: var(--primary-color) !important;
  font-size: 0.9rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.45);
  text-decoration: none !important;
}

/* ==========================================
   ADMIN LAYOUT (Licht & Professioneel)
   ========================================== */
.admin-container {
  width: 100%;
  max-width: 1200px;
  margin: 35px auto;
  padding: 0 20px;
  animation: fadeIn 0.5s ease;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.admin-title-area h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-color);
}

.admin-title-area p {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
}

.admin-actions {
  display: flex;
  gap: 12px;
}

/* Admin Grid & Cards */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(68, 77, 142, 0.03);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--primary-color);
}

.stat-card.spins::before {
  background: var(--secondary-color);
}

.stat-card.conversion::before {
  background: var(--accent-color);
}

.stat-icon {
  font-size: 2rem;
  background: #f1f5f9;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Dashboard Workspace */
.dashboard-workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 30px;
}

@media (max-width: 950px) {
  .dashboard-workspace {
    grid-template-columns: 1fr;
  }
}

/* Live Table Area */
.table-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(68, 77, 142, 0.04);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.table-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.table-search {
  position: relative;
  width: 260px;
}

.table-search input {
  padding: 12px 12px 12px 42px;
  font-size: 0.9rem;
  border-radius: 10px;
}

.table-search .input-icon {
  left: 14px;
  font-size: 1rem;
}

/* Responsive Table */
.table-wrapper {
  overflow-x: auto;
  flex: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  color: var(--text-muted);
  font-weight: 700;
  padding: 16px;
  border-bottom: 2px solid #f1f5f9;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

td {
  padding: 16px;
  border-bottom: 1px solid #f8fafc;
  color: var(--text-main);
  vertical-align: middle;
  font-weight: 500;
}

tr:hover td {
  background: #f8fafc;
}

.email-cell {
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-cell {
  font-family: monospace;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--secondary-color);
}

.badge-status {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
}

.badge-status.unused {
  background-color: #eff6ff;
  color: var(--accent-color);
  border: 1px solid rgba(79, 114, 178, 0.2);
}

.badge-status.used {
  background-color: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
}

.table-btn {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* Admin Verification Area (Sidebar) */
.verifier-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 28px;
  height: fit-content;
  text-align: center;
  box-shadow: 0 10px 25px rgba(68, 77, 142, 0.04);
}

.verifier-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.verifier-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.verification-result {
  margin-top: 24px;
  animation: fadeIn 0.4s ease;
}

/* Admin Password Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(68, 77, 142, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 45px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(68, 77, 142, 0.15);
  text-align: center;
  position: relative;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--btn-gradient);
}

.modal h2 {
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--primary-color);
}

.modal p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

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

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gentleFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes bounce {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 600px) {
  .card {
    padding: 30px 20px;
  }
  
  .logo-image {
    max-width: 220px;
  }
  
  .voucher-code {
    font-size: 2rem;
    letter-spacing: 4px;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .admin-actions {
    width: 100%;
  }
  
  .admin-actions button {
    flex: 1;
  }
  
  .table-search {
    width: 100%;
    margin-top: 10px;
  }
  
  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
