/* admin/css/style.css */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg-dark: #121212;
  --sidebar-bg: #181818;
  --card-bg: #222222;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --gold: #d4af37;
  --gold-hover: #f1c40f;
  --border-color: #333333;
  --input-bg: rgba(255, 255, 255, 0.05);

  /* ✨ Naye Variables Specific Pages Ke Liye ✨ */
  --panel-bg: #1a2332; /* Dark Blue background (Welcome Card ke liye) */
  --box-bg: #1e2532; /* Dark Blue-ish (Summary Cards aur Tables ke liye) */
  --box-border: #2a374a; /* Dark Blue Border */
  --circle-bg: #23334a; /* Dark Blue Circle Background */
}

/* Light Theme Variables */
body.light-theme {
  --bg-dark: #f4f6f8;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: #666666;
  --border-color: #e0e0e0;
  --input-bg: #f9f9f9;

  /* ✨ Light Mode me ye sab white ho jayenge ✨ */
  --panel-bg: #ffffff;
  --box-bg: #ffffff;
  --box-border: #e0e0e0;
  --circle-bg: #dbf0ee;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Manrope", sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-logo {
  padding: 30px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo h2 {
  color: var(--gold);
  font-family: serif;
  font-size: 22px;
  letter-spacing: 1px;
}

.user-profile {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--circle-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.user-info h4 {
  font-size: 14px;
  margin-bottom: 4px;
}
.user-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.badge-admin {
  background: var(--circle-bg);
  color: var(--gold);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--box-border);
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 15px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.menu-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid var(--gold);
}

.menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 15px 20px;
}

.sign-out {
  color: #ff4d4d;
}
.sign-out:hover {
  color: #ff1a1a;
  background: rgba(255, 77, 77, 0.1);
}

/* Main Content Styles */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 600;
}
.topbar p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
}

.welcome-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--card-bg); /* Thoda lighter for welcome */
}

.welcome-icon {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
  padding: 15px;
  border-radius: 8px;
  font-size: 20px;
}

.welcome-text h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.welcome-text p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Empty State Placeholder */
.placeholder-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.placeholder-box svg {
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Search Input */
.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: white;
  padding: 15px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.search-input:focus {
  border-color: var(--gold);
}

/* =========================================
   Notification Flyout Panel CSS
   ========================================= */
.notification-panel {
  position: absolute;
  top: 300px; /* Sidebar me Notifications link ke aas paas */
  left: 240px; /* Sidebar ki width ke hisaab se adjust kiya */
  width: 320px;
  background-color: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: none; /* Default me hidden */
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* Jab active ho tab show ho */
.notification-panel.show {
  display: flex;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  background-color: var(--bg-dark);
  border-bottom: 1px solid var(--box-border);
}

.notif-header-left {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.notif-icon-bell {
  background-color: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  width: 35px;
  height: 35px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.notif-header h3 {
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 4px;
  font-weight: 600;
}

.notif-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.notif-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.notif-close:hover {
  color: var(--text-main);
}

.notif-tabs {
  display: flex;
  border-bottom: 1px solid var(--box-border);
  background-color: var(--bg-dark);
}

.notif-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.notif-tab.active {
  color: var(--text-main);
  border-bottom-color: #3b82f6;
}

.notif-body {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background-color: var(--box-bg);
}

.notif-empty-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

body.light-theme .notif-empty-icon {
  background-color: #f1f5f9;
}

.notif-body h4 {
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 5px;
}

.notif-body p {
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================
   Mobile Responsive & Hamburger Menu
   ========================================= */

/* Mobile Header (Default me hidden rahega) */
.mobile-header {
  display: none;
  background-color: var(--sidebar-bg);
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  height: 60px;
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-brand {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 20px;
  font-weight: bold;
}

/* Sidebar Overlay (Jab sidebar khulega tab background dark hoga) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* =========================================
   Mobile Responsive Fixes (Scroll & Layout)
   ========================================= */
@media (max-width: 900px) {
  body {
    display: block !important;
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh; /* Modern phones ke dynamic address bar ke liye */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;

    /* Top header ki height + thoda extra space */
    padding-top: 60px;

    /* Neeche safe area (iPhone notch/home indicator) */
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    /* Sidebar ki height bhi dynamic rakho */
    height: 100vh;
    height: 100dvh;
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;

    /* Sidebar ke neeche safe area padding */
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    /* Padding-bottom ko badha kar 100px kar do taki button aur gap dono cover ho */
    padding: 20px 15px 100px 15px !important;
    width: 100%;
    height: auto !important;
    overflow-y: visible !important;
  }

  .page-header-row {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start !important;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .summary-grid,
  .summary-grid-4,
  .form-row {
    grid-template-columns: 1fr !important;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box,
  .filter-select,
  .btn-filter {
    width: 100%;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
  }

  /* Button full width */
  .btn {
    width: 100%;
    justify-content: center;
  }

  /* =========================================
   Mobile Notification Full Screen Popup
   ========================================= */
  @media (max-width: 900px) {
    /* Dark Overlay Background */
    .notif-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.7);
      z-index: 2000; /* Sabse upar background */
      display: none;
      opacity: 0;
      transition: opacity 0.3s ease;
      backdrop-filter: blur(3px); /* Thoda sa blur effect */
    }
    .notif-overlay.show {
      display: block;
      opacity: 1;
    }

    /* Notification Panel Mobile Styles */
    .notification-panel {
      position: fixed !important;
      top: 50% !important; /* Center vertically */
      left: 50% !important; /* Center horizontally */
      transform: translate(-50%, -50%) !important; /* Perfect center */

      width: calc(100% - 30px) !important; /* 15px margin dono taraf */
      max-width: 400px !important; /* Badi screen par zyada na faile */

      z-index: 2001 !important; /* Overlay se bhi upar */
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;

      /* Entrance Animation */
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* Jab notification show ho */
    .notification-panel.show {
      opacity: 1;
      visibility: visible;
      transform: translate(-50%, -50%) scale(1) !important;
    }
  }
}

/* =========================================
   Topbar & Visit Site Button Styles
   ========================================= */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  flex-wrap: wrap; /* Mobile me wrap ho jaye */
  gap: 15px;
}

.topbar-left h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.topbar-left p {
  color: var(--text-muted);
  font-size: 14px;
}

.btn-visit-site {
  /* background-color: transparent; */
  background-color: #1989a3eb;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-visit-site:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

/* Mobile adjustment */
@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-visit-site {
    justify-content: center;
  }
}
