.mobile-profile {
  display: none;
}

/* Technical details toggle link styles */
.tech-toggle {
  display: inline-block;
  font-size: 0.9em;
  color: #4CAF50;
  text-decoration: none;
  margin-bottom: 15px;
}

.tech-toggle:hover {
  text-decoration: underline;
}

/* Styling for tool calls and results when visible */
.tool-call, .tool-result {
  background-color: #f5f5f5;
  border-left: 3px solid #4CAF50;
  padding: 10px;
  margin: 10px 0;
  border-radius: 4px;
}

.tool-call h4, .tool-result h4 {
  margin-top: 0;
  color: #4CAF50;
  font-size: 0.9em;
}

/* Styling for simplified tool use and result indications */
.simplified-result, .simplified-tool {
  font-size: 0.85em;
  color: #666;
  padding: 5px 0;
  margin: 5px 0;
  border-top: 1px dashed #ddd;
  border-bottom: 1px dashed #ddd;
}

.simplified-tool {
  color: #777;
  font-style: italic;
}

/* Hidden message styling */
.hidden-message {
  opacity: 0.7;
  border-left: 3px solid #999;
  margin-left: 10px;
  padding-left: 10px;
}

.hidden-indicator {
  font-size: 0.8em;
  color: #666;
  margin-bottom: 5px;
  font-style: italic;
}
/* Markdown Content Styles */
.markdown-content {
  line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 1.2em;
  margin-bottom: 0.8em;
}

.markdown-content h1 {
  font-size: 1.8em;
}

.markdown-content h2 {
  font-size: 1.5em;
}

.markdown-content h3 {
  font-size: 1.3em;
}

.markdown-content p {
  margin-bottom: 1em;
}

.markdown-content ul,
.markdown-content ol {
  margin-left: 2em;
  margin-bottom: 1em;
}

.markdown-content li {
  margin-bottom: 0.5em;
}

.markdown-content pre {
  background-color: #f5f5f5;
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.markdown-content code {
  background-color: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: monospace;
}

.markdown-content blockquote {
  border-left: 4px solid #ddd;
  padding-left: 1em;
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
}

.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
}

.markdown-content table th,
.markdown-content table td {
  border: 1px solid #ddd;
  padding: 0.5em;
}

.markdown-content table th {
  background-color: #f5f5f5;
}

.markdown-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em 0;
}

.markdown-content a {
  color: var(--beaver-green);
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

/* Main Styles for Beaver App */

:root {
  --beaver-green: #4CAF50;
  --beaver-dark-green: #2E7D32;
  --text-color: #333333;
  --light-text-color: #666666;
  --border-color: #dddddd;
  --light-background: #f9f9f9;
  --white: #ffffff;
}

/* Global Styles */
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-color);
  background-color: var(--white);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--beaver-green);
  text-decoration: none;
}

a:hover {
  color: var(--beaver-dark-green);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  margin-top: 1em;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  height: 60px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 1001;
  background-color: var(--white);
}

.logo {
  font-family: 'Arial Black', Gadget, sans-serif;
  font-weight: bold;
  font-size: 28px;
  color: var(--beaver-green);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Header layout with right items group */
.header-right-items {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Avatar that only shows on mobile */
.mobile-only-avatar {
  display: none;
}

@media (max-width: 768px) {
  /* Show hamburger menu and user icon on mobile */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-only-avatar {
    display: block;
  }
  
  /* Hide the desktop avatar and navigation on mobile */
  header > div:last-child .user-initials {
    display: none;
  }
  
  .desktop-nav {
    display: none;
  }
}

/* Navigation */
nav {
  display: flex;
  align-items: center;
  margin-left: 40px;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  height: 100%;
}

nav ul li {
  margin-left: 20px;
  display: flex;
  align-items: center;
}

nav a {
  color: var(--text-color);
  font-weight: bold;
}

nav a:hover {
  color: var(--beaver-green);
}

/* Buttons */
.button {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--white);
  border: 2px solid var(--text-color);
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s;
  align-self: center;
}

.button:hover {
  color: var(--beaver-green);
  border-color: var(--beaver-green);
}

.button.primary {
  background-color: var(--beaver-green);
  border-color: var(--beaver-green);
  color: var(--white);
}

.button.primary:hover {
  background-color: var(--beaver-dark-green);
  border-color: var(--beaver-dark-green);
}

.button:disabled {
  background-color: #f5f5f5 !important;
  border-color: #ccc !important;
  color: #999 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.button.primary:disabled {
  background-color: #ccc !important;
  border-color: #ccc !important;
  color: #888 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.button:disabled:hover {
  background-color: #f5f5f5 !important;
  border-color: #ccc !important;
  color: #999 !important;
}

.button.primary:disabled:hover {
  background-color: #ccc !important;
  border-color: #ccc !important;
  color: #888 !important;
}

/* Form Elements */
input, textarea, select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--beaver-green);
  outline: none;
}

