/* --- Enhanced Insights Card Styling --- */
.insights-card {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    max-width: 100%;
    position: relative;
}

.insights-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #3b82f6;
}

/* Consistent featured styling for both suggestion-card and insights-card */
.insights-card.featured,
.suggestion-card.featured {
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.1) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(34, 197, 94, 0.08)) !important;
    position: relative;
    transform: translateY(-2px);
}

.insights-card.featured::before,
.suggestion-card.featured::before {
    content: '⭐ FEATURED';
    position: absolute;
    top: -1px;
    left: -1px;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px 4px 12px 4px;
    z-index: 2;
    letter-spacing: 0.025em;
}

.insights-card.featured::after,
.suggestion-card.featured::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(34, 197, 94, 0.03));
    border-radius: 12px;
    z-index: 1;
    pointer-events: none;
}

/* Consistent locked styling for both suggestion-card and insights-card */
.insights-card.locked,
.suggestion-card.locked {
    background: rgba(248, 250, 252, 0.9) !important;
    border: 2px dashed #d1d5db !important;
    opacity: 0.8;
    cursor: not-allowed;
    filter: grayscale(0.3);
    position: relative;
}

.insights-card.locked::before,
.suggestion-card.locked::before {
    content: '🔒 LOCKED';
    position: absolute;
    top: -1px;
    right: -1px;
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px 12px 4px 12px;
    z-index: 2;
    letter-spacing: 0.025em;
}

.insights-card.locked:hover,
.suggestion-card.locked:hover {
    transform: none !important;
    border-color: #d1d5db !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1) !important;
}

.insights-card-header {
    padding: 1.25rem;
    width: 100%;
}



.insights-card {
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.insights-card-body {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 20px 20px;
    padding: 1rem;
    width: calc(100% + 2.5rem);
    margin: -1rem -1.25rem -1.25rem -1.25rem;
}

.team-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

/* Enhanced odds grid styling */
.odds-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.odds-grid > div {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    backdrop-filter: blur(5px);
}

/* Prediction main section */
.prediction-main {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.05) 100%);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.league-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: rgba(59,130,246,0.08);
    border-radius: 6px;
    border: 1px solid rgba(59,130,246,0.2);
}

.league-info img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.league-info span {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
}

.team-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    max-width: 80px;
}

.team-block img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    margin-bottom: 0.5rem;
    object-fit: cover;
}

.team-block span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
    min-width: 60px;
}

.vs-section span:first-child {
    font-size: 0.65rem;
    color: #6b7280;
    margin-bottom: 0.125rem;
}

.vs-section span:nth-child(2) {
    font-size: 1rem;
    font-weight: bold;
    color: #374151;
}

.vs-section span:nth-child(3),
.vs-section span:nth-child(4) {
    font-size: 0.65rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.insights-card-body {
    padding: 1rem;
}

.prediction-main {
    text-align: center;
    padding: 0.875rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 8px;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.prediction-main div:first-child {
    font-size: 0.7rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-main div:nth-child(2) {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.prediction-main div:nth-child(3),
.prediction-main div:nth-child(4) {
    font-size: 0.75rem;
    opacity: 0.9;
}

.odds-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.odds-grid > div {
    text-align: center;
    padding: 0.625rem 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.odds-grid > div:nth-child(1) {
    border-left-color: #22c55e;
}

.odds-grid > div:nth-child(2) {
    border-left-color: #f59e0b;
}

.odds-grid > div:nth-child(3) {
    border-left-color: #ef4444;
}

.odds-grid div div:first-child {
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.odds-grid div div:last-child {
    font-size: 1rem;
    font-weight: bold;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stats-grid > div {
    padding: 0.625rem;
    border-radius: 6px;
    text-align: center;
}

.stats-grid div div:first-child {
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.stats-grid div div:last-child {
    font-size: 0.95rem;
    font-weight: bold;
}

.form-section {
    margin-bottom: 1rem;
}

.form-section > div:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #6b7280;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-section > div:last-child {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.form-section > div:last-child > div {
    text-align: center;
}

.form-section > div:last-child > div > div:first-child {
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.form-section > div:last-child > div > div:last-child {
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.h2h-section > div:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #6b7280;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.h2h-section > div:last-child {
    background: #f8fafc;
    border-radius: 6px;
    padding: 0.75rem;
}

.h2h-section > div:last-child > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.8rem;
}

.h2h-section > div:last-child > div:last-child {
    border-bottom: none;
}

.h2h-section > div:last-child > div > span:nth-child(2) {
    font-weight: bold;
    color: #3b82f6;
    font-size: 0.85rem;
}

/* Filter Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    margin-top: 1.25rem;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px 12px 0 0;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Webkit scrollbar styling for better appearance */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,0.3);
}

/* Custom Range Slider Styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #2563eb;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

input[type="range"]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #2563eb;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

/* Filter button hover effect */
#filter-btn:hover {
  background: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

/* Modal button styles */
.modal-actions button {
  transition: all 0.2s ease;
}

.modal-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#clear-filters:hover {
  background: #4b5563 !important;
}

#cancel-filters:hover {
  background: #d1d5db !important;
}

#apply-filters:hover {
  background: #2563eb !important;
}

/* League search dropdown styles */
.league-option:hover {
  background-color: #f8fafc !important;
  transition: background-color 0.2s ease;
}

.league-option:active {
  background-color: #e2e8f0 !important;
}

.league-option.premium:hover {
  background-color: #fef3cd !important;
}

.league-option.premium {
  background-color: #f9f9f9 !important;
  opacity: 0.7;
}

#league-dropdown {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: white;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Webkit scrollbar styling for league dropdown */
#league-dropdown::-webkit-scrollbar {
  width: 6px;
}

#league-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

#league-dropdown::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}

#league-dropdown::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,0.3);
}

