/* =========================================
   MAFC - Admin Portal Stylesheet
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-dark: #8b6914;
  --black: #080808;
  --dark: #0d0d0d;
  --dark2: #141414;
  --dark3: #1a1a1a;
  --emerald: #1a4d2e;
  --white: #f5f0e8;
  --white-dim: rgba(245, 240, 232, 0.7);
  --glass-border: rgba(201, 168, 76, 0.2);
  --shadow-gold: 0 0 30px rgba(201, 168, 76, 0.3);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse 60% 60% at 30% 30%, rgba(26,77,46,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 70% 70%, rgba(201,168,76,0.08) 0%, transparent 60%),
    var(--black);
  padding: 24px;
}

.login-card {
  background: var(--dark2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

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

.login-badge {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  color: #000;
  margin: 0 auto 12px;
  font-family: 'Playfair Display', serif;
  box-shadow: 0 0 30px rgba(201,168,76,0.4);
}

.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--white);
  font-weight: 700;
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--white-dim);
  letter-spacing: 1px;
  margin-top: 4px;
}

.login-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white-dim);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: var(--dark3);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--white);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  outline: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.form-control::placeholder { color: rgba(245,240,232,0.3); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: #000;
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(201,168,76,0.5); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-2px); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: #000; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 20px; }

.btn-full { width: 100%; justify-content: center; border-radius: 12px; padding: 14px; font-size: 1rem; margin-top: 8px; }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

/* ---- ADMIN LAYOUT ---- */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--dark2);
  border-right: 1px solid rgba(201,168,76,0.1);
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-badge {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  color: #000;
  font-family: 'Playfair Display', serif;
  flex-shrink: 0;
}

.sidebar-header h2 { font-size: 0.95rem; color: var(--gold); font-weight: 700; }
.sidebar-header p { font-size: 0.7rem; color: var(--white-dim); }

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--white-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
  background: rgba(201,168,76,0.08);
  color: var(--gold);
  border-left-color: var(--gold);
}

.nav-item .nav-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(201,168,76,0.1);
}

/* Main Content */
.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 0;
  min-height: 100vh;
  background: var(--dark);
}

/* Top Bar */
.admin-topbar {
  background: var(--dark2);
  border-bottom: 1px solid rgba(201,168,76,0.1);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--white); }
.topbar-date { font-size: 0.8rem; color: var(--white-dim); }

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Content Area */
.admin-content { padding: 32px; }

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--dark2);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.stat-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: var(--shadow-gold); }

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::after { opacity: 1; }

.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 700; font-family: 'Playfair Display', serif; color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--white-dim); margin-top: 4px; }

/* Cards */
.card {
  background: var(--dark2);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 1rem; font-weight: 700; color: var(--white); }
.card-body { padding: 24px; }

/* Rate Editor */
.rate-editor-grid {
  display: grid;
  gap: 16px;
}

.rate-editor-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--dark3);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 14px;
  transition: all 0.3s;
}

.rate-editor-row:hover { border-color: rgba(201,168,76,0.3); }

.rate-emoji-sm { font-size: 2rem; }

.rate-name-group { }
.rate-name-group .en { font-weight: 600; color: var(--white); font-size: 0.95rem; }
.rate-name-group .ur { font-size: 0.8rem; color: var(--white-dim); display: block; }

.rate-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-prefix {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

.rate-input {
  width: 120px;
  background: var(--dark);
  border: 2px solid rgba(201,168,76,0.2);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s;
  text-align: center;
}
.rate-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.1); }

.rate-suffix { font-size: 0.75rem; color: var(--white-dim); white-space: nowrap; }

.avail-toggle {
  position: relative;
  width: 48px; height: 26px;
  cursor: pointer;
}

.avail-toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(201,168,76,0.15);
  border-radius: 26px;
  border: 2px solid rgba(201,168,76,0.2);
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: var(--white-dim);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.3s;
}

.avail-toggle input:checked + .toggle-slider {
  background: rgba(34,197,94,0.3);
  border-color: var(--success);
}
.avail-toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--success);
}

/* Save button glow */
.save-all-btn {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #000;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.save-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,168,76,0.5);
}

.save-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--success);
  color: #fff;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(34,197,94,0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}
.save-toast.show { transform: translateY(0); opacity: 1; }

/* Inquiries Table */
.inquiries-table {
  width: 100%;
  border-collapse: collapse;
}

.inquiries-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.inquiries-table td {
  padding: 14px 16px;
  font-size: 0.87rem;
  color: var(--white-dim);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.inquiries-table tr:hover td { background: rgba(201,168,76,0.04); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-new { background: rgba(201,168,76,0.2); color: var(--gold); }
.badge-contacted { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-closed { background: rgba(255,255,255,0.08); color: var(--white-dim); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--white-dim);
}
.empty-state .icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* Password change */
.change-pass-form { max-width: 400px; }

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .admin-main { margin-left: 0; }
  .rate-editor-row { grid-template-columns: auto 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 16px; }
}
