@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/*/////////////////////////////////////////// GLOBAL MARGIN FOR SIDEBAR */
.main-content {
  margin-left: 60px;
  margin-top: 80px;
  transition: margin 0.3s;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    margin-top: 80px;
  }
}

/*/////////////////////////////////////////// PUSH SIDEBAR WHEN OPEN */
.sidebar:not(.close) ~ .main-content {
  margin-left: 270px; /* sidebar width */
  transition: margin-left 0.5s ease;
}

.sidebar.close ~ .main-content {
  margin-left: 80px;
  transition: margin-left 0.5s ease;
}

@media (max-width: 768px) {
  .sidebar:not(.close) ~ .main-content,
  .sidebar.close ~ .main-content {
    margin-left: 0;
  }
}

/*/////////////////////////////////////////// MODAL PARA NO PADDING WHEN OPEN */
.sidebar-modal.show ~ .modal-backdrop {
  background-color: transparent !important;
  opacity: 0 !important;
  padding: 0 !important;
}

.sidebar-modal.close ~ .modal-backdrop {
  background-color: transparent !important;
  opacity: 0 !important;
}

.sidebar-modal.modal-content {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18), 0 1.5px 6px rgba(0, 0, 0, 0.12) !important;
}

body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

/*/////////////////////////////////////////// Sidebar Styling */
.sidebar {
    width: 270px;
    height: 100vh;
    background-color: #1a4731;
    color: white;
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
    transition: width 0.3s ease;
}

/*/////////////////////////////////////////// PROFILE STYLES */
.sidebar-modal .modal-content {
  border-radius: 12px;
  overflow: hidden;
  min-width: 360px;
  max-width: 420px;
  box-shadow: 0 12px 30px rgba(18, 86, 31, 0.12);
}
.sidebar-modal .profile-header {
  background: linear-gradient(90deg, #0f5132 0%, #198754 100%);
  color: #fff;
  padding: 18px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.sidebar-modal .profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.sidebar-modal .profile-name { font-weight: 600; font-size: 1.05rem; margin-bottom: 2px; }
.sidebar-modal .profile-username { font-size: 0.9rem; opacity: 0.95; margin-bottom: 6px; }
.sidebar-modal .profile-role { font-size: 0.8rem; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.12); display:inline-block; }
.sidebar-modal .profile-body { padding: 14px 18px; background: #fff; color: #222; }
.sidebar-modal .profile-list .item { display:flex; gap:10px; align-items:center; padding:10px 0; border-bottom: 1px solid #f3f6f3; }
.sidebar-modal .profile-list .item:last-child { border-bottom: none; }
.sidebar-modal .profile-list .item .label { flex: 0 0 110px; color:#5a725a; font-weight:500; }
.sidebar-modal .profile-list .item .value { color:#233b23; }
.sidebar-modal .modal-footer { background: #fafdf9; border-top: 1px solid #eef7ea; display:flex; gap:8px; justify-content: flex-end; }
@media (max-width:420px){ .sidebar-modal .modal-content{ max-width:320px } .sidebar-modal .profile-list .item .label{flex-basis:90px} }

/*/////////////////////////////////////////// NOTIFICATION STYLES*/
/* Make notification tabs stick to bottom of header and remove extra margin */
#notificationModal .modal-header {
  position: relative;
  padding-bottom: 0;
}

#notificationModal .nav-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 !important;
  border-bottom: 1px solid #e9ecef;
  background: #fff;
  z-index: 2;
}

#notificationModal .modal-header {
  padding-bottom: 44px; /* height of tabs + spacing */
}

@media (max-width: 767px) {
  #notificationModal .nav-tabs {
    font-size: 0.95em;
  }
}

.remove-notif-btn {
  border: none;
  background: transparent;
  font-size: 1.25em;
  line-height: 1;
  color: #dc3545;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.2s;
  margin-top: -5%;
}
.remove-notif-btn:hover {
  color: #a71d2a;
  text-decoration: none;
}

/* Wrapper for Message + Timestamp */
.notification-content {
  flex-grow: 1; /* Takes up available space */
}

/* Style for the "time ago" text */
.notification-time {
  display: block;
  font-size: 0.8em;
  color: #6c757d;
  margin-top: 4px;
}

/* Updated styles for remove button */
.remove-notif-btn {
  border: none;
  background: transparent;
  font-size: 1.25em;
  line-height: 1;
  color: #dc3545;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.2s;
  flex-shrink: 0; /* Prevents button from shrinking */
  margin-left: 10px; /* Spacing from content */
}

.remove-notif-btn:hover {
  color: #a71d2a;
}

.notification-slide-out {
  transition: transform 0.4s ease, opacity 0.4s ease;
  transform: translateX(100%);
  opacity: 0;
}

.new-badge {
  background:#1877f2;
  color:white;
  font-size:10px;
  font-weight: 500;
  padding:2px 6px;
  border-radius:6px;
  margin-left:6px;
  vertical-align: middle;
}
.new-highlight {
  background:#e7f3ff;
  border-radius: 8px;
  margin-left: -6px;
  margin-right: -6px;
}



/* These are the desktop styles we just removed from sidebar.php */
#notificationModal .modal-dialog {
  position: absolute;
  top: 80px;
  right: 80px;
  margin: 0;
  max-width: 420px;
  width: 90vw;
}

#notificationModal .modal-body {
  max-height: 45vh; /* Set a max height for desktop */
  overflow-y: auto;
}