#league-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Premium upgrade message styling */
.premium-message {
  background: linear-gradient(135deg, #fef3cd 0%, #fde047 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
}

.premium-message h3 {
  color: #92400e;
  margin-bottom: 0.5rem;
}

.premium-message p {
  color: #78350f;
  margin-bottom: 1rem;
}

/* Mobile responsiveness for modal */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
  }
  
  .filter-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .modal-actions {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .modal-actions > div {
    width: 100%;
    display: flex !important;
    gap: 0.75rem !important;
  }
  
  .modal-actions button {
    flex: 1;
  }
}

/* Ultra-small screens - Insights cards specific responsiveness */
@media (max-width: 450px) {
  /* Force full viewport width and prevent overflow */
  html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .container {
    width: 100vw;
    max-width: 100vw;
    padding: 0.5rem;
    margin: 0;
    box-sizing: border-box;
  }
  
  .header-container {
    width: 100vw;
    max-width: 100vw;
    padding: 0 0.5rem;
    margin: 0;
    box-sizing: border-box;
  }
  
  #insightsGrid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 1rem 0 0 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  .insights-card, .suggestion-card {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    margin: 0 0 0.75rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
  }
  
  .insights-card-header {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    box-sizing: border-box;
  }
  
  .insights-card-body {
    width: calc(100% + 1.5rem);
    padding: 0.75rem;
    margin: -0.75rem -0.75rem -0.75rem -0.75rem;
    box-sizing: border-box;
  }
  
  .team-matchup {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .team-block {
    max-width: 65px;
    min-width: 55px;
    flex: 0 0 65px;
    overflow: hidden;
    text-align: center;
  }
  
  .team-block img {
    width: 28px;
    height: 28px;
    margin-bottom: 0.25rem;
    border-radius: 50%;
  }
  
  .team-block span {
    font-size: 0.65rem;
    line-height: 1;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }
  
  .vs-section {
    flex: 0 0 40px;
    margin: 0 0.25rem;
    min-width: 40px;
    text-align: center;
  }
  
  .vs-section span:first-child {
    font-size: 0.55rem;
    display: block;
  }
  
  .vs-section span:nth-child(2) {
    font-size: 0.8rem;
    font-weight: bold;
    display: block;
  }
  
  .vs-section span:nth-child(3),
  .vs-section span:nth-child(4) {
    font-size: 0.55rem;
    display: block;
  }
  
  .league-info {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .league-info img {
    width: 14px;
    height: 14px;
  }
  
  .league-info span {
    font-size: 0.65rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .odds-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.25rem;
    margin: 0.75rem 0;
    box-sizing: border-box;
  }
  
  .odds-grid > div {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.25rem;
    box-sizing: border-box;
    text-align: center;
  }
  
  .odds-grid div div:first-child {
    font-size: 0.6rem;
    margin-bottom: 0.125rem;
  }
  
  .odds-grid div div:last-child {
    font-size: 0.85rem;
  }
  
  .prediction-main {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
  }
  
  .prediction-main div:first-child {
    font-size: 0.6rem;
    margin-bottom: 0.125rem;
  }
  
  .prediction-main div:nth-child(2) {
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
    line-height: 1.2;
  }
  
  .prediction-main div:nth-child(3),
  .prediction-main div:nth-child(4) {
    font-size: 0.65rem;
  }
  
  .stats-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
  }
  
  .stats-grid > div {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
  }
  
  .stats-grid div div:first-child {
    font-size: 0.6rem;
    margin-bottom: 0.125rem;
  }
  
  .stats-grid div div:last-child {
    font-size: 0.8rem;
  }
  
  .form-section {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
  }
  
  .form-section > div:first-child {
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
  }
  
  .form-section > div:last-child {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: space-around;
    box-sizing: border-box;
  }
  
  .form-section > div:last-child > div {
    flex: 1;
    max-width: 48%;
    text-align: center;
  }
  
  .form-section > div:last-child > div > div:first-child {
    font-size: 0.6rem;
    margin-bottom: 0.25rem;
  }
  
  .form-section > div:last-child > div > div:last-child {
    font-size: 0.8rem;
  }
  
  .h2h-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .h2h-section > div:first-child {
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
  }
  
  .h2h-section > div:last-child {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
  }
  
  .h2h-section > div:last-child > div {
    width: 100%;
    max-width: 100%;
    padding: 0.25rem 0;
    font-size: 0.7rem;
    box-sizing: border-box;
  }
  
  .h2h-section > div:last-child > div > span:nth-child(2) {
    font-size: 0.75rem;
  }
  
  .insights-card-body > div:last-child {
    width: 100%;
    max-width: 100%;
    padding: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.65rem;
    box-sizing: border-box;
  }
  
  .insights-card-body > div[style*="background:#ebf3fd"],
  .insights-card-body > div[style*="background:#eff6ff"] {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
  }
  
  .insights-card-body > div[style*="background:#ebf3fd"] div:first-child,
  .insights-card-body > div[style*="background:#eff6ff"] div:first-child {
    font-size: 0.6rem;
    margin-bottom: 0.25rem;
  }
  
  .insights-card-body > div[style*="background:#ebf3fd"] div:last-child,
  .insights-card-body > div[style*="background:#eff6ff"] div:last-child {
    font-size: 0.85rem;
  }
  
  /* Content header adjustments */
  .content-header {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    box-sizing: border-box;
    text-align: center;
  }
  
  .content-header h1 {
    font-size: 1.3rem !important;
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }
  
  .content-header p {
    font-size: 0.93rem !important;
    line-height: 1.4;
    padding: 0 0.5rem;
  }
  
  /* Info box adjustments */
  .info-box {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
  }
  
  /* Filter section adjustments */
  div[style*="display:flex;justify-content:space-between"] {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start !important;
  }
  
  #filter-btn {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    box-sizing: border-box;
    justify-content: center;
  }
  
  /* Results counter adjustments */
  #results-counter {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem;
    box-sizing: border-box;
    font-size: 0.85rem;
  }
}
.insights-card-body > div:last-child {
    text-align: center;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

/* Over/Under section styling */
.insights-card-body > div[style*="background:#ebf3fd"] {
    padding: 0.75rem;
    background: #eff6ff !important;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #dbeafe;
}

.insights-card-body > div[style*="background:#ebf3fd"] div:first-child {
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.insights-card-body > div[style*="background:#ebf3fd"] div:last-child {
    font-size: 1rem;
    font-weight: bold;
    color: #2563eb;
}
.insights-card ul {
    margin: 0.25rem 0 0 1.25rem;
    padding: 0;
    font-size: 0.97rem;
    color: #475569;
}
.insights-card li {
    margin-bottom: 0.15rem;
    list-style: disc;
}
.insights-card pre {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    color: #334155;
    overflow-x: auto;
    margin: 0.25rem 0 0 0;
}
/* Insights Dashboard Modern Card Styles */
.insights-body {
    background: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', 'Lato', sans-serif;
}

#insightsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.suggestion-card, .insights-card {
    background: linear-gradient(145deg, #ffffff 0%, #fdfdfd 100%);
    border-radius: 20px;
    padding: 1.5rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
}

.insights-card {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08), 
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.02);
}

