/* ───── Color & font variables ───── */
:root {
  --bg-color:      #2a2a2a;
  --sidebar-bg:    #323232;
  --panel-bg:      #2a2a2a;
  --input-bg:      #2a2a2a;
  --border-color:  #3a3a3a;
  --border-hover:  #4a4a4a;
  --text-color:    #2d3748;
  --text-muted:    #6b7280;
  --accent:        rgb(235, 128, 5);
  --accent-hover:  rgb(235, 128, 5); 
  --accent-light:  #fef7ed;
  --success:       #059669; 
  --warning:       #d97706;
  --error:         #dc2626;
  --error-color:   #dc2626;
  --header-height: 60px;
  --font-family:   -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:     'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  --shadow-sm:     0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:     0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius-sm:     4px;
  --radius-md:     6px;
  --radius-lg:     8px;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color:      #2a2a2a;
    --sidebar-bg:    #1f1f1f; 
    --panel-bg:      #2a2a2a;
    --input-bg:      #3a3a3a;
    --border-color:  #3a3a3a;
    --border-hover:  #4a4a4a;
    --text-color:    #f4f4f4;
    --text-muted:    #dcd8d3;
    --accent:        #453b33;
    --accent-hover:  #C56548;
    --accent-light:  #E8F5E8;
    --shadow-sm:     0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md:     0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  }
}

:root {
  --drawer-open-height: 0px;
}


/* ───── Global Reset ───── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--border-color, #111) !important;
  overscroll-behavior: none;  
}

body {
  min-height: 100vh;              /* ensures background extends */
  height: auto;                   /* let body grow with content */
  display: flex;
  flex-direction: column;
  background: var(--border-color);
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  overflow-y: auto;
}

/* ───── Header ───── */
header.app-header {
  height: var(--header-height);
  background: var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  flex-shrink: 0;
}

header.app-header .header-content {
  display: flex;
  width: 100%;
  align-items: center;
}
header.app-header .navbar-brand {
  background: linear-gradient(90deg, #D97758 0%, #C56548 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  position: relative;
  border-left: 2.5px solid #D97758;
  padding-left: 6px;
  margin-left: -3px;
  margin-right: 2rem;  /* Add this for spacing */
  transition: all 0.2s ease;
}

header.app-header .nav-list {
  display: flex;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  gap: 1.5rem;
}

header.app-header .nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

header.app-header .nav-list a:hover {
  color: var(--text-color);
}

header.app-header .user-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-greeting {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ───── Login Page Styling ───── */
.login-container {
  max-width: 400px;
  margin: 8rem auto;
  padding: 3rem 2.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-container h2 {
  text-align: center;
  margin: 0 0 2.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #D97758 0%, #C56548 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}
.login-container h3 {
  text-align: center;
  margin: 0 0 2.5rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  background:linear-gradient(90deg, #D97758 0%, #C56548 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}

.login-container .error {
  background: var(--accent-light);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  text-align: center;
}

/* Form layout - STACK VERTICALLY */
.login-container form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-container .form-group {
  display: flex;
  flex-direction: column;
  margin: 0; /* Reset margin since we're using gap */
}

.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  padding: 1rem 1.25rem; /* Increased padding for larger input */
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-color);
  font-size: 1rem; /* Larger font size */
  font-family: var(--font-family);
  transition: all 0.15s ease;
  height: 48px; /* Explicit height for consistency */
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-color);
  box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.1);
}

.login-container input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.login-container .btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(90deg, #D97758 0%, #C56548 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s ease;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  height: 48px; /* Match input height */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem; /* Add some space before submit button */
}

.login-container .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 112, 67, 0.3);
}

.login-container .btn-primary:active {
  transform: translateY(0);
}

.login-container .register-prompt,
.login-container .text-muted {
  color: #6c757d !important;
}

.login-container a.text-muted:hover {
  color: #5a6268 !important;
}