@media (max-width: 768px) {
  #notificationModal .modal-dialog {
    position: relative; /* Reset the fixed position */
    top: auto;
    right: auto;
    /* Center the modal on mobile */
    margin: 1.75rem auto; 
    max-width: 95vw;
    width: 95vw;
  }

  #notificationModal .modal-body {
    max-height: 70vh; /* Allow it to be taller on mobile */
  }
}

/* Logo & Toggle Button */
.logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");
}
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: "Poppins", sans-serif;
    }
    :root {
      --white-color: #e1f5ea;
      --blue-color: #1d8326;
      --grey-color: #10472c;
      --grey-color-light: #11410d;
    }
    body {
      background-color: #bfcebf;
      transition: all 0.5s ease;
    }
    /* navbar */
    .navbar {
      position: fixed;
      top: 0;
      width: 100%;
      left: 0;
      background-color: var(--white-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 30px;
      z-index: 1000;
      box-shadow: 0 0 2px var(--grey-color-light);
    }
    .logo_item {
      display: flex;
      align-items: center;
      column-gap: 10px;
      font-size: 22px;
      font-weight: 500;
      color: var(--blue-color);
    }
    .navbar img {
      width: 35px;
      height: 35px;
      border-radius: 50%;
    }
    .search_bar {
      height: 47px;
      max-width: 430px;
      width: 100%;
    }
    .search_bar input {
      height: 100%;
      width: 100%;
      border-radius: 25px;
      font-size: 18px;
      outline: none;
      background-color: var(--white-color);
      color: var(--grey-color);
      border: 1px solid var(--grey-color-light);
      padding: 0 20px;
    }
    .navbar_content {
      display: flex;
      align-items: center;
      column-gap: 25px;
    }
    .navbar_content i {
      cursor: pointer;
      font-size: 20px;
      color: var(--grey-color);
    }

    .navbar_content i:hover {
      color: var(--blue-color);
      opacity: 0.7;
    }

    /* sidebar */

    /* Highlight active top-level nav_link */
    .nav_link.active, .submenu_item.active {
      background: var(--blue-color);
      color: var(--white-color) !important;
    }
    .nav_link.active .navlink_icon,
    .submenu_item.active .navlink_icon {
      background: var(--blue-color);
      color: var(--white-color) !important;
    }

    /* Highlight active sublink */
    .sublink.active {
      background: #e6f4ea;
      color: var(--blue-color) !important;
      font-weight: 600;
    }

    .sidebar.close .nav_link.active,
    .sidebar.close .submenu_item.active {
      background: transparent !important;
      color: var(--grey-color) !important;
    }

    /* But keep the icon highlighted */
    .sidebar.close .nav_link.active .navlink_icon,
    .sidebar.close .submenu_item.active .navlink_icon {
      background: var(--blue-color);
      color: var(--white-color) !important;
    }

    .sidebar {
      background-color: var(--white-color);
      width: 260px;
      position: fixed;
      top: 0;
      left: 0;
      height: 100%;
      padding: 80px 20px;
      z-index: 100;
      overflow-y: scroll;
      box-shadow: 0 0 1px var(--grey-color-light);
      transition: all 0.5s ease;
    }
    .sidebar.close {
      padding: 60px 0;
      width: 80px;
    }
    .sidebar::-webkit-scrollbar {
      display: none;
    }
    .menu_content {
      position: relative;
    }
    .menu_title {
      margin: 15px 0;
      padding: 0 20px;
      font-size: 18px;
    }
    .sidebar.close .menu_title {
      padding: 6px 30px;
    }
    .menu_title::before {
      color: var(--grey-color);
      white-space: nowrap;
    }
    .menu_dahsboard::before {
      content: "Dashboard";
    }
    .menu_editor::before {
      content: "Editor";
    }
    .menu_setting::before {
      content: "Setting";
    }
    .sidebar.close .menu_title::before {
      content: "";
      position: absolute;
      height: 2px;
      width: 18px;
      border-radius: 12px;
      background: var(--grey-color-light);
    }
    .menu_items {
      padding: 0;
      list-style: none;
    }
    .navlink_icon {
      position: relative;
      font-size: 22px;
      min-width: 50px;
      line-height: 40px;
      display: inline-block;
      text-align: center;
      border-radius: 6px;
    }
    .navlink_icon::before {
      content: "";
      position: absolute;
      height: 100%;
      width: calc(100% + 100px);
      left: -20px;
    }
    .navlink_icon:hover {
      background: var(--blue-color);
    }
    .sidebar .nav_link {
      display: flex;
      align-items: center;
      width: 100%;
      padding: 4px 15px;
      border-radius: 8px;
      text-decoration: none;
      color: var(--grey-color);
      white-space: nowrap;
    }
    .sidebar.close .navlink {
      display: none;
    }
    .nav_link:hover {
      color: var(--white-color);
      background: var(--blue-color);
    }
    .sidebar.close .nav_link:hover {
      background: var(--white-color);
    }
    .submenu_item {
      cursor: pointer;
    }
    .submenu {
      display: none;
    }
    .submenu_item .arrow-left {
      position: absolute;
      right: 10px;
      display: inline-block;
      margin-right: auto;
    }
    .sidebar.close .submenu {
      display: none;
    }
    .show_submenu ~ .submenu {
      display: block;
    }
    .show_submenu .arrow-left {
      transform: rotate(90deg);
      transition: transform 0.3s ease;
    }
    .submenu .sublink {
      padding: 15px 15px 15px 52px;
    }
    .bottom_content {
      position: fixed;
      bottom: 60px;
      left: 0;
      width: 260px;
      cursor: pointer;
      transition: all 0.5s ease;
    }
    .bottom {
      position: absolute;
      display: flex;
      align-items: center;
      left: 0;
      justify-content: space-around;
      padding: 18px 0;
      text-align: center;
      width: 100%;
      color: var(--grey-color);
      border-top: 1px solid var(--grey-color-light);
      background-color: var(--white-color);
    }
    .bottom i {
      font-size: 20px;
    }
    .bottom span {
      font-size: 18px;
    }
    .sidebar.close .bottom_content {
      width: 50px;
      left: 15px;
    }
    .sidebar.close .bottom span {
      display: none;
    }
    .sidebar.hoverable .collapse_sidebar {
      display: none;
    }
    #sidebarOpen {
      display: none;
    }
    @media screen and (max-width: 768px) {
      #sidebarOpen {
        font-size: 25px;
        display: block;
        margin-right: 10px;
        cursor: pointer;
        color: var(--grey-color);
      }
      .sidebar.close {
        left: -100%;
      }
      .search_bar {
        display: none;
      }
      .sidebar.close .bottom_content {
        left: -100%;
      }
    }

    /*/////////////////////////////////////////// pang ayos ng bwakanang sidebar modals*/
    @media (max-width: 767px) {
      .sidebar-modal .modal-dialog-right {
        right: auto !important;
        left: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
      }
    }