.suggestion-card::before, .insights-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.suggestion-card:hover, .insights-card:hover {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12), 
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(148, 163, 184, 0.2);
}

.suggestion-card:hover::before, .insights-card:hover::before {
    opacity: 1;
}
.suggestion-card.locked, .insights-card.locked {
    filter: grayscale(0.10) blur(0.3px);
    opacity: 0.85;
    cursor: not-allowed;
    background: #f8fafc;
    border-style: dashed;
}
.suggestion-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #3C91E6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.suggestion-text.blue {
    color: #2563eb;
}
.suggestion-text.green {
    color: #10b981;
}
.card-content {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.5rem;
    width: 100%;
}
.card-cta {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}
.card-cta .login-btn {
    background: linear-gradient(135deg, #4285f4, #3C91E6);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(66,133,244,0.08);
    transition: background 0.2s, box-shadow 0.2s;
}
.card-cta .login-btn:hover {
    background: linear-gradient(135deg, #2563eb, #3C91E6);
    box-shadow: 0 4px 16px rgba(66,133,244,0.16);
}
.suggestion-card ul, .insights-card ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
    font-size: 0.98rem;
    color: #475569;
}
.suggestion-card li, .insights-card li {
    margin-bottom: 0.25rem;
    list-style: disc;
}
.suggestion-card pre, .insights-card pre {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    color: #334155;
    overflow-x: auto;
    margin: 0.5rem 0 0 0;
}
.suggestion-card .material-symbols-rounded, .insights-card .material-symbols-rounded {
    font-size: 1.4rem;
    vertical-align: middle;
    color: #3C91E6;
}
.suggestion-card.locked .material-symbols-rounded, .insights-card.locked .material-symbols-rounded {
    color: #9ca3af;
}
@media (max-width: 700px) {
    #insightsGrid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .suggestion-card, .insights-card {
        padding: 1rem 0.75rem;
    }
    .insights-card {
        min-height: 120px;
    }
}
:root {
/* Import Lato font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');
/* Chat Title Styling */
.chat-title {
    color: #1a73e8;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
}
    --primary-color: #1a73e8;
    --secondary-color: rgba(66, 133, 244, 0.1);
    --user-bubble-color: #4285f4;
    --bot-bubble-color: #f1f3f4;
    --text-color: #1f1f1f;
    --background-color: #ffffff;
    --sidebar-bg: #f0f4f9;
    --border-color: #e0e0e0;
    --success-color: #34a853;
    --error-color: #ea4335;
    --warning-color: #fbbc04;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --chat-max-width: 800px;
    --chat-input-offset: calc(7rem + 2rem);
}

