/* app/static/nav.css */
:root {
  --header-height: 60px;
  --header-height-mobile: 56px;
  --button-size: 40px;
  --spacing: 1rem;
  --blur-background: #fff;
  --primary-color: #ED166C;
  --gray-50: #f8f9fa;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-700: #374151;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --sidebar-width: 250px;
  --input-container-height: 88px;
  --background-color: #f5f5f5;
}

.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 var(--spacing);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.menu-button {
  width: var(--button-size);
  height: var(--button-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.menu-button::before {
  content: "☰";
  font-size: 24px;
  color: var(--gray-700);
}

.menu-button:hover {
  background-color: var(--gray-100);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header img {
  height: 28px;
  width: auto;
}

.user-greeting {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-link {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  background: transparent;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover,
.nav-link:focus {
  background-color: var(--gray-100);
  outline: none;
}

/* Base active style for all nav links */
.nav-link.active {
  color: var(--primary-color);
  border: 1px solid currentColor;
}

/* Base style for account link */
.nav-link.account {
  color: var(--gray-700);
}

/* More specific rule for active account link */
.nav-link.account.active {
  color: var(--primary-color);
  border: 1px solid currentColor;
}

.nav-link.sign-out {
  background-color: var(--gray-100);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  padding-top: var(--header-height);
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--background-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: static;
  transform: none;
  transition: transform 0.3s ease;
  border-right: 1px solid var(--gray-200);
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.message-input-container {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  padding: 1rem;
  background: white;
  border-top: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  z-index: 30;
  width: calc(100% - var(--sidebar-width));
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  .header {
    height: var(--header-height-mobile);
    padding: 0 var(--spacing);
    background: var(--blur-background);
    backdrop-filter: blur(8px);
    z-index: 50;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 40;
    box-shadow: var(--shadow-md);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding-top: var(--header-height-mobile);
  }

  .message-input-container {
    left: 0;
    width: 100%;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .sidebar.active ~ .main-content .message-input-container {
    display: none;
  }

  .sidebar:not(.active) ~ .main-content .message-input-container {
    display: block;
  }

  .menu-button {
    margin-right: var(--spacing);
    display: flex;
  }

  .header-left,
  .header .nav-links {
    display: none;
  }
}

/* Desktop styles */
@media screen and (min-width: 769px) {
  .menu-button {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    transform: none;
    box-shadow: var(--shadow-sm);
    border-right: 1px solid var(--gray-200);
  }

  .main-content {
    margin-left: var(--sidebar-width);
  }

  .message-input-container {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  .header .nav-links {
    display: flex;
  }

  .sidebar .nav-links {
    display: none;
  }

  .header {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
  
  .chat-container {
    height: calc(100vh - var(--header-height) - var(--input-container-height));
    overflow-y: auto;
    padding: var(--spacing);
  }
}