/* Login icon using CSS */
.login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 2rem auto;
  background: linear-gradient(90deg, #D97758 0%, #C56548 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 15px rgba(255, 112, 67, 0.2);
}

.login-icon::before {
  content: '';
  width: 24px;
  height: 24px;
  background: white;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Alternative: User icon */
.login-icon.user::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Alternative: Lock icon */
.login-icon.lock::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Remove the old ::before pseudo element */
.login-container::before {
  display: none;
}

/* Background pattern remains the same */
body:has(.login-container) {
  background: var(--bg-color);
  position: relative;
}

body:has(.login-container)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 112, 67, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(241, 188, 110, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(205, 127, 50, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.login-container {
  position: relative;
  z-index: 1;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .login-container {
    background: var(--panel-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .login-container input[type="text"],
  .login-container input[type="password"] {
    background: var(--input-bg);
    color: var(--text-color);
  }
  
  .login-container input[type="text"]:focus,
  .login-container input[type="password"]:focus {
    background: var(--input-bg);
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.2);
  }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .login-container {
    margin: 4rem 1rem;
    padding: 2rem 1.5rem;
  }
  
  .login-container h2 {
    font-size: 1.5rem;
  }
  
  .login-icon {
    width: 56px;
    height: 56px;
  }
}

/* Animation */
.login-container {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ───── Logout Icon Styling ───── */
.logout-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  font-size: 0;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn::before {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

.logout-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: scale(1.05);
}

.logout-btn:hover::before {
  background: var(--accent);
}

/* Tooltip for logout icon */
.logout-btn::after {
  content: 'Logout';
  position: absolute;
  bottom: -30px;
  right: 0;
  background: var(--text-color);
  color: var(--bg-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.logout-btn:hover::after {
  opacity: 1;
}

/* Alternative styles for different looks */

/* Style 1: Minimal icon without border */
.logout-btn.minimal {
  border: none;
  background: transparent;
}

.logout-btn.minimal:hover {
  background: var(--accent-light);
}

/* Style 2: Filled background */
.logout-btn.filled {
  background: transparent;
  border: none;
}

.logout-btn.filled::before {
  background: white;
}

.logout-btn.filled:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

/* Style 3: Square with rounded corners */
.logout-btn.square {
  border-radius: var(--radius-sm);
}

/* Adjust user controls alignment */
.user-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-greeting {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.5rem;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .logout-btn {
    border-color: var(--border-color);
  }
  
  .logout-btn:hover {
    background: rgba(255, 112, 67, 0.1);
    border-color: var(--accent);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .logout-btn {
    width: 32px;
    height: 32px;
  }
  
  .logout-btn::before {
    width: 16px;
    height: 16px;
  }
  
  /* Hide tooltip on mobile */
  .logout-btn::after {
    display: none;
  }
  
  .user-greeting {
    display: none; /* Hide greeting on mobile to save space */
  }
}

/* ───── Three-column layout ───── */
#layout {
  position: relative; 
  display: grid;
  grid-template-columns: 0 1fr 1fr;
  grid-template-rows: 1fr auto auto auto;
  gap: 1px;
  flex-grow: 1;
  height: calc(100vh - var(--header-height));
  background: var(--border-color);
}
/* Styles for the Example queries section - Compact Version */
#example-queries {
  grid-column: 2 / 4;   /* already set earlier */
  grid-row: 3;
  background: transparent;
  max-height: 44px;
  overflow: hidden;
  transition: max-height .25s ease;
  margin-bottom: 1rem; 
}
#example-queries.open { max-height: 50vh; overflow: visible;  transform: translateY(0);     /* slide up */}

#example-queries .drawer-inner {
  margin: 0 10rem;            /* keep gutters */
  background: transparent;    /* was var(--border-color) */
  border: 0;                  /* remove border */
  border-radius: 0;           /* remove rounded corners */
  box-shadow: none;           /* remove shadow (the ‘boundary’ you see) */
  overflow: visible;   
  display: flex;
  flex-direction: column;
  height: 100%; 
}

#example-queries .tab-nav {
  position: sticky;
  top: 0;
  z-index: 1;                       /* ensure it stays above scrolling content */
  background: var(--panel-bg);          /* match panels */
  border: 1px solid var(--border-color);
  border-bottom: 0;                      /* merges with content */
  border-radius: 8px ;
  padding: .25rem .75rem;
  backdrop-filter: none;                 /* optional: kill blur to reduce halo */
}

#example-queries .tab-content {
  background: var(--panel-bg);       
  overflow-y: auto;      
  border: 1px solid var(--border-color);
  border-top: 0;                         /* merges with tab bar */
  border-radius: 0 0 8px 8px;            /* optional: match your style */
  padding: .5rem 1rem .75rem 1rem;
}

/* 4) (Optional) If you still see a faint edge, force it invisible */
#example-queries .tab-nav,
#example-queries .tab-content {
  box-shadow: none !important;
}

/* Optional: add a chevron toggle affordance on the right side */
#example-queries .drawer-toggle {
  transform: rotate(180deg);
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #a0a0a0;
  font-size: .8rem;
  cursor: pointer;
}

#example-queries.open .drawer-toggle { transform: rotate(0deg); }

/* Tab content padding lives inside the drawer body */
#example-queries .tab-content {
  padding: .5rem 1rem .75rem 1rem; /* inner padding only */
}