input:disabled, textarea:disabled, select:disabled {
  background-color: #f9f9f9 !important;
  color: #999 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

textarea[readonly] {
  background-color: #f9f9f9 !important;
  color: #666 !important;
  cursor: not-allowed !important;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Form Layouts */
.form-group {
  margin-bottom: 20px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--light-background);
  font-weight: bold;
}

/* User Avatar and Initials */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: border-color 0.3s;
}

.user-avatar:hover {
  border-color: var(--beaver-green);
}

.user-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--beaver-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.3s;
}

.user-initials:hover {
  background-color: var(--beaver-dark-green);
}

.user-initials-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--beaver-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 32px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Account Page Styles */
.account-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 0;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background-color: var(--light-background);
  border-radius: 8px;
}

.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.account-avatar-large {
  display: flex;
  justify-content: center;
  align-items: center;
}

.account-details h2 {
  margin-top: 0;
  margin-bottom: 5px;
}

.account-section {
  margin-bottom: 30px;
  padding: 20px;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.account-section h3 {
  margin-top: 0;
  color: var(--beaver-green);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.settings-item {
  padding: 10px 0;
  margin: 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-info {
  font-size: 0.9em;
  color: var(--light-text-color);
  margin-top: 15px;
}

/* Badge Styling */
.badge {
  display: inline-block;
  font-size: 0.75em;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  margin-left: 8px;
}

.proactive-badge {
  background-color: #9c27b0; /* Purple color for proactive */
  color: white;
}

/* Cards and Boxes */
.card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  margin: 0;
}

/* Hero Section */
.hero-container {
  position: relative;
  width: 100%;
  padding-bottom: 50px;
  border-radius: 15px;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  display: block;
  border-radius: 15px;
}

.hero-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-text h1 {
  font-family: 'Arial Black', Gadget, sans-serif;
  font-size: 144px;
  color: white;
  margin: 0;
  padding: 0;
  text-align: center;
  width: 60%;
}

/* Chat Styles */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  padding: 15px;
  border-radius: 10px;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
  background-color: var(--light-background);
}

.message.model {
  align-self: flex-start;
  background-color: #e6f7e7;
}

.message.tool_call {
  align-self: flex-start;
  background-color: #f0f0f0;
  font-family: monospace;
  white-space: pre-wrap;
  width: 90%;
}

.message.tool {
  align-self: flex-start;
  background-color: #e6eef7;
  font-family: monospace;
  white-space: pre-wrap;
  width: 90%;
}

.chat-input {
  margin-top: 20px;
}

/* System Prompt Styles */
.system-prompt-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  margin-bottom: 20px;
}

.system-prompt {
  background-color: #f6e8c5; /* A light amber color to differentiate */
  border-radius: 10px;
  padding: 15px;
  max-width: 80%;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-color);
}

/* Calendar Table */
.calendar-table input[type="radio"] {
  width: auto;
  margin: 0 5px;
}

