:root {
    --brand-primary: #f1c40f;
    --user-color: #e74c3c;
    --ai-color: #3498db;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --border-color: #ecf0f1;
  }
  
  body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  
  .accent {
    color: var(--brand-primary);
    font-weight: 700;
  }
  
  .plus-red {
    color: #e74c3c;
  }
  
  .plus-blue {
    color: #3498db;
  }
  
  .chat-container {
    width: 100%;
    height: calc(100vh - 40px); /* Subtract navbar height */
    margin: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
  }
  
  .chat-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
  }
  
  .chat-window {
    flex: 1;
    overflow-y: auto;
    background-color: var(--light-bg);
    padding: 20px;
  }
  
  .message-bubble {
    display: inline-block;        /* Shrink-wrap to fit content */
    max-width: 100%;               /* Prevent bubble from exceeding 100% of container width */
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-wrap: break-word;    /* Ensures text wraps inside the bubble */
    word-wrap: break-word;        /* For compatibility with older browsers */
    white-space: normal;          /* Allows text to wrap normally */
  }
  
  /* Align user messages to the right */
  .user-message {
    text-align: right;            /* Inline elements inside will align to the right */
  }
  
  /* Align AI messages to the left */
  .ai-message {
    text-align: left;
  }
  
  .user-message .message-bubble {
    background-color: white;
    color: var(--user-color, #e74c3c); /* Fallback to red */
    border-top-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .ai-message .message-bubble {
    background-color: white;
    color: var(--ai-color, #3498db); /* Fallback to blue */
    border-top-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .message-sender {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.85rem;
  }
  
  .user-message .message-sender {
    text-align: right;
    color: var(--user-color, #e74c3c); /* Fallback to red */
  }
  
  .ai-message .message-sender {
    color: var(--ai-color, #3498db); /* Fallback to blue */
  }
  
  .image-attachment {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
    max-width: 300px;
  }
  
  .chat-input-container {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    position: relative;
  }
  
  .expandable-input {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 50px 12px 50px;
    background-color: var(--light-bg);
    resize: none;
    overflow-y: auto;
    width: 100%;
    min-height: 48px;
    max-height: 200px;
    outline: none;
    transition: border-color 0.2s;
  }
  
  .expandable-input:focus {
    border-color: var(--brand-primary);
  }
  
  /* Updated styling for empty chat state */
  .empty-chat-message {
    color: var(--brand-primary);
  }
  
  .empty-chat-icon {
    color: var(--brand-primary);
  }
  
  /* Fixed positioning and sizing for buttons */
  .input-actions-left {
    position: absolute;
    left: 20px;
    bottom: 24px;
    z-index: 10;
  }
  
  .btn-action {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
  }
  
  .btn-action:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
  }
  
  .btn-send {
    background-color: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    position: absolute;
    right: 20px;
    bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
    padding: 0;
  }
  
  .btn-send:hover {
    transform: scale(1.05);
  }
  
  .btn-send:disabled {
    background-color: var(--light-text);
    transform: none;
    cursor: not-allowed;
  }
  
  .thinking-notice {
    background-color: #fffae6;
    border: 2px solid var(--brand-primary);
    color: var(--dark-text);
    font-weight: bold;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
  }
  
  .hidden-upload {
    display: none;
  }
  
  .math * {
    color: inherit !important;
  }
  
  /* Custom btn-warning for clear history */
  .btn-custom-warning {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
  }
  
  .btn-custom-warning:hover {
    background-color: #e0b50e;
    border-color: #e0b50e;
    color: white;
  }
  
  .btn-custom-warning:disabled {
    background-color: #f8e9a9;
    border-color: #f8e9a9;
  }
  
  /* Footer text style - more faint */
  .footer-notice {
    color: #808080;
    font-size: 0.7rem;
  }

  /* For chat histories cards */
  .chat-history-card {
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
  }
  
  .chat-history-card:hover {
    transform: translateY(-5px);
  }
  
  .chat-history-title {
    color: var(--brand-primary);
    font-weight: 600;
  }
  
  /* Full width container */
  .container-fluid {
    padding: 0;
    margin: 0;
    width: 100%;
  }
  
  /* Ensure chat container takes full width */
  .container-fluid .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Image preview styles */
  .image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    max-height: 120px;
    overflow-y: auto;
    padding: 0 5px;
  }

  .image-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }

  .preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .remove-image-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(231, 76, 60, 0.8);  /* Using your --user-color */
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
  }

  .remove-image-btn:hover {
    background-color: #e74c3c;  /* Solid version of the color */
  }

  /* File counter badge */
  .btn-action[data-content]::after {
    content: attr(data-content);
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--brand-primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  }

  .oauth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
  }
  
  .oauth-separator::before,
  .oauth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dadce0;
  }
  
  .oauth-separator span {
    padding: 0 10px;
    color: #666;
    font-size: 14px;
  }
  
  .google-btn {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 1px;
    margin: 10px 0;
    width: 300px; /* Increased width from 220px to 300px */
    height: 42px;
    transition: background-color 0.3s, box-shadow 0.3s;
  }
  
  .google-btn:hover {
    box-shadow: 0 1px 1px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    cursor: pointer;
  }
  
  .google-icon-wrapper {
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 2px;
  }
  
  .google-icon {
    width: 18px;
    height: 18px;
  }
  
  .btn-text {
    color: #3c4043;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    letter-spacing: 0.2px;
    margin-left: 8px;
    font-weight: 500;
  }
  
  .google-signin-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: auto;
  }