/* Mobile: reduce side gutters */
@media (max-width: 768px) {
  #example-queries .drawer-inner {
    margin: 0 1rem;
  }
}

#example-queries h3 {
  margin-bottom: 0.5rem; /* Reduced from 1.5rem */
  font-size: 0.85rem; /* Reduced from 1.1rem */
  font-weight: 200;
  color: var(--text-muted);;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#example-queries ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem; /* Reduced from 1rem */
  
}

#example-queries li {
  padding: 0.7rem 1rem; /* Reduced from 1rem 1.5rem */
  cursor: pointer;
  color:var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px; /* Reduced from 6px */
  transition: all 0.3s ease;
  font-size: 0.75rem; /* Reduced from 0.9rem */
  line-height: 1.1; /* Reduced from 1.5 */
  position: relative;
}

#example-queries li:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-hover);
  transform: translateX(2px); /* Reduced from 4px */
  color: white;
}

#example-queries li:before {
  content: "→";
  position: absolute;
  left: 0.4rem; /* Reduced from 0.5rem */
  color: var(--accent-hover);
  opacity: 0;
  transition: opacity 0.3s ease;
}


/* Responsive design */
@media (max-width: 768px) {
  #example-queries {
    padding: 1rem; /* Reduced from 1.5rem */
    grid-column: 1 / -1; /* Full width on mobile */
  }
  
  #example-queries li {
    padding: 0.6rem 0.8rem; /* Reduced from 0.8rem 1rem */
    font-size: 0.75rem; /* Reduced from 0.85rem */
  }
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  color: #a0a0a0;
  font-size: 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
}

.tab-btn:hover {
  color: #d0d0d0;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: white;
  border-bottom-color: var(--accent-hover);
}

/* Tab content */
.tab-content {
  position: relative;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
/* HELP TAB STYLING - Simple information cards, NOT clickable */
#tab-help li[role="listitem"] {
    background: transparent;
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.75;
    margin-bottom: 1px;
    cursor: default !important;
    pointer-events: none !important; /* This completely disables clicking */
}

#tab-help li[role="listitem"]::before {
    content: "ℹ️";
    margin-right: 1px;
}

#tab-help strong {
    color: var(--accent-hover);
    font-weight: 600;
}

#tab-help em {
    color: var(--accent-hover);
    font-style: italic;
}

/* Ensure prompts tab items remain clickable */
#tab-prompts li[role="listitem"] {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Feedback form inside the drawer */
.feedback-form {
  display: grid;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.75rem 0.5rem;
}