/* Hamburger Menu */
.menu-toggle {
  display: none; /* Hide by default on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--beaver-green);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animation for hamburger menu icon */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  background-color: var(--white);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

@media (max-width: 768px) {
  /* Show hamburger menu on mobile */
  .menu-toggle {
    display: flex;
  }
  
  .mobile-nav {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }

  .mobile-nav.active {
    max-height: 300px; /* Adjust based on menu content */
  }
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-profile {
  padding: 20px 20px;
  background-color: var(--light-background);
  border-bottom: 1px solid var(--border-color);
}

.mobile-account-link {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-nav ul li {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  list-style-type: none;
  list-style-image: none;
}

.mobile-nav a {
  color: var(--text-color);
  font-weight: bold;
  display: block;
}

.mobile-nav a:hover {
  color: var(--beaver-green);
}

.mobile-logout-button {
  background: none;
  border: none;
  color: var(--text-color);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  text-align: left;
  width: 100%;
}

.mobile-logout-button:hover {
  color: var(--beaver-green);
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--light-text-color);
}

.empty-state h1 {
  color: var(--text-color);
  margin-bottom: 15px;
}

.empty-state p {
  font-size: 18px;
}

/* Mobile Thread Views Styling */
.mobile-back-button {
  display: none;
  padding: 10px 0 20px 0;
  margin-bottom: 15px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--beaver-green);
  font-weight: bold;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.back-arrow {
  margin-right: 8px;
  font-size: 20px;
}

.back-link:hover {
  text-decoration: none;
  border-bottom: 1px solid var(--beaver-green);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    padding: 0;
  }
  
  main {
    padding: 0 15px;
  }

  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.5em;
  }

  .hero-text h1 {
    font-size: 48px;
  }
  
  header {
    height: 60px;
    position: relative;
    padding: 0 15px;
    justify-content: space-between;
  }
  
  header > div:first-child {
    width: 100%;
    justify-content: space-between;
  }

  .logo {
    font-size: 24px;
  }
  
  /* Hide desktop nav and logout button in header */
  header nav.desktop-nav {
    display: none;
  }
  
  header form {
    display: none !important;
  }

  .message {
    max-width: 90%;
  }

  .button {
    padding: 8px 12px;
    font-size: 14px;
  }

  input, textarea, select {
    padding: 8px;
    font-size: 16px; /* Prevent zoom on focus in iOS */
  }

  table {
    font-size: 14px;
  }

  th, td {
    padding: 8px 5px;
  }

  .calendar-table {
    overflow-x: auto;
    display: block;
  }

  .form-actions {
    margin-top: 15px;
  }

  /* Increase tap target sizes for better mobile UX */
  nav ul li {
    margin-bottom: 10px;
  }

  /* Improved form spacing on mobile */
  .form-group {
    margin-bottom: 15px;
  }

  .card {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  /* Adjustments for chat interface on mobile */
  .chat-container {
    gap: 10px;
  }
  
  .message {
    padding: 12px;
    font-size: 15px;
    line-height: 1.4;
  }
  
  .chat-input textarea {
    min-height: 100px;
  }
  
  /* Better spacing for mobile forms */
  .form-actions .button {
    margin-left: auto;
  }
  
  /* Mobile Thread Views */
  .home-layout {
    display: block !important;
    gap: 0 !important;
  }
  
  .threads-sidebar {
    max-width: 100% !important;
    width: 100% !important;
    border-right: none !important;
    padding-right: 0 !important;
  }
  
  .thread-content {
    width: 100% !important;
  }
  
  /* Fix for new thread form visibility */
  .threads-sidebar:not(.mobile-hidden) + .thread-content {
    display: block;
  }
  
  @media (max-width: 768px) {
    /* On mobile, hide thread content by default */
    .thread-content {
      display: none !important;
    }
  
    /* Fix for new thread form visibility on mobile */
    .threads-sidebar:not(.mobile-hidden) + .thread-content {
      display: none !important;
    }
    
    /* When thread is selected, hide threads and show content */
    .mobile-hidden {
      display: none !important;
    }
  
    .mobile-visible {
      display: block !important;
    }
  
    /* Show back button when thread is selected */
    .mobile-back-button {
      display: none;
    }
  
    /* Only show back button in mobile view when thread is selected */
    .mobile-visible .mobile-back-button {
      display: block;
      position: sticky;
      top: 0;
      background-color: var(--white);
      z-index: 10;
      border-bottom: 1px solid var(--border-color);
      padding: 10px 0;
      margin-top: 0;
    }
  }
}
