/* Layout principal : topbar, sidebar, main content, footer */

/* ========== Top bar (navbar) ========== */
.eqwiid-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--eqwiid-topbar-height);
  background-color: var(--eqwiid-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 1rem;
  padding-right: 1rem;
  z-index: 1030;
  box-shadow: var(--eqwiid-shadow);
}

@media (min-width: 992px) {
  .eqwiid-topbar {
    left: var(--eqwiid-sidebar-width);
    width: calc(100vw - var(--eqwiid-sidebar-width));
  }
}

.eqwiid-topbar-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin-left: 0.5rem;
}

.eqwiid-topbar-date {
  color: var(--eqwiid-white);
  font-size: 0.9rem;
  white-space: nowrap;
}

.eqwiid-topbar-user {
  color: var(--eqwiid-white);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.eqwiid-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.eqwiid-topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  color: var(--eqwiid-white);
  border-radius: var(--eqwiid-radius-sm);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.eqwiid-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--eqwiid-white);
  color: var(--eqwiid-white);
}

.eqwiid-topbar-btn.dropdown-toggle::after {
  margin-left: 0.25rem;
}

.eqwiid-topbar-dropdown {
  margin-top: 0.5rem;
  box-shadow: var(--eqwiid-shadow-lg);
  border-radius: var(--eqwiid-radius-sm);
}

.eqwiid-topbar-dropdown .dropdown-item:hover {
  background: var(--eqwiid-gray-100);
}

/* Notification dropdown popup */
.eqwiid-topbar-btn-notif {
  position: relative;
}

.eqwiid-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: var(--eqwiid-white);
  background: #e53935;
  border-radius: 8px;
}

.eqwiid-notif-dropdown {
  min-width: 320px;
  max-width: 380px;
  max-height: 400px;
  padding: 0;
  margin-top: 0.5rem;
  box-shadow: var(--eqwiid-shadow-lg);
  border-radius: var(--eqwiid-radius-sm);
  overflow: hidden;
}

.eqwiid-notif-dropdown-header {
  padding: 0.75rem 1rem;
  background: var(--eqwiid-gray-100);
  border-bottom: 1px solid var(--eqwiid-gray-200);
}

.eqwiid-notif-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.eqwiid-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--eqwiid-gray-200);
  transition: background 0.15s;
}

.eqwiid-notif-item:hover {
  background: #f5f5f5;
}

.eqwiid-notif-item:last-child {
  border-bottom: none;
}

.eqwiid-notif-unread {
  background: rgba(var(--eqwiid-primary-rgb), 0.08);
}

.eqwiid-notif-item-content {
  flex: 1;
  min-width: 0;
}

.eqwiid-notif-title {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.eqwiid-notif-message {
  font-size: 0.8rem;
  color: var(--eqwiid-gray-600);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.eqwiid-notif-date {
  font-size: 0.75rem;
  color: var(--eqwiid-gray-500);
}

.eqwiid-notif-mark-form {
  flex-shrink: 0;
  margin: 0;
}

.eqwiid-notif-mark-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--eqwiid-gray-300);
  border-radius: var(--eqwiid-radius-sm);
  color: var(--eqwiid-gray-600);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.eqwiid-notif-mark-btn:hover {
  background: var(--eqwiid-gray-100);
  border-color: var(--eqwiid-gray-400);
}

.eqwiid-notif-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--eqwiid-gray-500);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .eqwiid-topbar-left {
    display: none;
  }
  .eqwiid-topbar-right {
    gap: 0.5rem;
  }
}

.eqwiid-sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--eqwiid-white);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--eqwiid-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eqwiid-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (min-width: 992px) {
  .eqwiid-sidebar-toggle {
    display: none;
  }
}

/* ========== Sidebar ========== */
.eqwiid-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.eqwiid-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 992px) {
  .eqwiid-sidebar-overlay {
    display: none;
  }
}

.eqwiid-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--eqwiid-sidebar-width);
  height: 100vh;
  background: var(--eqwiid-primary);
  box-shadow: var(--eqwiid-shadow-lg);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.eqwiid-sidebar.show {
  transform: translateX(0);
}

@media (min-width: 992px) {
  .eqwiid-sidebar {
    transform: translateX(0);
    height: 100vh;
  }
}

.eqwiid-sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.eqwiid-sidebar-logo .eqwiid-logo-img {
  height: 2rem;
  max-height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.eqwiid-sidebar-logo:hover .eqwiid-logo-img {
  opacity: 0.95;
}

.eqwiid-sidebar-header {
  background: var(--eqwiid-primary-dark);
  padding: 1.25rem 1.25rem 1rem;
  color: var(--eqwiid-white);
}

.eqwiid-sidebar-header .eqwiid-user-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.15rem 0;
}

.eqwiid-sidebar-header .eqwiid-user-email {
  font-size: 0.8rem;
  opacity: 0.9;
  margin: 0;
}

.eqwiid-sidebar-header .eqwiid-guest-msg {
  font-size: 0.9rem;
  margin: 0;
}

.eqwiid-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.eqwiid-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 4px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.eqwiid-sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--eqwiid-white);
}

.eqwiid-sidebar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--eqwiid-white);
  border-left-color: var(--eqwiid-secondary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.eqwiid-sidebar-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0.25rem 1rem;
}

.eqwiid-sidebar-footer {
  padding: 1rem 1.25rem;
  background: var(--eqwiid-primary-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.eqwiid-sidebar-footer .nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-size: 0.9rem;
}

.eqwiid-sidebar-footer .nav-link:hover {
  color: var(--eqwiid-white);
}

.eqwiid-sidebar-footer .nav-link.logout {
  color: #ffcdd2;
  font-weight: 600;
}

.eqwiid-sidebar-footer .nav-link.logout:hover {
  color: #fff;
}

.eqwiid-sidebar-footer form {
  margin: 0;
}

.eqwiid-sidebar-footer form button {
  background: none;
  border: none;
  padding: 0.5rem 0;
  color: #ffcdd2;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.eqwiid-sidebar-footer form button:hover {
  color: #fff;
}

/* ========== Main content ========== */
.eqwiid-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: var(--eqwiid-topbar-height);
  min-height: calc(100vh - var(--eqwiid-topbar-height));
}

@media (min-width: 992px) {
  .eqwiid-main-wrap {
    margin-left: var(--eqwiid-sidebar-width);
  }
}

.eqwiid-main {
  flex: 1;
  padding: 1.5rem;
}

/* ========== Footer page ========== */
.eqwiid-page-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--eqwiid-gray-200);
  background: var(--eqwiid-white);
  color: var(--eqwiid-gray-500);
  font-size: 0.875rem;
}

.eqwiid-page-footer a {
  color: var(--eqwiid-primary);
}