.feedback-form .row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feedback-form label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feedback-form input[type="text"],
.feedback-form input[type="email"],
.feedback-form textarea {
  background: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font: inherit;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-form .actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fb-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}


.feedback-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

/* ═══════════════════════════════════════════════════════════════
   PURE MINIMALIST CHAT - Reduced margins
   ═══════════════════════════════════════════════════════════════ */

/* Main chat container */
#copilot {
  grid-column: 2;
  grid-row: 1;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 40vh;
  margin: 0;
}

/* Messages container - REDUCED PADDING */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.5rem;  /* Reduced from 3rem */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;  /* Reduced from 2rem */
  scroll-behavior: smooth;
}

/* Invisible scrollbar */
.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Message blocks - pure text */
.message {
  width: 100%;
  padding: 0;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1a1a1a;
  max-width: none;  /* Use full width */
}

/* User messages - slightly dimmed */
.message.user {
  opacity: 0.7;
}

/* Bot messages - full opacity */
.message.bot {
  opacity: 0.9;
}

/* Remove all decorative pseudo elements */
.message.user::before,
.message.bot::before,
.message.user::after,
.message.bot::after {
  display: none;
}

/* Typography - TIGHTER SPACING */
.message p {
  margin: 0 0 0.75rem 0;  /* Reduced from 1rem */
}

.message p:last-child {
  margin-bottom: 0;
}

.message h1,
.message h2,
.message h3 {
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;  /* Reduced margins */
  color: inherit;
}

.message h1 { font-size: 1.4rem; }
.message h2 { font-size: 1.2rem; }
.message h3 { font-size: 1.05rem; }

/* Lists */
.message ul,
.message ol {
  margin: 0 0 0.75rem 0;  /* Reduced from 1rem */
  padding-left: 1.5rem;
}

.message li {
  margin: 0.25rem 0;
}

/* Code */
.message code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.9em;
}

.message pre {
  background: rgba(0, 0, 0, 0.03);
  border-left: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
  padding: 0.75rem;  /* Reduced from 1rem */
  margin: 0 0 0.75rem 0;
  overflow-x: auto;
}

.message pre code {
  background: none;
  padding: 0;
  display: block;
}

/* Links */
.message a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.3);
  text-underline-offset: 2px;
}

.message a:hover {
  text-decoration-color: rgba(0, 0, 0, 0.6);
}

/* Strong */
.message strong {
  font-weight: 600;
}

/* Blockquotes */
.message blockquote {
  border-left: 2px solid rgba(0, 0, 0, 0.1);
  padding-left: 0.75rem;  /* Reduced from 1rem */
  margin: 0 0 0.75rem 0;
  opacity: 0.8;
}

