body {
  background-color: #f8f9fa;
  color: #212529;
}

body.dark-mode {
  background-color: #212529;
  color: #f8f9fa;
}

.login-container {
  background-color: #fff;
  color: #212529;
  border: 1px solid #e0e0e0;
}

body.dark-mode .login-container {
  background-color: #333;
  color: #f8f9fa;
  border: 1px solid #555;
}

.login-submit-btn {
  background-color: #0d6efd;
  color: white;
}

body.dark-mode .login-submit-btn {
  background-color: #0056b3;
}

.control-btn {
  background-color: #f0f0f0;
}

body.dark-mode .control-btn {
  background-color: #444;
}

.modal-content {
  background-color: white;
  color: black;
}

body.dark-mode .modal-content {
  background-color: #444;
  color: white;
}

.modal-header, .modal-footer {
  background-color: #f1f1f1;
}

body.dark-mode .modal-header, body.dark-mode .modal-footer {
  background-color: #333;
}

body.dark-mode .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

body.dark-mode .form-check-label {
  color: #f8f9fa;
}

body.light-mode .form-check-label {
  color: #212529;
}

/* Chat History Styling */
.chat-history .chat-item {
  transition: background-color 0.2s;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  font-size: 0.9rem;
  background-color: #f8f9fa;
}

body.dark-mode .chat-history .chat-item {
  background-color: #212529;
}

.chat-default-image {
  background-color: #fff;
}

body.dark-mode .chat-default-image {
  background-color: #444;
}

.user-message {
  color: #212529;
  background-color: rgb(217, 231, 247);
}

body.dark-mode .user-message {
  background-color: #333 !important;
  color: #f8f9fa;
}

.chat-input-wrapper {
  background-color: #fff;
}

body.dark-mode .chat-input-wrapper {
  background-color: #333;
}

.chat-textarea {
  background-color: transparent;
}

body.dark-mode .chat-textarea {
  background-color: #444;
  color: #f8f9fa;
}

.chat-header {
  background-color: white;
}

body.dark-mode .chat-header {
  background-color: #333;
}

.login-checkbox {
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
}

body.dark-mode .login-checkbox {
  background-color: #555;
  border-color: #777;
}

.login-checkbox:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

body.dark-mode .login-checkbox:checked {
  background-color: #007bff;
}



.modal-content {
  background-color: white;
  color: black;
}

body.dark-mode .modal-content {
  background-color: #444;
  color: white;
}

.modal-header, .modal-footer {
  background-color: #f1f1f1;
}

body.dark-mode .modal-header, body.dark-mode .modal-footer {
  background-color: #333;
}

/* Material Symbols Styling */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