/* Material Symbols (outline) local alias if external link fails) */
@supports (font-variation-settings: normal) {
    .material-symbols-rounded {
        font-family: 'Material Symbols Rounded', 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
        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;
        font-feature-settings: 'liga';
        -webkit-font-feature-settings: 'liga';
        -webkit-font-smoothing: antialiased;
    }
}

.dark_mode {
    --text-color: #e8eaed;
    --background-color: #202124;
    --sidebar-bg: #2d2e30;
    --border-color: #5f6368;
    --bot-bubble-color: #303134;
    --user-bubble-color: #4285f4;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    overflow-x: hidden;
    font-size: 0.90rem;
}

.app-container {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    min-width: 300px; /* Ensure exactly 300px even at fullscreen */
    max-width: 300px; /* Prevent expansion beyond 300px */
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

#sidebar {
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

@media (min-width: 1025px) {
    .app-container {
        align-items: flex-start;
    }

    .sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        flex-shrink: 0;
    }

    #sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.new-chat-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    /* Ensure this is the scrollable area, not the entire sidebar */
}

.chat-history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    color: var(--text-color);
}

.chat-history-item:not(:last-child) {
    margin-bottom: 0.5rem;
}

.chat-history-item .chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-history-item:hover,
.chat-history-item:focus-within {
    background: rgba(26, 115, 232, 0.1);
    box-shadow: 0 6px 18px rgba(26, 115, 232, 0.12);
    transform: translateY(-1px);
}

.dark_mode .chat-history-item:hover,
.dark_mode .chat-history-item:focus-within {
    background: rgba(138, 180, 248, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.chat-item-delete {
    opacity: 0;
    pointer-events: none;
    background: transparent;
    border: none;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    padding: 0.25rem;
}

.chat-item-delete .material-symbols-rounded {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.chat-history-item:hover .chat-item-delete,
.chat-history-item:focus-within .chat-item-delete {
    opacity: 1;
    pointer-events: auto;
}

.chat-item-delete:hover,
.chat-item-delete:focus {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.chat-item-delete:hover .material-symbols-rounded,
.chat-item-delete:focus .material-symbols-rounded {
    transform: scale(1.05);
}

.chat-item-delete.is-deleting {
    opacity: 0.6 !important;
    cursor: wait;
}

.dark_mode .chat-item-delete {
    color: #fca5a5;
}

.dark_mode .chat-item-delete:hover,
.dark_mode .chat-item-delete:focus {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
}

.no-sessions-message {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.text-muted {
    color: var(--text-muted);
    opacity: 0.7;
}

.chat-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-meta {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Full width chat for unlogged users */
.app-container.no-sidebar {
    justify-content: center;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background-color);
    position: relative;
    z-index: 1002;
}

@media (min-width: 800px) {
    .chat-header {
       width: 90vw;
       align-self: center;
    }
}

.chat-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--secondary-color);
}

.chat-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-color);
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0; /* Allow shrinking */
}

#auth-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.language-selector {
    position: relative;
}

/* Standardized header button styles for consistency */
.header-controls .language-toggle,
.header-controls .login-btn,
.header-controls .upgrade-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    height: 40px; /* Fixed height for consistency */
    min-height: 40px;
    box-sizing: border-box;
    justify-content: center;
}