/* Tables */
.message table {
  width: 100%;
  margin: 0 0 0.75rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.message th {
  padding: 0.4rem;  /* Reduced from 0.5rem */
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.message td {
  padding: 0.4rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Task messages - minimal */
.task-queued {
  font-size: 0.9rem;
  opacity: 0.8;
}

.task-id {
  font-family: 'SF Mono', Consolas, monospace;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  #copilot {
    border-right-color: rgba(255, 255, 255, 0.08);
  }
  
  .messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .message {
    color: whitesmoke;
  }
  
  .message.user {
    opacity: 0.8;
  }
  
  .message code {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .message pre {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(255, 255, 255, 0.1);
  }
  
  .message a {
    text-decoration-color: rgba(255, 255, 255, 0.3);
  }
  
  .message a:hover {
    text-decoration-color: rgba(255, 255, 255, 0.6);
  }
  
  .message blockquote {
    border-left-color: rgba(255, 255, 255, 0.1);
  }
  
  .message th {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  .message td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
  
  .task-id {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Remove all animations and transitions */
.message {
  animation: none;
  transition: none;
}

.message:hover {
  transform: none;
  box-shadow: none;
}

/* Mobile - EVEN TIGHTER */
@media (max-width: 768px) {
  .messages {
    padding: 1rem;  /* Very tight on mobile */
    gap: 1.25rem;
  }
}

/* ───── Input & Upload area ───── */
#input-area {
  grid-column: 2;
  grid-row: 2;
  background: black;
  padding: 1rem;

  display: flex;
  flex-direction: column;
  align-items: stretch;      /* was center */
  /* max-height: 65px;      <-- REMOVE this */
  height: auto;

  border-radius: 16px;
  margin: 0.5rem 0.5rem 0.5rem 10rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#input-container {
  flex: 1;
  display: flex;
  align-items: stretch;      /* let children set the height */
  gap: 0.75rem;
  background: transparent;
}

#messageInput {
  flex: 1;
  background: black;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-color);
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.2;
  font-family: inherit;
  transition: border-color 0.15s ease;

  resize: none;
  overflow-y: auto;     /* ✅ scroll vertically when needed */
  overflow-x: hidden;
  min-height: 1.2rem;   /* one-line starting height */
  max-height: 40vh;     /* stop growing here */

  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}


#messageInput:focus {
  outline: none;
  border-color: var(--accent);
}

#messageInput::placeholder {
  color: var(--text-muted);
}

#sendBtn {
  width: 30px;
  height: 30px;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  font-size: 0;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sendBtn:hover {
  background: var(--accent-hover);
  border-color: var(--accent);
}

#sendBtnText {
  display: none;
}

#sendBtn::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--text-muted); /* ← This controls the color */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center/contain no-repeat;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='19' x2='12' y2='5'/%3E%3Cpolyline points='5 12 12 5 19 12'/%3E%3C/svg%3E") center/contain no-repeat;
  transform: none; /* Remove rotation */
}

#sendBtn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

#sendBtn:disabled::before {
  opacity: 0.5;
}


/* 1) common circle shape */
.action-btn {
  width: 62px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}
.action-btn:hover {
  background: var(--accent-hover);
}

/* 3) Stop icon: white square “stop” inside a red circle */
#stopBtn {
  background: var(--error-color);
}
#stopBtn::before {
  content: '';
  width: 12px;
  height: 12px;
  background: white;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* 4) hide/show helper */
.hidden { display: none !important; }

/* 5) layout: keep them tight to the right of the input */
.input-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 0.5rem; /* space from the input field */
}



/* The actual spin animation keyframes */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


/* ───── Output Window Container ───── */

/* ───── Output Window Container ───── */
#output-window {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - var(--header-height));
  background: #0a0a0a;
  border-left: 1px solid #222;
  color: #1a1a1a; 
  overflow: hidden; /* inner sections scroll, not container */
}



/* Tabs row (fixed height at top) */
#output-window .tabs {
  flex: 0 0 auto;
  display: flex;
  background: #111;
  border-bottom: 1px solid #2a2a2a;
  color:whitesmoke;
}
#output-window .tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.5rem;
  color: whitesmoke;
  font-size: 0.8rem;
  cursor: pointer;
}
#output-window .tab-btn.active {
  color: whitesmoke;
  border-bottom: 2px solid var(--accent);
}

/* Default: all tab contents hidden */
#output-window .tab-content {
  flex: 1 1 auto;      /* take remaining space */
  min-height: 0;       /* critical for scroll areas */
  overflow: hidden;    /* let children scroll */
  display: none;       /* hidden until active */
  padding: 1rem;
}

/* Active tab shows and stretches */
#output-window .tab-content.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;   /* allow children to scroll */
  overflow: hidden;
}



/* Progress tab */
#tab-progress {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}


#tab-code .code-block { 
  flex: 1 1 auto; min-height: 0; 
  overflow: auto; /* enables scroll when content exceeds */ 
  scroll-behavior: smooth;
} 
#tab-code pre { 
  margin: 0; /* remove extra whitespace */ 
    font-family: var(--font-mono, monospace); font-size: 0.85rem; 
    line-height: 1.4; white-space: pre-wrap; /* wrap long lines instead of horizontal scroll */ 
    word-break: break-word; /* break very long tokens */ 
  }