/* -------------------------
   SIMPLE / CLEAN DARK THEME
   Append this at the end of sidebar.css
   Keeps existing active/hover highlights intact
   ------------------------- */

body.dark {
  --bg: #0f2018;        /* page background (not too dark) */
  --panel: #153026;     /* card / panel background (solid) */
  --muted: #98a59b;     /* secondary text */
  --text: #e6efe9;      /* primary text */
  --accent: #1d8326;    /* brand accent (kept) */
  --border: rgba(255,255,255,0.06);
}

/* page background, main containers */
body.dark {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}
body.dark .main-content,
body.dark .main-container { /* include main-container if present */
  background: transparent;
  color: var(--text);
}

/* navbar */
body.dark .navbar {
  background: var(--panel) !important; /* simple, solid background */
  color: var(--text) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
body.dark .navbar .logo_item,
body.dark .navbar_content i {
  color: var(--text) !important;
}

/* sidebar shell (keep current active/hover rules untouched) */
body.dark .sidebar {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-right: 1px solid var(--border);
}

/* link defaults (doesn't override .nav_link.active or hover) */
body.dark .nav_link,
body.dark .navlink,
body.dark .sublink {
  color: var(--muted);
}
body.dark .navlink_icon {
  color: var(--muted);
  background: transparent;
}

/* bottom/footer area of sidebar */
body.dark .bottom,
body.dark .bottom_content {
  background: transparent;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,0.03);
}