/* For filled icons */
.material-symbols-filled {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

body {
  background-color: #f8f9fa;
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;  
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Chat History Styling */
.chat-history .chat-item {
  transition: background-color 0.2s;
  cursor: pointer;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  font-size: 0.9rem;
}

.chat-history .chat-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Custom text truncation for chat titles */
.text-truncate-custom {
  font-size: 0.7rem;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 30ch; /* Limit to 25 characters */
}

/* Chat Messages Container */
.chat-messages {
  scroll-behavior: smooth;
  padding: 1rem;
  padding-top: 20px;
}

.chat-default-image {
  border-radius: 16px;
  padding: 10px;
  background-color: #fff;
}

/* Message Animation */
.message {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Magic Icon Container */
.magic-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #212529;
  border-radius: 50%;
  animation: pulse 1.5s infinite ease-in-out;
}

.magic-icon-container span {
  color: white;
  font-size: 24px;
}

/* Thinking Text Animation */
.thinking-text {
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0.5;
    transform: scale(0.98);
  }
}

/* Voice Recorder Overlay */
.voice-recorder-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-recorder-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Recording Indicator (Animated Circle) */
.recording-indicator {
  width: 100px;
  height: 100px;
  background-color: #444;
  border-radius: 50%;
  animation: breathe 3s infinite ease-in-out;
}

@keyframes breathe {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Recording Controls */
.recording-controls {
  position: absolute;
  bottom: 50px;
  display: flex;
  gap: 20px;
}

.control-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #f0f0f0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.control-btn span {
  font-size: 28px;
}

.control-btn:hover {
  background-color: #e0e0e0;
}

.control-btn i {
  font-size: 24px;
}

/* Make sure the chat container takes full height */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Chat Input Styling */
.chat-input-wrapper {
  width: 100%;
  max-width: 860px;
  margin: 0 auto 0px auto;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-textarea {
  width: 100%;
  min-height: 60px;
  max-height: 200px;
  padding: 15px 20px;
  border: none;
  resize: none;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.5;
  background-color: transparent;
  transition: height 0.2s ease;
  outline: 0 !important;
  -webkit-appearance: none;
}

.chat-input-wrapper:focus-within {
  border-color: #c0c0c0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chat-buttons {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-top: 1px solid transparent;
}

.chat-input-wrapper:focus-within .chat-buttons {
  border-top-color: #f0f0f0;
}

.left-buttons {
  display: flex;
  align-items: center;
  margin-left: -2px;
}

.right-buttons {
  display: flex;
  align-items: center;
  margin-right: -2px;
}

.btn-circle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  border: none;
  color: #6c757d;
  margin: 0 5px;
  position: relative;
  transition: all 0.2s ease;
}

.btn-circle:hover {
  background-color: #e0e0e0;
  color: #212529;
}

.btn-submit {
  color: #0d6efd;
}

.btn-submit:hover {
  background-color: #e6f0ff;
  color: #0a58ca;
}

/* Material Icons styling */
.material-icons {
  font-size: 20px;
}

/* Action Icon Button Styling - for message actions and header icons */
.action-icon-btn {
  width: 32px;
  height: 32px;
  background-color: white;
  border: none;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  cursor: pointer;
  outline: none !important;
}

.action-icon-btn:hover,
.action-icon-btn:focus {
  background-color: #f0f0f0;
  box-shadow: none;
  outline: none;
}

.action-icon-btn:active {
  background-color: #e0e0e0;
  box-shadow: none;
  outline: none;
}

.action-icon-btn span {
  font-size: 18px;
}

/* Placeholder for the sidebar toggle button when hidden */
.action-icon-btn-placeholder {
  width: 32px;
  height: 32px;
}

/* Dark Popover Styling */
.dark-popover {
  --bs-popover-bg: #333;
  --bs-popover-body-color: white;
  --bs-popover-max-width: 200px;
  --bs-popover-border-color: #444;
  --bs-popover-header-bg: #222;
  --bs-popover-header-color: white;
}

body.dark-mode .sidebar {
  background-color: #333;
}
/* Sidebar Styling */
.sidebar {
  width: 260px;
  height: 100vh;
  background-color: white;
  border-right: 1px solid #dee2e6;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  transition: transform 0.3s ease-in-out;
}

.sidebar-closed {
  transform: translateX(-100%);
}

.sidebar-open {
  transform: translateX(0);
}

/* Apply custom scrollbar to sidebar chat history */
.sidebar .chat-history::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar .chat-history::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.sidebar .chat-history::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.sidebar .chat-history::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Main Content Styling */
.main-content {
  height: 100vh;
  position: relative;
  transition: margin-left 0.3s ease-in-out;
}

/* Desktop behavior (sidebar pushes content) */
@media (min-width: 768px) {
  .main-shifted {
    margin-left: 260px; /* Width of sidebar */
  }

  .main-shifted .chat-input {
    left: 260px; /* Width of sidebar */
  }
}

/* Mobile behavior (sidebar overlays content) */
@media (max-width: 767.98px) {
  .main-content {
    margin-left: 0 !important;
    transition: none;
  }

  .sidebar {
    z-index: 1040; /* Higher z-index to ensure it's above the main content */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  .chat-input {
    left: 0 !important;
    transition: none;
  }

  .chat-textarea {
    max-height: 250px;  
  }
}

.bot-thinking {
  padding: 0 10px !important;
}

/* Chat Header Styling */
.chat-header {
  border-bottom: 1px solid #dee2e6;
  background-color: white;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Chat Content - Limited Width */
.chat-content {
  max-width: 800px;
  width: 100%;
  margin-bottom: 250px;
}

.user-message {
  max-width: 80%;
  padding: 1rem;
  background: rgb(217 231 247) !important;
}

/* Chat Input */
.chat-input {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 100;
  background-color: transparent;
  padding: 15px;
  transition: left 0.3s ease-in-out;
}

/* Responsive adjustments for chat messages */
@media (max-width: 768px) {
  .chat-content {
    max-width: 100%;
  }

  .chat-input-container {
    max-width: 100%;
  }

  .chat-input-container_newtopic {
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .chat-messages {
    padding: 0;
    padding-top: 1rem;
  }
  
  .message-actions {
    flex-wrap: wrap;
    color: #7c7c7c;
  }

  /* Improve message content display on mobile */
  .bot-message {
    max-width: 100%;
    padding: 0 0 0 5px;    
  }

  /* Ensure table is properly responsive */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Adjust image size for mobile */
  .image-container img {
    max-width: 100%;
    height: auto;
  }
}

/* Improve responsiveness for very small screens */
@media (max-width: 576px) {

  .chat-input {
    padding: 10px !important;
  }

  /* Make header more compact on small screens */
  .chat-header {
    padding: 0.5rem !important;
  }

  /* Adjust title size on small screens */
  .chat-header h5 {
    font-size: 1rem;
  }
}

/* Table responsiveness fixes */
.table-responsive {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100vw;  /* Ensure table container never exceeds viewport width */
}

.table {
  margin-bottom: 0;
  white-space: nowrap;  /* Prevent text wrapping in cells */
}

/* Mobile-specific table adjustments */
@media (max-width: 768px) {
  .table-responsive {
    margin: 0 -2rem 0 0;  /* Negative margin to counter parent padding */
  }

  .message {
    padding: 0.5rem;
  }

  .message-content {
    overflow: hidden;  /* Prevent content from breaking out */
  }

  .table td, .table th {
    padding: 0.5rem;  /* Smaller padding on mobile */
    font-size: 0.875rem;  /* Slightly smaller font on mobile */
  }
}

/* Global focus style reset */
*:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Reset for webkit browsers */
*:focus-visible {
  outline: none !important;
  -webkit-focus-ring-color: transparent !important;
  outline-color: transparent !important;
}

/* Reset for Firefox */
*::-moz-focus-inner {
  border: 0 !important;
}

/* Login specific styles */
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.login-title {
  text-align: center;
  margin-bottom: 30px;
  font-weight: 600;
}

.login-form-group {
  margin-bottom: 20px;
  position: relative;
}

.general-input {
  height: 50px;
  width: 100%;
  padding: 10px 15px 10px 45px;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background-color: #f5f5f5;
  font-size: 16px;
  transition: all 0.3s ease;
}

.general-input:focus {
  border-color: #c0c0c0;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.general-input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

.login-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 0.2em;
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.login-checkbox:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.login-checkbox-label {
  font-size: 14px;
  color: #6c757d;
}

.login-forgot-link {
  font-size: 14px;
  color: #0d6efd;
  text-decoration: none;
  float: right;
  margin-top: 5px;
}

.login-forgot-link:hover {
  text-decoration: underline;
}

.login-submit-btn {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  background-color: #0d6efd;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.login-submit-btn:hover {
  background-color: #0b5ed7;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Modal styling */
.login-password-modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-password-modal-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 20px 25px;
}

.login-password-modal-title {
  font-weight: 600;
  color: #333;
}

.login-password-modal-body {
  padding: 25px;
}

.login-password-modal-footer {
  border-top: 1px solid #f0f0f0;
  padding: 15px 25px;
}

.login-password-reset-btn {
  background-color: #0d6efd;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 500;
  color: white;
}

.login-password-reset-btn:hover {
  background-color: #0b5ed7;
}

.login-password-cancel-btn {
  background-color: #f5f5f5;
  color: #6c757d;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 500;
}

.login-password-cancel-btn:hover {
  background-color: #e9ecef;
  color: #333;
}

/* Material Icons styling */
.login-icon {
  font-size: 20px;
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}

.card {
  background: var(--card-bg);
  color: var(--card-text);
  cursor: pointer;
  text-align: center;
  justify-content: center;
  align-items: center;
  font-size: 1em;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 300px;
  box-sizing: border-box;
  transition: background 0.3s, color 0.3s;
}

/* Hover effect in light mode */
.card:hover {
  background: grey;
  color: white;
}

/* Hover effect in dark mode */
.dark-mode .card:hover {
  background: white;
  color: black; /* optional: improves readability */
}

/* Light mode variables */
:root {
  --card-bg: #f0f0f0;
  --card-text: #000000;
}

/* Dark mode variables */
.dark-mode {
  --card-bg: #2b2b2b;
  --card-text: #ffffff;
}

/* Mobil reszponzivitás */
@media (max-width: 768px) {
  .card {
    width: 100%;
  }
}

@media only screen and (max-width: 600px) {
  #countdownOverlay {
    font-size: 1.2em;
    padding-top: 30vh;
  }
  #countdownText {
    font-size: 1em !important;
  }
  #countdownTimer {
    font-size: 2em !important;
  }
}