#tab-report,
#tab-code,
#tab-output {
  color: whitesmoke;   /* unify all tab text with copilot */
}

#tab-report {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Container doesn't scroll */
}

#tab-report .report-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto; /* This element scrolls */
}




/* ───── File Upload ───── */
#upload-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  #output-window,
  #output-window .tab-content,
  #output-window .progress-logs,
  #output-window .report-body,
  #output-window .code-block,
  #output-window .output-block {
    color:  whitesmoke;  
  }
}
/* ───── Container & Job Status Page Styling ───── */
.container {
  margin: 2rem auto;
  max-width: 800px;
  padding: 2rem;
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  color: var(--text-color);
}

.container h2 {
  margin-top: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 2rem;
  letter-spacing: -0.025em;
}

.container h3 {
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  letter-spacing: -0.025em;
}

.container h4 {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
  letter-spacing: -0.025em;
}

/* ───── Form styling ───── */
form {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

#jobId {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: border-color 0.15s ease;
}

#jobId:focus {
  outline: none;
  border-color: var(--accent);
}

#jobId::placeholder {
  color: var(--text-muted);
}

button[type="submit"] {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
  font-family: var(--font-family);
}

button[type="submit"]:hover {
  background: var(--accent-hover);
}

button[type="submit"]:active {
  transform: translateY(1px);
}


/* ───── Progress bar styling ───── */
.progress-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: var(--radius-sm);
}

/* ───── Base Upload Icon Styles (ADD THIS FIRST) ───── */
.upload-icon {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;

  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  position: relative;
}

.upload-icon:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.upload-icon:active {
  transform: translateY(0);
}

/* Base icon (default plus sign) */
.upload-icon::before {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ───── Icon Variations (your existing code) ───── */
.upload-icon.cloud::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z'/%3E%3Cpolyline points='16 16 12 12 8 16'/%3E%3Cline x1='12' y1='16' x2='12' y2='21'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z'/%3E%3Cpolyline points='16 16 12 12 8 16'/%3E%3Cline x1='12' y1='16' x2='12' y2='21'/%3E%3C/svg%3E") center/contain no-repeat;
}

.upload-icon.paperclip::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66L9.64 16.2a2 2 0 0 1-2.83-2.83l8.49-8.49'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66L9.64 16.2a2 2 0 0 1-2.83-2.83l8.49-8.49'/%3E%3C/svg%3E") center/contain no-repeat;
}

.upload-icon.plus::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* ───── Loading & Hidden Elements ───── */

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ───── Scrollbar Styling ───── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Custom scrollbar for result area */
#result::-webkit-scrollbar {
  width: 6px;
}

#result::-webkit-scrollbar-track {
  background: transparent;
}

#result::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

#result::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ───── Responsive Design ───── */
@media (max-width: 1200px) {
  #layout {
    grid-template-columns: 220px 1fr 1fr;
  }
  
  header.app-header {
    padding: 0 1rem;
  }
  
  header.app-header .nav-list {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  #layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }


  #output-window {
    display: none;
  }
  
  header.app-header .nav-list {
    display: none;
  }
  
  /* Container responsive styles */
  .container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  form {
    flex-direction: column;
    gap: 1rem;
  }
  
  #jobId {
    width: 100%;
    color:white;
  }
  
  button[type="submit"] {
    width: 100%;
  }
  
  .progress-info {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
 
}



/* Button styles for task controls */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary {
  background: var(--accent);
  color: white;
}

.btn-secondary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

#task-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Progress styling enhancement */
/* Progress tab container */


.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* small muted lines inside the result box */
.progress-log {
  font-family: monospace;
  font-size: 0.9em;
  margin: 0.25em 0;
  color: var(--muted-text);
}


.upload-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.upload-progress-bar {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}


.datacontainer {
  max-width: 1200px;
  margin: 0 auto; /* Centers the container */
  padding: 0 20px; /* Adds some side padding */
}

