/* Navbar transparent and fixed */
nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(17, 17, 17, 0.85);
  padding: 10px 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  font-family: Arial, sans-serif;
}
nav.navbar a.logo-link {
  display: inline-flex;
  align-items: center;
  margin-right: 20px;
  z-index: 10100;
  cursor: pointer;
}

/* STI Logo */
nav.navbar img.logo {
  height: 50px;
  width: auto;
  user-select: none;
}
nav.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  margin-left: 20px;
  padding: 0;
  align-items: center;
  flex-grow: 1;
}
nav.navbar ul li {
  display: flex;
  align-items: center;
  height: 80px;
}

/* General reset for all navbar links */
nav.navbar ul li a,
nav.navbar ul li a:focus,
nav.navbar ul li a:active,
nav.navbar ul li a:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  color: white !important;
  padding: 8px 12px !important;
  height: 80px !important;
  line-height: normal !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: color 0.3s ease;
}

/* Hover/focus color */
nav.navbar ul li a:hover,
nav.navbar ul li a:focus {
  color: yellow !important;
}

/* Active link styling */
nav.navbar ul li a.active {
  color: yellow !important;
  font-weight: bold !important;
}

/* Login + Avatar group */
nav.navbar ul li.login-avatar-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 80px;
}

/* Login Button */
.login-btn {
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 25px;
  font-weight: 700;
  font-size: 18px;
  color: white;
  background: #2D3E50;  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  box-sizing: border-box;
}
.login-btn:hover {
  transform: scale(1.08); 
}


/* Avatar Circle */
#user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid #2563eb;
  position: relative;
  display: none;
  z-index: 11001;
}
#user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Avatar Dropdown - White Design */
#avatar-dropdown {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  min-width: 160px;
  display: none;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  border: 1px solid #e5e7eb;
  padding: 0 !important;
  margin: 0 !important;
  flex-direction: column;
  align-items: stretch;
}

/* Email row */
#avatar-dropdown #user-role {
  padding: 6px 10px !important;
  margin: 0 !important;
  font-weight: bold;
  font-size: 13px !important;
  color: #111827 !important;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb !important;
  text-align: center;
  word-break: break-word;
  line-height: 1.3 !important;
  display: none;
}

/* Dropdown links (Profile + Logout) */
#avatar-dropdown a,
#avatar-dropdown a#logout-btn,
#avatar-dropdown a#profile-btn {
  display: block !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  color: #111827 !important;
  text-decoration: none;
  border-bottom: 1px solid #e5e7eb !important;
  transition: background 0.2s ease, color 0.2s ease;
}
#avatar-dropdown a:last-child {
  border-bottom: none !important;
}
#avatar-dropdown a:hover {
  background: #e0e7ff !important;
  color: #1e40af !important;
}
#avatar-dropdown.visible {
  display: block !important;
}

/* Content padding */
#main-content, #about-page {
  margin-left: 200px;
  padding-top: 120px;
  padding-left: 10px;
  padding-right: 20px;
  min-height: 100vh;
  max-width: 1900px;
  text-align: left;
}

/* Main Content */
.main-content {
  margin-left: 50px;
  padding: 20px;
  min-height: 100vh;
  box-sizing: border-box;
  color: white;
}


/* Login Modal */
#login-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  color: #000;
  width: 330px;
  max-width: 90vw;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: fadeInModal 0.3s ease forwards;
  box-sizing: border-box;
}
#login-modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: #000;
}
#login-modal input,
#login-modal select {
  width: calc(100% - 20px); 
  padding: 10px 12px;
  margin: 0 auto 12px auto; 
  border: 1.5px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  color: #000;
  background: #fff;
  display: block; 
  box-sizing: border-box; 
}
#login-modal input:focus,
#login-modal select:focus {
  outline: none;
  border-color: #2563eb;
}
#login-modal button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  box-sizing: border-box;
}
#login-modal #login-btn,
#login-modal #register-btn {
  background: #2563eb;
  color: #fff;
  margin-top: 8px;
}
#login-modal #login-btn:hover,
#login-modal #register-btn:hover {
  background: #1e4fc4;
}
.modal-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.modal-footer button {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9fafb;
  color: #000;
}
.modal-footer button:hover {
  background: #e5e7eb;
}
#login-error {
  color: red;
  margin-top: 10px;
  text-align: center;
}
#inventory-link {
  display: none;
  align-items: center;
  height: 80px;
}
#rooms-link a {
  color: white;
}
#rooms-link a:hover,
#rooms-link a.active {
  background: #2563eb;
  color: white;
}
#rooms-link a i {
  width: 28px;
  font-size: 22px;
  text-align: center;
  color: white;
}

