:root {
  --orange: #ff7e00;
  --nav-height: 7vh;
}

/* Ensure consistent layout across screen sizes */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#body-wrapper {
  min-height: 100vh;
  padding-bottom: var(--nav-height);
}

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: #000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1050;
  border-top: 1px solid #333;
}

#bottom-nav a {
  flex: 1 1 0;
  text-align: center;
  font-size: 0.75rem;
  color: #fff;
  text-decoration: none;
  padding-top: 4px;
}

#bottom-nav a.active {
  color: var(--orange);
}

#bottom-nav i {
  font-size: 1.3rem;
  display: block;
}

#content-wrapper {
  padding: 1.5rem;
}

.page {
  height: 100%;
}

/* Overlay for modal or sidebar if needed */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  transition: all 0.5s ease-in-out;
}

.overlay.active {
  display: block;
}

/* Submenu container */
.submenu-wrapper {
  position: relative;
  flex: 1 1 0;
  text-align: center;
}

.submenu-wrapper > a {
  font-size: 0.75rem;
  color: #fff;
  text-decoration: none;
  padding-top: 4px;
  display: block;
}

.submenu-wrapper > a i {
  font-size: 1.3rem;
  display: block;
}

/* Submenu itself */
.submenu {
  position: absolute;
  bottom: var(--nav-height);
  left: 50%;
  transform: translateX(-50%);
  background-color: #000;
  border: 1px solid #333;
  border-radius: 5px;
  display: none;
  flex-direction: column;
  z-index: 1060;
  min-width: 120px;
}

.submenu a {
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  text-decoration: none;
  text-align: left;
  border-bottom: 1px solid #333;
}

.submenu a:last-child {
  border-bottom: none;
}

.submenu a:hover {
  background-color: #111;
  color: var(--orange);
}

/* FIXED Notification styles */
.notification-wrapper {
  position: relative;
}

.notification-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
  font-size: 0.75rem;
  color: #fff; /* FIX: Make sure icon is white */
  text-decoration: none;
  padding-top: 4px;
}

.notification-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.notification-toggle i {
  font-size: 1.3rem;
  display: block;
  color: #fff; /* FIX: Ensure bell icon is white */
}

.notification-toggle .label {
  color: #fff; /* FIX: Ensure label is white */
}

.notification-toggle .badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  padding: 0.125rem 0.375rem;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 1.2rem;
  height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* FIX: Proper notification dropdown styling to prevent being stuck open */
.notifications-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: none; /* FIX: Start hidden */
  flex-direction: column; /* FIX: Add proper flex direction */
  z-index: 1060; /* FIX: Higher z-index than submenu */
  margin-bottom: 0.5rem;
  border: 1px solid #e0e0e0;
  width: 350px;
  max-height: 400px;
}

.notifications-dropdown.active {
  display: flex; /* FIX: Show when active */
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #495057;
}

.mark-all-read-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.mark-all-read-btn:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
  position: relative;
}

.notification-item:hover {
  background-color: #f8f9fa;
}

.notification-content {
  flex: 1;
  cursor: pointer;
}

.notification-message {
  font-size: 0.85rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  color: #495057;
}

.notification-time {
  font-size: 0.75rem;
  color: #6c757d;
}

.notification-close {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 3px;
  opacity: 0;
  transition: all 0.2s;
}

.notification-item:hover .notification-close {
  opacity: 1;
}

.notification-close:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.no-notifications {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #6c757d;
  text-align: center;
}

.no-notifications i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.notification-footer {
  border-top: 1px solid #e0e0e0;
  padding: 0.5rem;
}

.view-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  color: #fff; /* FIX: White text for dark background */
  background-color: #333; /* FIX: Dark background */
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 500;
}

.view-all-btn:hover {
  background-color: #444; /* FIX: Darker on hover */
  text-decoration: none;
  color: #fff; /* FIX: Keep white text on hover */
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .notifications-dropdown {
    width: 320px;
    right: -50px;
  }

  .notification-item {
    padding: 0.5rem;
  }

  .notification-message {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .notifications-dropdown {
    width: 280px;
    right: -70px;
  }
}