.table-container {
  max-height: 60vh;
  overflow-y: auto;
  width: 100%; /* Takes full width up to max-width */
  padding: 1.5rem;
  margin-top: 1rem;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.table-container:hover {
  border-color: var(--border-hover);
}

/* Optional: Style the scrollbar */
.table-container::-webkit-scrollbar {
  width: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: var(--sidebar-bg);
  border-radius: var(--radius-sm);
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Ensure table header stays visible when scrolling */
.table-container thead th {
  position: sticky;
  top: 0;
  background-color: var(--accent-hover);
  border-bottom: 2px solid var(--border-color);
  z-index: 1;
}

#dataUploadBtn {
  background: red;
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
  font-family: var(--font-family);
}

#dataUploadBtn:hover {
  background: var(--accent-hover);
}

#dataUploadBtn:active {
  transform: translateY(1px);
}


.task-id {
  font-family: var(--font-mono);
  color: var(--accent-hover);
  padding: 0.1rem 0.1rem;
  border-radius: 2px;
  font-weight: 200;
}

.spa-hidden {
  display: none !important;
}

/* Usage Display Component */
.usage-display {
  position: relative;
  margin-right: 1rem;
  cursor: pointer;
}

.usage-tooltip {
  position: relative;
}

.usage-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  transition: background 0.2s ease;
}

.usage-summary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.usage-tier {
  font-size: 0.75rem;
  font-weight: bold;
  min-width: 3rem;
}