/* Animation reused from inventory modals */
@keyframes fadeInModal {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 10px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* Smooth transition for toggling login/register */
.fade-transition h2,
.fade-transition input,
.fade-transition select,
.fade-transition button,
.fade-transition .modal-footer {
  opacity: 0;
  transform: translateY(-10px);
}
.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

/* Notification Button */
#notification-btn {
  color: #2D3E50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 20px;
  transition: color 0.3s ease;
}
#notification-btn:hover i {
  transform: scale(1.2);  
}
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
  display: none;
}

/* Notification Dropdown */
#notification-dropdown {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  min-width: 250px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
}
#notification-dropdown.visible {
  display: block;
}
#notification-dropdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#notification-dropdown ul li {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  color: #111827;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
#notification-dropdown ul li:hover {
  background: #f3f4f6;
}
#notification-dropdown .notif-empty {
  padding: 8px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}
#notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: red;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  position: absolute;
  top: -6px;
  right: -6px;
}
#notification-list li.fade-out {
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  transition: all 0.4s ease;
  overflow: hidden;
}

/* Bounce + fade animation for notification badge */
#notification-count.count-animate {
  animation: badgeBounce 0.4s ease;
}

@keyframes badgeBounce {
  0%   { transform: scale(1); opacity: 1; }
  40%  { transform: scale(1.3); opacity: 0.8; }
  70%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Side Navigation */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 240px;
  background: #2D3E50;
  padding: 20px 10px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.5);
  display: flex;          
  flex-direction: column;
  align-items: flex-start;
  z-index: 1000;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.25s ease;
}
#logo-link {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px !important;
}
.side-nav img.logo {
  width: 120px;
  display: block;
}
.side-nav ul {
  list-style: none;
  padding: 0;
  width: 100%;
  margin: 0;
}
.side-nav ul li {
  width: 100%;
  margin: 0 0 10px 0 !important;  
  padding: 0 !important;           
  height: auto !important;
}
.side-nav ul li a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px !important;
  border-radius: 6px;
  transition: background 0.3s;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  justify-content: flex-start !important;
}
.side-nav ul li a i {
  width: 28px;
  font-size: 18px;
  text-align: center;
  color: white;
}
.side-nav ul li a:hover,
.side-nav ul li a.active {
  background: #2563eb;
}
.side-nav ul li a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  padding: 12px 20px !important; 
  box-sizing: border-box;
}
#rooms-link {
  width: 100% !important;
}
#rooms-link-a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-left: 20px !important;  
  padding-right: 20px !important;
  box-sizing: border-box !important;
}
.side-nav.active {
  transform: translateX(0);
  opacity: 1;
}
body:not(.firebase-initialized) .side-nav {
  visibility: hidden;
}

/* Automate Button Styling */
#automate-btn {
  cursor: pointer;
  font-size: 22px;
  color: #2D3E50;              
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
#automate-btn:hover {
  transform: scale(1.3);      
}

/* ============================ */
/* LOGIN MODAL OPTIONS          */
/* ============================ */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-top: 6px;
}

.login-options a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-options a:hover {
  color: #2563eb;
}

/* ============================ */
/* FORGOT PASSWORD MODAL STYLES */
/* ============================ */
#forgot-password-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

#forgot-password-modal .modal-content {
  background: #1e293b;
  color: white;
  padding: 25px 30px;
  border-radius: 12px;
  width: 350px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

#forgot-password-modal input[type="email"] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  background: #0f172a;
  color: white;
  margin-top: 10px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.reset-message {
  font-size: 0.9rem;
  color: #93c5fd;
  margin-top: 10px;
  min-height: 20px;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-top: 8px;
}

.login-options .remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
  white-space: nowrap;
}

.login-options .remember-me input {
  margin: 0;
  position: relative;
  top: 5px;
  transform: translateY(1px);
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}


.login-options a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-options a:hover {
  color: #2563eb;
}
