:root {
  --primary-color: #00b0f0;
  --primary-color-rgb: 0, 176, 240;
  --bg-color: #0f172a;
  --sidebar-bg: rgba(30, 41, 59, 0.7);
  --header-bg: rgba(15, 23, 42, 0.8);
  --surface-color: rgba(30, 41, 59, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --sidebar-width: 72px;
  /* collapsed default */
  --header-height: 64px;
}

/* App Grid Layout */
.app-layout {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main";
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded Navigation state */
.permanent-expanded-navigation .app-layout {
  --sidebar-width: 256px;
}

/* Top App Bar Header */
.top-app-bar {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  position: sticky;
  top: 0;
  height: var(--header-height);
  box-sizing: border-box;
}

.app-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-area {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--primary-color);
}

.nav-toggle-btn,
.back-btn,
.user-avatar-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.2s;
  outline: none;
}

.nav-toggle-btn:hover,
.back-btn:hover,
.user-avatar-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.location-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 16px;
}

.location-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.back-btn {
  display: none;
  /* hidden by default, shown if back-available */
}

.back-available .back-btn {
  display: flex;
}

/* User Account Dropdown Menu */
.app-bar-right {
  position: relative;
}

.user-dropdown-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  padding: 8px;
  min-width: 180px;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}

/* Dropdown open state */
.user-dropdown-menu[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-menu-header {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Sidebar Navigation Drawer */
.navigation-drawer {
  grid-area: sidebar;
  background-color: var(--sidebar-bg);
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-wrapper {
  padding: 12px 8px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Navigation Drawer Item Styling */
.nav-item-wrapper {
  border-radius: 12px;
  overflow: hidden;
  transition: background-color 0.2s;
  position: relative;
}

.cont {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.item-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  flex-grow: 1;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-item-wrapper:hover .item-link {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item-wrapper.active {
  background-color: rgba(0, 176, 240, 0.15);
}

.nav-item-wrapper.active .item-link {
  color: var(--primary-color);
  font-weight: 600;
}

.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.item-label {
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

/* Show labels only when navigation is expanded */
.permanent-expanded-navigation .item-label {
  opacity: 1;
  pointer-events: auto;
}

/* Expand Submenu icon-button styling */
md-icon-button {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 0.3s, background-color 0.2s;
  margin-right: 8px;
}

.permanent-expanded-navigation md-icon-button {
  display: flex;
}

md-icon-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item-wrapper.expanded md-icon-button {
  transform: rotate(180deg);
}

/* Submenu Lists */
.nav-item-wrapper ul {
  display: none;
  list-style: none;
  padding: 4px 0 4px 32px;
  margin: 0;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid rgba(255, 255, 255, 0.05);
  margin-left: 24px;
}

.permanent-expanded-navigation .nav-item-wrapper.expanded ul {
  display: flex;
}

.nav-item-wrapper ul .item-link {
  padding: 8px 12px;
  font-size: 0.875rem;
}

/* Main Content Wrapper */
.main-content {
  grid-area: main;
  padding: 24px;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
  box-sizing: border-box;
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast Snackbars style integration */
#snackbarContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
}

.snackbar {
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 18px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  min-width: 250px;
  max-width: 450px;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.snackbar.with-icon i {
  color: var(--primary-color);
}

.snackbar p {
  margin: 0;
  font-size: 0.9rem;
  flex-grow: 1;
}

.snackbar button {
  background-color: rgba(0, 176, 240, 0.15);
  color: var(--primary-color);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.snackbar button:hover {
  background-color: rgba(0, 176, 240, 0.25);
}

.snackbar.slideOutToBottom {
  animation: slideOutDown 0.2s forwards ease-in;
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(50px);
    opacity: 0;
  }
}

/* Material Icons class compatibility */
.material-icons {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