.tier-free { color: #94a3b8; }
.tier-pro { color: #3b82f6; }
.tier-enterprise { color: #f59e0b; }

.usage-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.usage-bar {
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.usage-normal { background: #22c55e; }
.usage-warning { background: #f59e0b; }
.usage-critical { background: #ef4444; }

.usage-details {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  padding: 1rem;
  background: #4a4a4a;
  border: 1px solid #4a5568;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  z-index: 1000;
  color: white;
}

.usage-details::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #4a5568;
}

.usage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.usage-item:last-child {
  margin-bottom: 0;
}

.usage-period {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #4a5568;
  font-size: 0.75rem;
  color: #a0aec0;
}

.upgrade-link {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #4a5568;
}

.upgrade-link a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.upgrade-link a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Upgrade Modal */
#upgrade-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: red(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: #2d3748;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #4a5568;
}

.modal-header h3 {
  margin: 0;
  color: white;
}

.modal-header button {
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 1.5rem;
  color: white;
}

.plan-options {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.plan-card {
  border: 1px solid #4a5568;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  background: #374151;
}

.plan-card h4 {
  margin: 0 0 0.5rem 0;
  color: #f59e0b;
}

.plan-card p {
  margin: 0.5rem 0;
  color: #d1d5db;
}

.plan-card .price {
  font-size: 1.25rem;
  font-weight: bold;
  color: white;
  margin: 1rem 0;
}

/* Toast modifications for usage messages */
.toast.usage-limit {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.toast.usage-limit .toast-body {
  color: #92400e;
}

/* Responsive design */
@media (max-width: 768px) {
  .usage-display {
    margin-right: 0.5rem;
  }
  
  .usage-summary {
    padding: 0.25rem 0.5rem;
  }
  
  .usage-details {
    right: -50px;
    min-width: 180px;
  }
  
  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
}


.streaming-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
}

.streaming-content {
  flex: 1;
  overflow-y: auto;
}

.streaming-code, .streaming-text {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1rem;
  color: #e6e6e6;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.code-result, .progress-logs {
  background: var(--panel-bg);
  border-radius: 4px;
  padding: 1rem;
  margin: 0.5rem 0;
}

/* Profile page - Dark theme with proper width */
.profile-container { 
  max-width: 1200px !important; /* Match other pages */
  width: 100% !important;
  margin: 2rem auto !important;
  padding: 2rem !important;
  background: transparent!important;
  border-radius: 12px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Override the global form rule that's breaking layout */
/* Add to style.css - Force profile form to NOT be flex */
.profile-container .profile-form {
  display: flex !important;
  flex-direction: column !important; /* Stack vertically */
  gap: 2rem !important;
  align-items: stretch !important; /* Override the center alignment */
}

.profile-container .form-section {
  background: #3a3a3a !important;
  border: 1px solid #4a4a4a !important;
  padding: 2rem !important;
  margin-bottom: 2rem !important;
  max-width: 100% !important; /* Ensure sections use full width */
}

/* Force form grids to work properly */
.profile-container .form-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.5rem !important;
}

.profile-container .password-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1rem !important;
}

/* Override all the inline styles */
.profile-container,
.profile-container * {
  color: #e6e6e6 !important;
}

.profile-container {
  max-width: 1200px !important;
  background: #323232 !important;
}

/* Profile page - Force dark theme and proper input styling */
.profile-container .form-input {
  background: #2a2a2a !important;
  border: 1px solid #4a4a4a !important;
  color: #e6e6e6 !important;
  padding: 0.875rem 1.25rem !important;
  font-size: 1rem !important;
  width: 100% !important;
}

.profile-container .form-input::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
}

.profile-container .form-input:focus {
  background: #2a2a2a !important;
  border-color: rgb(235, 128, 5) !important;
  box-shadow: 0 0 0 3px rgba(235, 128, 5, 0.2) !important;
  color: #e6e6e6 !important;
}

/* Force all text in profile to be light */
.profile-container,
.profile-container .form-label,
.profile-container .form-hint,
.profile-container .section-description,
.profile-container h2,
.profile-container h3 {
  color: #e6e6e6 !important;
}

/* Scientific Action Buttons */
.action-button {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #9ca3af;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.action-button:hover {
  background: rgba(125, 211, 192, 0.1);
  border-color: #7dd3c0;
  color: #7dd3c0;
}

.action-button.primary {
  background: #7dd3c0;
  border-color: #7dd3c0;
  color: #0a0a0a;
  font-weight: 500;
}

.action-button.primary:hover {
  background: #C56548;
  border-color: #C56548;
}

/* Code block styling - ADD or UPDATE these */
.code-block {
  margin: 1.5rem;
  background: #111111;
  border-radius: 8px;
  overflow: hidden;
}

.code-header {
  background: #1a1a1a;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a2a;
}

.code-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 500;
}

/* FIX: Constrain icon size */
.code-icon {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  color: #7dd3c0;
}

.code-actions {
  display: flex;
  gap: 0.5rem;
}

.code-action {
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #6b7280;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.code-action:hover {
  background: rgba(125, 211, 192, 0.1);
  border-color: #7dd3c0;
  color: #7dd3c0;
}

.code-content {
  padding: 1.25rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #d1d5db;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* Similarly for output blocks */
.output-icon {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  color: #C56548;
}


.task-id-copyable {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.9em;
  background: rgba(0, 137, 123, 0.1);
  color: #C56548;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 137, 123, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: all;
  display: inline-block;
}

.task-id-copyable:hover {
  background: rgba(0, 137, 123, 0.2);
  border-color: #C56548;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 137, 123, 0.2);
}

.task-id-copyable:active {
  transform: translateY(0);
}

.copy-icon {
  font-size: 0.8em;
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.2s ease;
}


.copy-feedback {
  display: none;
  color: #D97758 ;
  font-size: 0.85em;
  font-weight: 500;
  margin-left: 0.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Tooltip on hover */
.task-id-copyable::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #e6e6e6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  margin-bottom: 0.25rem;
}

.task-id-copyable:hover::before {
  opacity: 1;
}

.provenance-block h3 {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #7dd3c0;
}
.provenance-block ul {
  margin: 0.5rem 0 1rem 1.25rem;
}
.provenance-block li {
  margin: 0.25rem 0;
  font-family: var(--font-mono);
}

