/* =====================================================
   ET Elite Wrestling Camps — Admin Panel Stylesheet
   ===================================================== */

:root {
  --green: #28a745;
  --green-dark: #1e7e34;
  --green-light: #d4edda;
  --black: #000000;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --red: #dc3545;
  --red-light: #f8d7da;
  --yellow: #ffc107;
  --yellow-light: #fff3cd;
  --blue: #0d6efd;
  --blue-light: #cfe2ff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --font-heading: 'Oswald', 'Arial Black', Impact, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
}

/* ===== LOGIN PAGE ===== */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #000 0%, #1e7e34 100%);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img { height: 80px; margin: 0 auto 12px; }

.login-logo h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--gray-500);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.login-form label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-700);
}

.login-form .form-control {
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s;
}

.login-form .form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40,167,69,0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--green); color: var(--white); width: 100%; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-danger  { background: var(--red); color: var(--white); }
.btn-danger:hover  { background: #c82333; }
.btn-outline-green {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
}
.btn-outline-green:hover { background: var(--green); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: 0.75rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-error {
  background: var(--red-light);
  color: var(--red);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

/* ===== ADMIN LAYOUT ===== */
#admin-app { display: none; min-height: 100vh; }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--black);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header img { height: 56px; }

.sidebar-header .site-name {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
}

.sidebar-nav { padding: 16px 8px; flex: 1; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.sidebar-nav a.active { color: var(--white); background: var(--green); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
}

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-content { padding: 28px; flex: 1; }

/* ===== PANELS ===== */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* Stats row */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.admin-stat-card .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.admin-stat-card .value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.admin-stat-card .value.green { color: var(--green); }

/* Cards / Sections */
.admin-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-card-header h2 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-900);
}

.admin-card-body { padding: 24px; }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  background: var(--gray-50);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

td .td-name { font-weight: 600; color: var(--gray-900); }
td .td-sub  { font-size: 0.78rem; color: var(--gray-500); margin-top: 2px; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-green  { background: var(--green-light); color: var(--green-dark); }
.badge-gray   { background: var(--gray-200);    color: var(--gray-700); }
.badge-yellow { background: var(--yellow-light); color: #856404; }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-blue   { background: var(--blue-light);  color: var(--blue); }

/* Table actions */
.table-actions { display: flex; align-items: center; gap: 6px; }

/* ===== FORMS ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.form-row.single { grid-template-columns: 1fr; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-700);
}

.form-control {
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--gray-900);
  background: var(--white);
  width: 100%;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40,167,69,0.12);
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* Image Upload */
.image-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.image-upload-area:hover { border-color: var(--green); background: rgba(40,167,69,0.02); }
.image-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.image-upload-area .upload-icon { font-size: 2rem; margin-bottom: 8px; }
.image-upload-area .upload-text { font-size: 0.875rem; color: var(--gray-500); }
.image-upload-area .upload-text span { color: var(--green); font-weight: 600; }
#imagePreview {
  max-width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 12px;
  display: none;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.2s;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-900); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 10px;
}
.alert.show { display: flex; }
.alert-success { background: var(--green-light); color: #155724; }
.alert-error   { background: var(--red-light);   color: #721c24; }

/* Search & Filter bar */
.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  min-width: 220px;
  transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--green); }

/* Loading spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row td { text-align: center; color: var(--gray-500); padding: 40px; }

/* Registration detail view */
.reg-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.reg-detail-item label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-500);
  display: block;
  margin-bottom: 4px;
}
.reg-detail-item p {
  font-size: 0.9rem;
  color: var(--gray-900);
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .reg-detail { grid-template-columns: 1fr; }
}