/* cards / panels - no gradients, simple solid */
body.dark .card,
body.dark .card-body,
body.dark .panel,
body.dark .main-card {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

/* text elements across app */
body.dark p,
body.dark span,
body.dark label,
body.dark .lead,
body.dark .card-title,
body.dark h1, body.dark h2, body.dark h3, body.dark h4, body.dark h5, body.dark h6 {
  color: var(--text) !important;
}

/* tables and DataTables - readable, striped difference subtle */
body.dark table.table,
body.dark .dataTable {
  color: var(--text);
  border-color: var(--border);
  background: transparent;
}
body.dark table.table thead th {
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
body.dark table.table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  background: transparent;
}
/* keep table-striped but subtle on dark */
body.dark table.table.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(255,255,255,0.015);
}

/* DataTables inputs / controls - minimal */
body.dark .dataTables_wrapper .dataTables_filter input,
body.dark .dataTables_wrapper .dataTables_length select,
body.dark input, body.dark textarea, body.dark select {
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* mobile stacked table labels (data-label must exist on td) */
@media (max-width: 575.98px) {
  body.dark .table thead { display: none; }
  body.dark .table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.03);
    background: rgba(255,255,255,0.01);
  }
  body.dark .table tbody tr td {
    display: block;
    text-align: right;
    padding: 6px 0;
    font-size: 0.9rem;
    border: none;
  }
  body.dark .table tbody tr td:before {
    content: attr(data-label) ": ";
    float: left;
    font-weight: 600;
    color: var(--muted);
  }
}

/* keep existing active/hover styles for nav links (do not override) */

/* small accessibility focus */
body.dark :focus {
  outline: 2px solid rgba(29,131,38,0.12);
  outline-offset: 2px;
}
