/* ============================================================
   Dharamshala & Bhojanalaya Management System
   Custom Stylesheet v1.0
   ============================================================ */

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

/* ── CSS Custom Properties (Design Tokens) ────────────────── */
:root {
  /* Primary Palette – Warm Saffron / Temple Theme */
  --primary:        #e67e22;
  --primary-dark:   #c0601a;
  --primary-light:  #f5b041;
  --primary-glow:   rgba(230, 126, 34, 0.25);

  /* Accent */
  --accent:         #2ecc71;
  --accent-dark:    #1a9c53;
  --danger:         #e74c3c;
  --warning:        #f39c12;
  --info:           #3498db;

  /* Neutrals */
  --bg-body:        #f4f6f9;
  --bg-card:        #ffffff;
  --bg-sidebar:     #1e272e;
  --bg-sidebar-hover:#2d3a44;
  --text-dark:      #2c3e50;
  --text-muted:     #7f8c8d;
  --text-light:     #ffffff;
  --border:         #e0e4e8;

  /* Glassmorphism */
  --glass-bg:       rgba(255,255,255,0.75);
  --glass-blur:     12px;
  --glass-border:   rgba(255,255,255,0.3);

  /* Shadows */
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.12);

  /* Transitions */
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --duration:       0.3s;

  /* Typography */
  --font-body:      'Inter', sans-serif;
  --font-heading:   'Outfit', sans-serif;

  /* Sidebar */
  --sidebar-width:  260px;
}

/* ── Base Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* ── Utility Classes ──────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-custom   { background-color: var(--primary) !important; }
.font-heading        { font-family: var(--font-heading); }

/* ── Glass Card ───────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}
.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── Premium Card ─────────────────────────────────────────── */
.premium-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
}
.premium-card:hover {
  box-shadow: var(--shadow-md);
}

/* ── Gradient Header (Public Form) ────────────────────────── */
.hero-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #d35400 100%);
  color: white;
  padding: 2rem 1.5rem;
  border-radius: 0 0 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.hero-gradient h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.hero-gradient p {
  opacity: 0.85;
  font-size: 0.9rem;
  margin: 0;
}

/* ── Form Styling ─────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid var(--border);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  transition: border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  border-radius: 10px;
  padding: 0.7rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-dark), #b35418);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
  color: white;
}
.btn-primary-custom:active {
  transform: translateY(0);
}
.btn-primary-custom:disabled {
  opacity: 0.65;
  transform: none;
  cursor: not-allowed;
}

.btn-outline-custom {
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 10px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  background: transparent;
  transition: all var(--duration) var(--ease);
}
.btn-outline-custom:hover {
  background: var(--primary);
  color: white;
}

/* ── Guest Row Animation ──────────────────────────────────── */
.guest-row {
  animation: slideDown 0.35s var(--ease) forwards;
  opacity: 0;
  transform: translateY(-10px);
}
@keyframes slideDown {
  to { opacity: 1; transform: translateY(0); }
}
.guest-row .card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--duration) var(--ease);
}
.guest-row .card:hover {
  border-color: var(--primary-light);
}
.guest-row .main-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Sidebar (Admin) ──────────────────────────────────────── */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-light);
  z-index: 1050;
  transition: transform var(--duration) var(--ease);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-sidebar .sidebar-brand h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
  color: var(--primary-light);
}
.admin-sidebar .sidebar-brand small {
  font-size: 0.72rem;
  opacity: 0.5;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,0.65);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  margin: 2px 10px;
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: var(--bg-sidebar-hover);
  color: var(--primary-light);
}
.admin-sidebar .nav-link.active {
  background: rgba(230,126,34,0.15);
  color: var(--primary);
}
.admin-sidebar .nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