.language-toggle {
    background: var(--secondary-color);
    color: var(--text-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.language-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border-radius: 15px;
    padding: 0;
    min-width: 200px;
    max-height: 300px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-dropdown-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Custom scrollbar for the dropdown */
.language-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.language-dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.language-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar */
.language-dropdown-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: var(--text-color);
}

.language-option:hover {
    background: var(--hover-color);
    transform: translateX(5px);
}

.language-option.active {
    background: linear-gradient(135deg, #4285f4, #d96570);
    color: white;
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.control-btn:hover {
    background: var(--secondary-color);
    text-decoration: none !important;
}

.upgrade-btn {
    background: var(--primary-color);
    color: white;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #3367d6, #c55a6a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.upgrade-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.login-btn {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.login-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.25);
}

.login-text {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.profile-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.user-email {
    display: block;
    color: #666;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--secondary-color);
}

.dropdown-item.upgrade-item {
    color: var(--primary-color);
    font-weight: 500;
}

.dropdown-item.upgrade-item:hover {
    background: rgba(66, 133, 244, 0.1);
}

.dropdown-item.logout-item {
    color: var(--error-color);
}

.dropdown-item.logout-item:hover {
    background: rgba(234, 67, 53, 0.1);
}

.dropdown-item .material-symbols-rounded {
    font-size: 1.1rem;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.5rem;
    padding-bottom: 10rem;
    text-align: center;
    max-height: fit-content;
    max-width: 100vw;
}

.welcome-title {
    font-size: 2.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #d96570);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 500px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: none; /* Ensure no width constraints */
}

/* Tablet - 2 columns */
@media (min-width: 640px) {
    .suggestions-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, calc(50% - 0.5rem)));
        max-width: 800px;
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Desktop - 3 columns maximum */
@media (min-width: 900px) {
    .suggestions-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, calc(33.333% - 0.67rem)));
        max-width: 1200px; /* Limit total width to prevent more than 3 columns */
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Large screens - maintain 3 column max with better spacing */
@media (min-width: 1200px) {
    .suggestions-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
        gap: 1.5rem;
    }
}

/* Enhanced grid layout for insights dashboard */
#insightsGrid.suggestions-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: none;
}

/* Apply max-width to all insight cards */
#insightsGrid.suggestions-grid .suggestion-card,
#insightsGrid.suggestions-grid .insights-card {
    max-width: 433px;
    width: 100%;
}

/* Medium screens - 3 columns */
@media (min-width: 1200px) {
    #insightsGrid.suggestions-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}

/* Large screen optimization for insights - 4+ columns with max-width constraint */
@media (min-width: 1400px) {
    #insightsGrid.suggestions-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 433px));
    }
}

/* Extra large screens - maximize columns with max-width */
@media (min-width: 1800px) {
    #insightsGrid.suggestions-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 433px));
    }
}

.suggestion-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.suggestion-card.dynamic-suggestion {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-card.dynamic-suggestion .suggestion-text {
    flex: 1;
}

.suggestion-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.suggestion-card-ai {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
    border-color: rgba(99, 102, 241, 0.25);
}

.dark_mode .suggestion-card-ai {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(67, 56, 202, 0.25));
    border-color: rgba(129, 140, 248, 0.45);
}

.suggestion-text {
    font-size: 0.90rem;
    color: var(--text-color);
    line-height: 1.5;
}

.suggestion-text.green {
    color: #2563eb;
    font-weight: 500;
    font-weight: 600;
}

.suggestion-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.dark_mode .suggestion-badge {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.45);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    padding-bottom: calc(1rem + var(--chat-input-offset, 9rem));
    scroll-padding-bottom: var(--chat-input-offset, 9rem);
    -webkit-overflow-scrolling: touch;
    background: var(--background-color);
}

.message-container {
    max-width: var(--chat-max-width);
    margin: 0 auto;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: messageSlideIn 0.3s ease-out;
}

