:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #00c6ff;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --sidebar-bg: #2c3e50;
    --message-user-bg: #6a11cb;
    --message-ai-bg: #f1f3f4;
    --input-bg: #ffffff;
    --border-color: #e1e5e9;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
  }
  
  .dark-mode {
    --primary-color: #8a2be2;
    --secondary-color: #4a86e8;
    --accent-color: #00d4ff;
    --text-color: #e1e5e9;
    --bg-color: #121212;
    --sidebar-bg: #1a1a1a;
    --message-user-bg: #8a2be2;
    --message-ai-bg: #2d2d2d;
    --input-bg: #2d2d2d;
    --border-color: #404040;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    transition: var(--transition);
        margin: 0;
  padding: 0;
  overflow-x: hidden; /* Ye line
  }
  
  
  /* Logout Tab Styles */
  .logout-section {
    text-align: center;
    padding: 30px 20px;
  }
  
  .logout-icon {
    font-size: 64px;
    color: #ff6b6b;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  .logout-section h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
  }
  
  .logout-section p {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 30px;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .logout-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .logout-btn-confirm {
    padding: 15px 30px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  }
  
  .logout-btn-confirm:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
  }
  
  .logout-btn-cancel {
    padding: 15px 30px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .logout-btn-cancel:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  /* Dark Mode Support for Logout Tab */
  .dark-mode .logout-btn-cancel {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .dark-mode .logout-btn-cancel:hover {
    background: #404040;
  }
  
  /* Mobile Responsive for Logout Tab */
  @media (max-width: 768px) {
    .logout-section {
      padding: 20px 15px;
    }
    
    .logout-icon {
      font-size: 48px;
    }
    
    .logout-section h4 {
      font-size: 1.3rem;
    }
    
    .logout-actions {
      flex-direction: column;
      gap: 12px;
    }
    
    .logout-btn-confirm,
    .logout-btn-cancel {
      padding: 12px 20px;
      font-size: 14px;
      width: 100%;
      justify-content: center;
    }
  }
  
  
  /* Mobile Menu Styles */
  .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
  }
  
  .menu-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
  }
  
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .mobile-overlay.active {
    opacity: 1;
  }
  
  /* Enhanced History Tab Styles */
  .history-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
    border-radius: 6px;
    margin-bottom: 8px;
  }
  
  .history-item:hover {
    background: var(--message-ai-bg);
  }
  
  .history-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }
  
  .history-item-content {
    flex: 1;
    overflow: hidden;
    margin-right: 10px;
  }
  
  .history-item-meta {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 4px;
  }
  
  .history-item-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
  }
  
  .history-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
  }
  
  .history-btn.view {
    background: var(--primary-color);
    color: white;
  }
  
  .history-btn.view:hover {
    background: var(--secondary-color);
  }
  
  .control-btn {
    background-color: var(--bg-color);
    border: none;
  }
  
  .history-btn.delete {
    background: #e74c3c;
    color: white;
  }
  
  .history-btn.delete:hover {
    background: #c0392b;
  }
  
  /* Enhanced Mobile Responsiveness */
  @media (max-width: 768px) {
    .menu-toggle {
      display: block;
    }
  
    .sidebar {
      width: 280px;
      position: fixed;
      height: 100%;
      transform: translateX(-100%);
      z-index: 20;
      transition: transform 0.3s ease;
    }
  
    .sidebar.mobile-active {
      transform: translateX(0);
    }
  
    .main-content {
      width: 100%;
    }
  
    .chat-header {
      padding: 12px 15px;
    }
  
    .chat-title {
      font-size: 1rem;
    }
  
    .title-text {
      width: 140px;
    }
  
    .message {
      max-width: 90%;
    }
  
    .input-container {
      padding: 15px;
    }
  
    .modal-content {
      width: 95%;
      padding: 20px;
      margin: 10px;
    }
  
    .history-item {
      flex-direction: column;
      gap: 10px;
    }
  
    .history-item-actions {
      align-self: flex-end;
    }
  }
  
  @media (max-width: 480px) {
    .sidebar {
      width: 100%;
    }
  
    .message {
      max-width: 95%;
      padding: 12px 15px;
    }
  
    .chat-controls {
      gap: 5px;
    }
  
    .control-btn {
      background-color: var(--bg-color);
      border: none;
    }
  
    .title-text {
      width: 120px;
    }
  
    .history-item-actions {
      width: 100%;
      justify-content: flex-end;
    }
  }
  
  /* Smooth transitions for mobile menu */
  .app-container {
    transition: var(--transition);
  }
  
  .sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Enhanced scrollbar for history */
  .history-list::-webkit-scrollbar {
    width: 6px;
  }
  
  .history-list::-webkit-scrollbar-track {
    background: var(--bg-color);
  }
  
  .history-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
  }
  
  .history-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
  }
  
  .app-container {
    display: flex;
    height: 100vh;
    background: var(--bg-color);
    overflow: hidden;
  }
  
  /* Sidebar */
  .sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 10;
  }
  
  .sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .profile-picture {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(0, 198, 255, 0.3);
  }
  
  .profile-picture:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.5);
  }
  
  .profile-controls {
    display: flex;
    gap: 10px;
  }
  
  .profile-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .conversation-controls {
    margin: 20px 0;
  }
  
  .sidebar-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    font-size: 0.9rem;
  }
  
  .sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
  }
  
  .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
  }
  
  .theme-toggle span {
    font-size: 0.9rem;
  }
  
  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
  }
  
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  .menu-toggle {
    display: none;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
  }
  
  input:checked + .slider {
    background-color: var(--accent-color);
  }
  
  input:checked + .slider:before {
    transform: translateX(26px);
  }
  
  .language-selector {
    margin-top: auto;
  }
  
  .language-selector label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
  }
  
  .language-selector select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .language-selector select option {
    background: var(--sidebar-bg);
    color: white;
  }
  
  /* Main Content */
  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
  }
  
  .chat-header {
    padding: 15px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }
  
  .chat-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  
  .title-animation {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .title-text {
    position: relative;
    overflow: hidden;
    height: 1.2em;
    width: 200px;
    text-align: center;
  }
  
  .title-segment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(100%);
  }
  
  .title-segment.active {
    opacity: 1;
    transform: translateY(0);
  }
  
  .title-segment.exiting {
    opacity: 0;
    transform: translateY(-100%);
  }
  
  .title-separator {
    color: var(--primary-color);
    font-weight: 300;
    opacity: 0.7;
  }
  
  .chat-controls1 {
    display: flex;
    gap: 40px;
  }
  
  .control-btn1 {
    padding: 8px 12px;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
  }
  
  .control-btn1:hover {
    background: var(--primary-color);
    color: white;
  }
  
  .chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: hidden;
    background: var(--bg-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
  }
  
  .welcome-message {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-color);
    animation: fadeIn 0.5s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .welcome-message h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2.5rem;
    background: linear-gradient(
      135deg,
      var(--primary-color),
      var(--secondary-color)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .welcome-message p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
  }
  
  .messages-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
  }
  
  .message {
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
    word-wrap: break-word;
  }
  
  .user-message {
    background: linear-gradient(
      135deg,
      var(--primary-color),
      var(--secondary-color)
    );
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
  }
  
  .ai-message {
    background: var(--message-ai-bg);
    color: var(--text-color);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--border-color);
  }
  
  .message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
  }
  
  .message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
  }
  
  .message-sender {
    font-weight: 600;
    font-size: 0.9rem;
  }
  
  .user-message .message-sender {
    color: rgba(255, 255, 255, 0.9);
  }
  
  .ai-message .message-sender {
    color: var(--primary-color);
  }
  
  .message-text {
    line-height: 1.5;
    white-space: pre-wrap;
  }
  
  .message-image {
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    max-width: 300px;
  }
  
  .message-image img {
    max-width: 100%;
    border-radius: 10px;
    cursor: pointer;
  }
  
  .message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
  }
  
  .typing-indicator {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--message-ai-bg);
    border-radius: 18px;
    max-width: 85%;
    border-bottom-left-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
  }
  
  .typing-dots {
    display: flex;
    gap: 4px;
    margin-left: 10px;
  }
  
  .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typingAnimation 1.4s infinite ease-in-out;
  }
  
  .typing-dot:nth-child(1) {
    animation-delay: -0.32s;
  }
  
  .typing-dot:nth-child(2) {
    animation-delay: -0.16s;
  }
  
  .input-container {
    padding: 20px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    transition: var(--transition);
  }
  
  .image-upload {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .upload-btn {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .upload-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
  }
  
  .text-input-container {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--input-bg);
    border-radius: 25px;
    padding: 5px 5px 5px 15px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    max-height: 150px;
    overflow-y: auto;
  }
  
  .text-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.1);
  }
  
  #userInput {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-color);
    max-height: 120px;
    outline: none;
    line-height: 1.5;
  }
  
  .send-btn {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .send-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
  }
  
  .send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
  }
  
  /* Animations */
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  @keyframes messageSlide {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes typingAnimation {
    0%,
    80%,
    100% {
      transform: scale(0.8);
      opacity: 0.5;
    }
    40% {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  /* Modal */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
  }
  
  .modal-content {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow);
    animation: messageSlide 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
  }
  
  .close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
  }
  
  .close-modal:hover {
    color: var(--primary-color);
  }
  
  .modal-body {
    margin-bottom: 20px;
  }
  
  .color-picker {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  
  .color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
  }
  
  .color-option:hover,
  .color-option.active {
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  }
  
  .modal-footer {
    display: flex;
    /* justify-content: flex-end; */
    gap: 10px;
  }
  
  .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
  }
  
  .btn-primary {
    background: var(--primary-color);
    color: white;
  }
  
  .btn-primary:hover {
    background: var(--secondary-color);
  }
  
  .btn-secondary {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
  }
  
  .btn-secondary:hover {
    background: var(--border-color);
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .sidebar {
      width: 100%;
      position: absolute;
      height: 100%;
      transform: translateX(-100%);
      z-index: 20;
    }
  
    .sidebar.active {
      transform: translateX(0);
    }
  
    .menu-toggle {
      display: block;
    }
  
    .message {
      max-width: 95%;
    }
  
    .title-text {
      width: 150px;
    }
  
    .chat-title {
      font-size: 4.3vw;
    }
  }
  
  .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--bg-color);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
  }
  
  /* History Modal Styles */
  .history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
  }
  
  .history-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .history-item:last-child {
    border-bottom: none;
  }
  
  .history-item-content {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .history-item-actions {
    display: flex;
    gap: 5px;
  }
  
  .history-btn {
    padding: 5px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
  }
  
  .history-btn:hover {
    background: var(--secondary-color);
  }
  
  .history-btn.delete {
    background: #e74c3c;
  }
  
  .history-btn.delete:hover {
    background: #c0392b;
  }
  
  .tab-container {
    margin-bottom: 20px;
  }
  
  .tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
  }
  
  .tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 500;
    border-bottom: 2px solid transparent;
  }
  
  .tab-button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
  }
  
  .tab-content {
    padding: 20px 0;
  }
  
  .tab-pane {
    display: none;
  }
  
  .tab-pane.active {
    display: block;
  }
  
  .no-history {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.7;
  }
  
  .file-name {
    font-size: 0.8rem;
    color: var(--text-color);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .hidden {
    display: none !important;
  }
  
  .sidebar1 {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar1.mobile-active {
    transform: translateX(0);
  }
  .menu-toggle2 {
    display: block; /* Mobile me hi show */
  }
  
  .welcome-message2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
  }
  
  .text-input-container {
    max-height: 150px; /* overall container max height */
  }
  #userInput2 {
    overflow: hidden;
    min-height: 40px;
    max-height: 10px;
  }
  
  #userInput3 {
    overflow: hidden;
    resize: none;
    min-height: 40px;
    max-height: 10px;
    line-height: 1.5;
  }
  .text-input-container {
    display: flex;
    align-items: flex-end;
    flex: 1;
  }
  
  .menu-toggle {
    display: none; /* desktop me hide */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
  }
  
  /* Mobile breakpoints */
  @media (max-width: 768px) {
    .menu-toggle {
      display: block; /* mobile pe show */
       position: fixed;
      top: 15px;
      right: 1px;
      z-index: 25;
    }
  
    .sidebar {
      position: fixed;
      left: 0;
      top: 0;
      transform: translateX(-100%);
      height: 100%;
      width: 330px;
      z-index: 20;
      transition: transform 0.3s ease;
    }
  
    .sidebar.mobile-active {
      transform: translateX(0);
    }
  
    #userInput {
      font-size: 12px;
    }
  
    .text-input-container {
      height: 50px;
  
      display: flex;
      justify-content: center;
      align-items: center;
      overflow: hidden;
    }
    .send-btn {
      padding: 12px;
      background: var(--primary-color);
      color: white;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      transition: var(--transition);
      width: 35px;
      height: 35px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
    }
  
    .upload-btn {
      padding: 12px;
      background: var(--primary-color);
      color: white;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      transition: var(--transition);
      width: 35px;
      height: 35px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
    }
  
    .input-container {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 70px;
    }
    .welcome-message h1 {
      color: var(--primary-color);
      margin-bottom: 20px;
      font-size: 1.4rem;
      background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
      );
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  
    .welcome-message p {
      font-size: rem;
      max-width: 600px;
      margin: 0 auto;
      line-height: 1.6;
    }
  }
  
  /* History Tab Styles */
  .history-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
  }
  
  .search-box {
    position: relative;
    flex: 1;
  }
  
  .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
  }
  
  .search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
  }
  
  .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
  }
  
  .filter-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    min-width: 150px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
  }
  
  .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
  }
  
  .history-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    margin-bottom: 20px;
  }
  
  .history-list {
    padding: 10px;
  }
  
  .empty-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
  }
  
  .empty-history i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
  }
  
  .empty-history h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
  }
  
  .empty-history p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
  }
  
  /* History Item Styles */
  .history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  .history-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .history-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
  }
  
  .history-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }
  
  .history-checkbox:hover {
    border-color: var(--primary-color);
  }
  
  .history-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
  }
  
  .history-checkbox.checked::after {
    content: '✓';
    font-size: 12px;
    font-weight: bold;
  }
  
  .history-content {
    flex: 1;
    min-width: 0;
  }
  
  .history-preview {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.4;
  }
  
  .history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .history-date {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .history-date i {
    font-size: 11px;
  }
  
  .history-message-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
  }
  
  .history-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
  }
  
  .bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  
  .action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
  }
  
  .action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .action-btn.secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
  }
  
  .action-btn.secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
  }
  
  .action-btn.danger {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
  }
  
  .action-btn.danger:hover:not(:disabled) {
    background: #c0392b;
    border-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  }
  
  .action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }
  
  .history-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .history-item:hover .history-item-actions {
    opacity: 1;
  }
  
  .item-action-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .item-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-color);
    transform: scale(1.1);
  }
  
  .item-action-btn.delete:hover {
    background: #e74c3c;
    color: white;
  }
  
  .item-action-btn.view:hover {
    background: var(--primary-color);
    color: white;
  }
  
  /* Scrollbar for history list */
  .history-list-container::-webkit-scrollbar {
    width: 6px;
  }
  
  .history-list-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
  }
  
  .history-list-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    transition: background 0.3s ease;
  }
  
  .history-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
  }
  
  /* Firefox scrollbar */
  .history-list-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
  }
  
  /* Loading state */
  .history-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
  }
  
  .history-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Selection animation */
  .history-item {
    transition: all 0.2s ease;
  }
  
  .history-item.selecting {
    transform: scale(0.98);
  }
  
  /* Empty state animation */
  .empty-history {
    animation: fadeIn 0.5s ease;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Responsive design */
  @media (max-width: 768px) {
    .history-controls {
      flex-direction: column;
      gap: 10px;
    }
    
    .search-box,
    .filter-options {
      width: 100%;
    }
    
    .history-actions {
      flex-direction: column;
      gap: 10px;
    }
    
    .bulk-actions {
      width: 100%;
      justify-content: space-between;
    }
    
    .history-item {
      padding: 10px;
    }
    
    .history-preview {
      font-size: 13px;
    }
    
    .history-meta {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
    }
  }
  
  /* Dark mode adjustments */
  body.dark-mode .history-item {
    background: #2c3e50;
  }
  
  body.dark-mode .history-item:hover {
    background: #34495e;
    border-color: var(--primary-color);
  }
  
  body.dark-mode .history-item.selected {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
  }
  
  body.dark-mode .search-input,
  body.dark-mode .filter-select {
    background: #2c3e50;
    border-color: #4a5f7a;
    color: white;
  }
  
  body.dark-mode .search-input::placeholder {
    color: #95a5a6;
  }
  
  body.dark-mode .history-list-container {
    border-color: #4a5f7a;
    background: #2c3e50;
  }
  
  body.dark-mode .action-btn {
    background: #34495e;
    border-color: #4a5f7a;
    color: white;
  }
  
  body.dark-mode .action-btn.secondary {
    background: #2c3e50;
  }
  
  body.dark-mode .action-btn:hover {
    background: #4a5f7a;
  }
  
  body.dark-mode .item-action-btn:hover {
    background: #4a5f7a;
  }
  
  /* Focus states for accessibility */
  .history-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
  
  .action-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
  
  /* Print styles */
  @media print {
    .history-controls,
    .history-actions {
      display: none;
    }
    
    .history-list-container {
      max-height: none;
      border: none;
    }
    
    .history-item {
      break-inside: avoid;
    }
  }
  
  
  
  
  /* Logout Button Styles */
  .logout-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  }
  
  .logout-btn:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  }
  
  .logout-btn:active {
    transform: translateY(0);
  }
  
  /* Dark Mode Support for Logout Button */
  .dark-mode .logout-btn {
    background: linear-gradient(135deg, #ff6b6b, #c44569);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  }
  
  .dark-mode .logout-btn:hover {
    background: linear-gradient(135deg, #ff5252, #b33939);
  }
  
  /* Mobile Responsive for Logout Button */
  @media (max-width: 768px) {
    .logout-btn {
      padding: 8px 12px;
      font-size: 0.8rem;
    }
    
    .logout-text {
      display: none; /* Mobile pe sirf icon dikhega */
    }
    
    .logout-btn i {
      margin-right: 0;
    }
  }
  
  /* Chat Controls Layout Update for Logout Button */
  .chat-controls1 {
    display: flex;
    gap: 15px;
    align-items: center;
  }
  
  
  
  
  /* SCROLLBAR HIDE KARNE KA CODE */
.messages-container::-webkit-scrollbar {
    display: none;
}

.messages-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chat-container::-webkit-scrollbar {
    display: none;
}

.chat-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.text-input-container::-webkit-scrollbar {
    display: none;
}

.text-input-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#userInput::-webkit-scrollbar {
    display: none;
}

#userInput {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
  




.image-message {
    margin: 10px 0;
    max-width: 100%;
}

.image-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.dark-mode .image-info {
    background: #2d3748;
    border-color: #4a5568;
    color: #a0aec0;
}

.file-icon {
    font-size: 14px;
}

/* .file-name {
    font-weight: 500;
    flex: 1;
    min-width: 150px;
}
/* Image Comparison Styles */
.comparison-container {
    margin: 10px 0;
}

.image-comparison {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.image-half {
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.image-half strong {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 14px;
}

.dark-mode .image-half strong {
    color: #a0aec0;
} */

.edit-changes {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.edit-changes strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.edit-changes ul {
    margin: 5px 0;
    padding-left: 20px;
}

.edit-changes li {
    margin: 4px 0;
    font-size: 14px;
}
.file-size {
    color: #6c757d;
    font-size: 12px;
    white-space: nowrap;
}
/* Image Message Styles */
.image-message {
    margin: 10px 0;
}

.image-message img {
    max-width: 300px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