/* ── Admin Main Content ───────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 0;
  transition: margin-left var(--duration) var(--ease);
}
.admin-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: var(--shadow-sm);
}
.admin-topbar .page-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
}
.admin-content {
  padding: 1.5rem;
}

/* ── Stat Cards (Dashboard) ───────────────────────────────── */
.stat-card {
  border-radius: 14px;
  padding: 1.25rem;
  border: none;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Table Styling ────────────────────────────────────────── */
.table-premium {
  border-collapse: separate;
  border-spacing: 0;
}
.table-premium thead th {
  background: var(--bg-sidebar);
  color: white;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  border: none;
}
.table-premium thead th:first-child { border-radius: 10px 0 0 0; }
.table-premium thead th:last-child  { border-radius: 0 10px 0 0; }
.table-premium tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.table-premium tbody tr {
  transition: background var(--duration) var(--ease);
}
.table-premium tbody tr:hover {
  background: rgba(230,126,34,0.04);
}

/* ── Status Badges ────────────────────────────────────────── */
.badge-active {
  background: rgba(46,204,113,0.12);
  color: var(--accent-dark);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
}
.badge-checkout {
  background: rgba(231,76,60,0.1);
  color: var(--danger);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
}

/* ── Success Animation ────────────────────────────────────── */
.success-checkmark {
  animation: popIn 0.5s var(--ease);
}
@keyframes popIn {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Loader Spinner ───────────────────────────────────────── */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e272e 0%, #2d3436 50%, #1e272e 100%);
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.login-card .login-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 2rem;
  text-align: center;
  color: white;
}
.login-card .login-body {
  background: var(--bg-card);
  padding: 2rem;
}

/* ── Toast Notification ───────────────────────────────────── */
.toast-custom {
  border-radius: 12px;
  border: none;
  box-shadow: var(--shadow-lg);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .hero-gradient h1 { font-size: 1.3rem; }
  .admin-content { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
}

/* ── Sortable Table Headers ──────────────────────────────── */
.sortable-th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s var(--ease);
}
.sortable-th[data-sort]:hover {
  background: rgba(255,255,255,0.08);
}
.sortable-th .sort-icon {
  font-size: 0.75rem;
  transition: transform 0.2s var(--ease);
}

/* ── Custom Pagination ───────────────────────────────────── */
.custom-pagination .page-link {
  border: 1.5px solid var(--border);
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.85rem;
  border-radius: 8px !important;
  margin: 0 2px;
  min-width: 34px;
  text-align: center;
  padding: 0.35rem 0.65rem;
  transition: all var(--duration) var(--ease);
}
.custom-pagination .page-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
}
.custom-pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.custom-pagination .page-item.disabled .page-link {
  background: var(--bg-body);
  color: var(--text-muted);
  opacity: 0.5;
}

/* ── Booking Search Bar ──────────────────────────────────── */
.booking-search-group {
  height: 40px;
}
.booking-search-group .input-group-text {
  border-radius: 10px 0 0 10px;
  border: 1.5px solid var(--border);
  border-right: none;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
}
.booking-search-group .form-control {
  border-radius: 0 10px 10px 0;
  border: 1.5px solid var(--border);
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  height: 100%;
}
.booking-search-group .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ── Ledger Grid ──────────────────────────────────────────── */
.ledger-total-row {
  background: linear-gradient(135deg, rgba(230,126,34,0.08), rgba(230,126,34,0.03));
  font-weight: 700;
  font-size: 1.1rem;
}
.ledger-input {
  text-align: right;
  font-weight: 500;
}

/* ── Fade In Animation ────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.5s var(--ease) forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Modal Styling ────────────────────────────────────────── */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

/* ── Custom Dialog (alert/confirm replacement) ───────────── */
.custom-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}
.custom-dialog-overlay.cd-visible {
  opacity: 1;
  visibility: visible;
}

.custom-dialog {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 90%;
  max-width: 400px;
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s var(--ease);
}
.custom-dialog.cd-animate-in {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Icon circle ──────────────────────────────────────────── */
.custom-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
}
.custom-dialog-icon.cd-type-success {
  background: rgba(46, 204, 113, 0.12);
  color: var(--accent-dark);
}
.custom-dialog-icon.cd-type-danger {
  background: rgba(231, 76, 60, 0.12);
  color: var(--danger);
}
.custom-dialog-icon.cd-type-warning {
  background: rgba(243, 156, 18, 0.12);
  color: var(--warning);
}
.custom-dialog-icon.cd-type-info {
  background: rgba(52, 152, 219, 0.12);
  color: var(--info);
}

/* ── Title & Message ──────────────────────────────────────── */
.custom-dialog-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}
.custom-dialog-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ── Action Buttons ───────────────────────────────────────── */
.custom-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.cd-btn {
  border-radius: 10px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 100px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  border: none;
}
.cd-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.cd-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.cd-btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #b35418);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--primary-glow);
  color: white;
}
.cd-btn-danger {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: white;
}
.cd-btn-danger:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
  color: white;
}
.cd-btn-cancel {
  background: var(--bg-body);
  color: var(--text-dark);
  border: 1.5px solid var(--border);
}
.cd-btn-cancel:hover {
  background: var(--border);
  transform: translateY(-1px);
}