.message.user .message-bubble {
    background: var(--user-bubble-color);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.bot .message-bubble {
    background: var(--bot-bubble-color);
    color: var(--text-color);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--border-color);
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.message-text {
    margin: 0;
    max-height: 900px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    line-height: 1.6; /* Better spacing for numbered lists */
}

.message-text.expanded {
    max-height: none;
}

.read-more-btn {
    color: #4285f4;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.read-more-btn:hover {
    color: #d96570;
    text-decoration: none;
}

.message.user .read-more-btn {
    color: rgba(255, 255, 255, 0.9);
}

.message.user .read-more-btn:hover {
    color: white;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-time {
    color: inherit;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-action {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.message-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Message Reactions */
.message-reactions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.reaction-button {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reaction-button:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.reaction-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.reaction-count {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Enhanced Welcome Screen */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 2rem 0;
}

.quick-action {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.quick-action:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-action-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.quick-action-title {
    font-weight: 600;
    color: var(--text-color);
}

.quick-action-desc {
    font-size: 0.8rem;
    color: #666;
}

.message-action {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.message-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Input Area */
.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--background-color);
    box-shadow: 0 -12px 24px -18px rgba(0, 0, 0, 0.2), 
                0 -6px 12px -9px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    /* Define input area height for footer calculations */
    --input-area-total-height: calc(7rem + 2rem); /* wrapper height + padding */
}

/* Sidebar states for large screens */
@media (min-width: 769px) {
    /* Only when sidebar is expanded, apply custom positioning and width */
    .main-chat.sidebar-expanded .input-area {
        left: max(300px, calc(300px + (100vw - 1200px) / 2)) !important;
        width: min(900px, calc(100vw - 300px)) !important;
        right: auto !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    /* When sidebar is collapsed, use normal styles (no overrides needed) */
}

/* Override the 1025px rule when sidebar is expanded */
@media (min-width: 1025px) {
    .main-chat.sidebar-expanded .input-area {
        left: max(300px, calc(300px + (100vw - 1200px) / 2)) !important;
        width: min(900px, calc(100vw - 300px)) !important;
        right: auto !important;
        transform: none !important;
        margin: 0 !important;
    }
}

.input-container {
    max-width: var(--chat-max-width);
    margin: 0 auto;
    position: relative;
}

.input-wrapper {
    background: #ffffff;
    height: 7rem; /* 28 * 0.25rem = 7rem */
    border-radius: 1rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    border: none;
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-content {
    display: flex;
    flex: 1;
}

/* Autocomplete styling */
.chat-input::-webkit-input-placeholder {
    color: #666;
}

.chat-input:-moz-placeholder {
    color: #666;
}

.chat-input::-moz-placeholder {
    color: #666;
}

.chat-input:-ms-input-placeholder {
    color: #666;
}

.chat-input {
    flex: 1;
    margin: 1rem;
    outline: none;
    border: none;
    min-height: 4rem; /* 16 * 0.25rem = 4rem */
    resize: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
}

.chat-input:focus {
    outline: none;
    border: none;
}

.chat-input::placeholder {
    color: #666;
}

.input-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
}

.character-count {
    font-size: 0.75rem;
    color: #666;
}

.send-btn {
    background: #404040;
    border-radius: 50%;
    color: white;
    width: 2rem;
    height: 2rem;
    padding: 0.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: #2d2d2d;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 100%;
    height: 100%;
}

/* Dark mode styles for input area */
.dark_mode .input-wrapper {
    background: var(--bot-bubble-color);
    border-top-color: var(--border-color);
}

.dark_mode .chat-input {
    color: var(--text-color);
}

.dark_mode .chat-input::placeholder {
    color: #9ca3af;
}

.dark_mode .character-count {
    color: #9ca3af;
}

.dark_mode .send-btn {
    background: #525252;
}

.dark_mode .send-btn:hover {
    background: #404040;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: translateY(-50%);
}

/* Animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Tablet/Medium Screen Fix for 900px-1200px */
@media (min-width: 900px) and (max-width: 1200px) {
    .chat-header {
        width: 90vw;
        align-self: center;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
    }

    :root {
        --chat-input-offset: calc(5rem + 2rem);
    }
    
    /* Authenticated users - sidebar behavior */
    .app-container:not(.no-sidebar) .sidebar {
        position: fixed;
        top: 0;
        left: -70%;
        width: 70%;
        height: 100vh;
        background: var(--sidebar-bg);
        border-right: 1px solid var(--border-color);
        z-index: 1003;
        transition: left 0.3s ease;
        order: initial;
        border-top: none;
        max-height: none;
    }
    
    .app-container:not(.no-sidebar) .sidebar.open {
        left: 0;
    }
    
    .app-container:not(.no-sidebar) .sidebar.collapsed {
        left: -70%;
    }
    
    /* Unauthenticated users - no sidebar, keep layout simple */
    .app-container.no-sidebar .sidebar {
        display: none;
    }

    /* Mobile sticky header that hides/shows on scroll */
    .chat-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--background-color);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1002;
        transform: translateY(0);
        transition: transform 0.3s ease;
        overflow: visible; /* Allow dropdowns to overflow */
    }
    
    /* Fix for authenticated users: prevent header controls from overflowing when sidebar is open */
    .app-container:not(.no-sidebar) .chat-header {
        padding: 0.8rem;
    }
    
    .app-container:not(.no-sidebar) .header-controls {
        gap: 0.4rem;
        min-width: 0;
        flex-shrink: 1;
    }
    
    /* When sidebar is open on mobile, adjust header layout for authenticated users */
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .chat-header {
        width: 100%;
        min-width: 200px;
    }
    
    .chat-header.hidden {
        transform: translateY(-100%);
    }
    
    /* Mobile header controls optimization */
    .header-controls {
        gap: 0.5rem;
        flex-wrap: nowrap;
        overflow: visible;
        min-width: 0;
    }
    
    .header-controls .language-dropdown,
    .header-controls .user-dropdown {
        min-width: 0;
        flex-shrink: 1;
    }
    
    .header-controls .dropdown-button {
        padding: 0.5rem 0.75rem;
        min-width: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
    }
    
    /* Enhanced authenticated user header controls */
    .app-container:not(.no-sidebar) .header-controls .dropdown-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
    
    /* When sidebar is open, make header ultra-responsive */
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .header-controls {
        gap: 0.3rem;
    }
    
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .header-controls .dropdown-button {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
        min-width: 44px;
    }
    
    /* Allow dropdown to overflow on mobile for language selector */
    .language-selector {
        overflow: visible;
    }
    
    .control-btn {
        padding: 0.4rem;
        min-width: 40px;
        height: 40px;
    }
    
    /* Mobile header button consistency */
    .header-controls .language-toggle,
    .header-controls .login-btn,
    .header-controls .upgrade-btn {
        height: 36px; /* Slightly smaller on mobile */
        min-height: 36px;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: auto;
        gap: 0.25rem;
    }
    
    .upgrade-text {
        display: none; /* Hide text on mobile, keep only icon */
    }
    
    .login-text {
        display: none; /* Hide text on mobile, keep only icon */
    }
    
    /* Fix language dropdown z-index on mobile to appear above fixed header */
    .language-dropdown {
        z-index: 1003;
    }
    
    /* Ensure auth-links don't stack */
    #auth-links {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        flex-shrink: 0;
    }
    
    /* Unauthenticated users - full width */
    .app-container.no-sidebar .main-chat {
        padding-top: 80px;
        order: 1;
        width: 100%;
        min-height: calc(100vh - 80px);
    }
    
    /* Authenticated users - adapt to sidebar state */
    .app-container:not(.no-sidebar) .main-chat {
        padding-top: 80px;
        order: 1;
        width: 100%; /* Default when sidebar closed */
        min-height: calc(100vh - 80px);
        transition: width 0.3s ease;
    }
    
    /* When sidebar is open, reduce main-chat width */
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat {
        width: 30%; /* Account for 70% sidebar */
    }
    
    /* Mobile backdrop overlay */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1003;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .welcome-title {
        font-size: 1.8rem;
    }
    
    .suggestions-grid,
    #insightsGrid.suggestions-grid {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        align-items: center;
        margin-bottom: 1rem;
        max-width: 100%;
    }
    
    /* Mobile input area adjustments */
    .input-area {
        --input-area-total-height: calc(5rem + 2rem); /* Mobile wrapper height + padding */
    }
    
    .input-wrapper {
        height: 5rem; /* Smaller on mobile */
        margin: 0 0.5rem;
    }
    
    .chat-input {
        margin: 0.75rem;
        min-height: 3rem;
        font-size: 0.9rem;
    }
    
    .input-controls {
        right: 0.75rem;
        bottom: 0.75rem;
    }
    
    .send-btn {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Tablet specific styles */
@media (max-width: 1200px) and (min-width: 769px) {
    /* Authenticated users - tablet layout improvements (expanded sidebar) */
    .app-container:not(.no-sidebar) .sidebar:not(.collapsed) {
        width: 300px;
        min-width: 300px;
    }
    
    .app-container:not(.no-sidebar) .sidebar:not(.collapsed) ~ .main-chat {
        width: calc(100vw - 300px) !important;
    }
    
    .app-container:not(.no-sidebar) .sidebar:not(.collapsed) ~ .main-chat .chat-header {
        width: 90% !important;
        padding: 1rem;
    }
    
    /* Authenticated users - tablet layout (collapsed sidebar) */
    .app-container:not(.no-sidebar) .sidebar.collapsed {
        width: 0;
        min-width: 0;
    }
    
    .app-container:not(.no-sidebar) .sidebar.collapsed ~ .main-chat {
        margin-left: 0;
        width: 100vw;
    }
    
    .app-container:not(.no-sidebar) .sidebar.collapsed ~ .main-chat .chat-header {
        width: 100vw;
        left: 0;
        padding: 1rem;
    }
    
    /* Unauthenticated users - full width on tablet */
    .app-container.no-sidebar .main-chat {
        width: 100vw;
        margin-left: 0;
    }
    
    .app-container.no-sidebar .chat-header {
        width: 100vw;
        left: 0;
    }
    
    /* Header controls spacing for tablet */
    .header-controls {
        gap: 0.6rem;
    }
    
    .header-controls .dropdown-button {
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 2000px) and (min-width: 1200px) {
    .app-container:not(.no-sidebar) .sidebar:not(.collapsed) ~ .main-chat .chat-header {
        width: 95% !important;
        padding: 1rem;
    }
    .sidebar-expanded {
        width: calc(100vw - 300px) !important;
    }
}

@media (max-width: 768px) and (min-width: 450px) {
    .suggestions-grid, #insightsGrid.suggestions-grid {
        gap: 1rem;
    }
}
/* Utility Classes */
.hidden {
    display: none !important;
}

/* Back button responsive sizing */
@media (max-width: 768px) {
    .back-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        height: 34px;
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive utility classes */
.mobile-compact {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.8rem !important;
}

.mobile-ultra-compact {
    padding: 0.15rem 0.3rem !important;
    font-size: 0.7rem !important;
}

/* Ensure smooth transitions for responsive elements */
.header-controls,
.header-controls .dropdown-button,
.chat-header {
    transition: all 0.3s ease !important;
}

/* Prevent text overflow in responsive scenarios */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    :root {
        --chat-input-offset: calc(4.5rem + 2rem);
    }

    .header-controls {
        gap: 0.25rem;
    }
    
    /* Extra small mobile button consistency */
    .header-controls .language-toggle,
    .header-controls .login-btn,
    .header-controls .upgrade-btn {
        height: 32px; /* Even smaller on extra small screens */
        min-height: 32px;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        gap: 0.2rem;
    }
    
    .control-btn {
        padding: 0.3rem;
        min-width: 36px;
        height: 36px;
    }
    
    .upgrade-btn .material-symbols-rounded {
        font-size: 1rem;
        height: 1rem;
    }
    
    /* Header controls improvements for mobile */
    .header-controls .language-dropdown,
    .header-controls .user-dropdown {
        min-width: 0;
        flex-shrink: 1;
    }
    
    .header-controls .dropdown-button {
        padding: 0.25rem 0.4rem;
        min-width: 32px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.75rem;
    }
    
    /* Specific improvements for authenticated users on extra small mobile */
    .app-container:not(.no-sidebar) .header-controls {
        gap: 0.15rem;
        min-width: 0;
        flex-wrap: nowrap;
    }
    
    .app-container:not(.no-sidebar) .header-controls .dropdown-button {
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
        min-width: 28px;
    }
    
    /* When sidebar is open on extra small mobile, make header ultra-compact */
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .header-controls {
        gap: 0.1rem;
    }
    
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .header-controls .dropdown-button {
        padding: 0.15rem 0.25rem;
        font-size: 0.65rem;
        min-width: 24px;
    }
    
    /* Ultra-compact mode when sidebar is open */
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .chat-header {
        width: 100vw;
        min-width: 150px;
        padding: 0.5rem;
    }
    
    /* Extra small mobile input adjustments */
    .input-area {
        --input-area-total-height: calc(4.5rem + 2rem); /* Extra small wrapper height + padding */
    }
    
    .input-wrapper {
        height: 4.5rem;
        margin: 0 0.25rem;
    }
    
    .chat-input {
        margin: 0.5rem;
        min-height: 2.5rem;
        font-size: 0.85rem;
    }
    
    .input-controls {
        right: 0.5rem;
        bottom: 0.5rem;
        gap: 0.25rem;
    }
    
    .character-count {
        font-size: 0.7rem;
    }
    
    .send-btn {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .flag-icon {
        width: 16px;
        height: 12px;
    }
    
    .chat-title {
        font-size: 1rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Tablet specific responsive styles */
@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --chat-input-offset: calc(6rem + 2rem);
    }

    .header-controls .language-toggle,
    .header-controls .login-btn,
    .header-controls .upgrade-btn {
        height: 38px; /* Medium size for tablets */
        min-height: 38px;
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .input-area {
        --input-area-total-height: calc(6rem + 2rem); /* Tablet wrapper height + padding */
    }
    
    .input-wrapper {
        height: 6rem; /* Medium size for tablets */
    }
    
    /* Header controls improvements for medium mobile devices */
    .header-controls {
        gap: 0.4rem;
        min-width: 0;
        overflow: visible;
    }
    
    .header-controls .dropdown-button {
        padding: 0.4rem 0.7rem;
        min-width: auto;
        white-space: nowrap;
        font-size: 0.85rem;
    }
    
    /* Specific improvements for authenticated users on medium mobile */
    .app-container:not(.no-sidebar) .header-controls {
        gap: 0.3rem;
    }
    
    .app-container:not(.no-sidebar) .header-controls .dropdown-button {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* When sidebar is open on medium mobile */
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .header-controls {
        gap: 0.25rem;
    }
    
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .header-controls .dropdown-button {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-width: 36px;
    }
    
    .app-container:not(.no-sidebar) .sidebar.open ~ .main-chat .chat-header {
        width: 100vw;
        min-width: 180px;
        padding: 0.7rem;
    }
}

/* Large screen styles - constrain input area width */
@media (min-width: 1025px) {
    .input-area {
        left: 50%;
        right: auto;
        width: calc(var(--chat-max-width) + 10rem);
        transform: translateX(-50%);
    }
}

/* Authentication Prompt */
.auth-prompt {
    background: #4285f4;
    color: white;
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    margin: 1rem;
}

.auth-prompt a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.auth-prompt a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.upgrade-prompt {
    background: linear-gradient(#78d6c6 -150%, #12486b);
    color: white;
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    margin: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upgrade-prompt a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
}

.upgrade-prompt a:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Inline upgrade prompt button styles */
.upgrade-buttons {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.upgrade-buttons .upgrade-btn,
.upgrade-buttons .signup-btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.upgrade-btn:hover {
    background: #5a67d8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.signup-btn:hover {
    background: #667eea !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Custom Scrollbar Styles for Sidebar and Main Chat */

/* Sidebar Chat History Scrollbar - Subtle and Hidden Until Hover */
.chat-history::-webkit-scrollbar {
    width: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-history:hover::-webkit-scrollbar {
    opacity: 1;
}

.chat-history::-webkit-scrollbar-track {
    background: transparent;
}

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Firefox scrollbar for chat history */
.chat-history {
    scrollbar-width: none; /* Hide scrollbar by default */
}

.chat-history:hover {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}


/* Quota Badge Responsive Styles */
#quota-status-badge .quota-text {
    display: inline;
}

@media (max-width: 768px) {
    #quota-status-badge .quota-text {
        display: none;
    }
    
    #quota-status-badge .quota-number {
        font-weight: 600;
        margin-left: 4px;
    }
}
