* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  width: 100vw;
  height: 100vh;
  background: white;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}

.app-container {
  width: calc(100vw - 40px);
  height: calc(100vh - 40px);
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  background: white;
  max-width: 90%;
  margin: 0 auto;
}

/* Main Content */
.main-content {
  width: calc(100% - 300px);
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-left: 300px; /* Account for sidebar width on desktop */
  transition: margin-left 0.3s ease;
}

.main-container {
  display: flex;
  gap: 20px;
  width: 100%;
  height: 100%;
  padding: 10px 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.container {
  background: white;
  border-radius: 0 20px 20px 0;
  box-shadow: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.info-panel {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 420px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.info-panel h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.departure-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.departure-info label {
  font-weight: 600;
  color: #4A90E2;
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.departure-info .value {
  color: #333;
  font-size: 16px;
}

.departure-info .empty {
  color: #999;
  font-style: italic;
}

#static-table-container {
  flex: 1;
  overflow-y: auto;
}

#static-table-container::-webkit-scrollbar {
  width: 8px;
}

#static-table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#static-table-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

#static-table-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-style: italic;
}

h2 {
  color: white;
  margin: 0;
  padding: 20px;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  border-radius: 0 20px 0 0;
}

#chat-box {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #f7fafd;
}

#chat-box::-webkit-scrollbar {
  width: 8px;
}

#chat-box::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#chat-box::-webkit-scrollbar-thumb {
  background: #4A90E2;
  border-radius: 4px;
}

#chat-box::-webkit-scrollbar-thumb:hover {
  background: #357ABD;
}

.user, .bot {
  max-width: 65%;
  padding: 14px 18px;
  border-radius: 16px;
  position: relative;
  font-size: 1rem;
  animation: fadeIn 0.3s ease-in;
}

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

.user {
  align-self: flex-end;
  background: #4A90E2;
  color: white;
}

.bot {
  align-self: flex-start;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e0e0e0;
}

.message-bubble {
  word-wrap: break-word;
  line-height: 1.5;
}

.input-container {
  padding: 24px 32px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 20px 0;
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  background: white;
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: #4A90E2;
  box-shadow: 0 2px 20px rgba(74, 144, 226, 0.15);
}

#user-input {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  resize: none;
  outline: none;
  font-size: 1rem;
  max-height: 120px;
  overflow-y: auto;
  background: transparent;
  color: #1a202c;
  transition: all 0.2s ease;
}

#user-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f8f9fa;
}

#user-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.input-container button {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.input-container button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 144, 226, 0.35);
}

.input-container button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.input-container button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 15px 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

thead {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
}

th {
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: #f5f5f5;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background-color: #fafafa;
}

tbody tr:nth-child(even):hover {
  background-color: #f0f0f0;
}

/* ========================================
   SIDEBAR STYLES
   ======================================== */

.sidebar {
  width: 300px;
  height: 100%;
  background: #2c3e50;
  color: white;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  border-radius: 20px 0 0 20px;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 16px 20px;
  background: #34495e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3e5266;
  border-radius: 20px 0 0 0;
}

.sidebar-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 600;
}

.sidebar-title i {
  color: #4A90E2;
}

.new-session-btn {
  background: #4A90E2;
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1rem;
}

.new-session-btn:hover {
  background: #357abd;
  transform: scale(1.05);
}

.sessions-search {
  padding: 16px 20px;
  border-bottom: 1px solid #3e5266;
}

.search-wrapper {
  position: relative;
}

.search-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #7f8c8d;
  z-index: 1;
}

#sessions-search {
  width: 100%;
  padding: 10px 16px 10px 36px;
  border: 1px solid #3e5266;
  border-radius: 8px;
  background: #34495e;
  color: white;
  outline: none;
  font-size: 0.9rem;
}

#sessions-search::placeholder {
  color: #7f8c8d;
}

#sessions-search:focus {
  border-color: #4A90E2;
  background: #2c3e50;
}

.sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sessions-list::-webkit-scrollbar {
  width: 8px;
}

.sessions-list::-webkit-scrollbar-track {
  background: #34495e;
}

.sessions-list::-webkit-scrollbar-thumb {
  background: #4A90E2;
  border-radius: 4px;
}

.sessions-list::-webkit-scrollbar-thumb:hover {
  background: #357ABD;
}

.session-item {
  padding: 16px 20px;
  cursor: pointer;
  border-bottom: 1px solid #3e5266;
  transition: all 0.2s;
  position: relative;
}

.session-item:hover {
  background: #34495e;
}

.session-item.active {
  background: #4A90E2;
  border-left: 4px solid #357abd;
}

.session-item.active:hover {
  background: #357abd;
}

.session-row-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.session-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.session-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
}

.session-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #bdc3c7;
  gap: 8px;
}

.session-item.active .session-meta {
  color: rgba(255, 255, 255, 0.9);
}

.session-time {
  color: #95a5a6;
  font-size: 0.75rem;
}

.session-message-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.session-menu-btn {
  background: none;
  border: none;
  color: #bdc3c7;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.session-item:hover .session-menu-btn,
.session-item:focus-within .session-menu-btn {
  opacity: 1;
}

.session-menu-btn:hover {
  background: rgba(74, 144, 226, 0.2);
  color: #4A90E2;
}

.session-item.active .session-menu-btn {
  color: rgba(255, 255, 255, 0.9);
}

.session-item.active .session-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.session-menu-dropdown {
  position: absolute;
  right: 16px;
  top: 48px;
  min-width: 140px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(44, 62, 80, 0.18);
  border: 1px solid #e2e8f0;
  padding: 6px 0;
  z-index: 100;
  display: none;
}

.session-menu-dropdown button {
  width: 100%;
  background: none;
  border: none;
  color: #34495e;
  font-size: 0.97rem;
  padding: 10px 18px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, color 0.2s;
}

.session-menu-dropdown button:hover {
  background: #f0f4fa;
  color: #4A90E2;
}

.session-menu-dropdown button i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.loading-sessions,
.no-sessions {
  padding: 40px 20px;
  text-align: center;
  color: #7f8c8d;
}

.loading-sessions i {
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.no-sessions i {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #3e5266;
  background: #34495e;
}

.session-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #bdc3c7;
}

.session-stats i {
  color: #4A90E2;
}

.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 2001;
  background: rgba(74, 144, 226, 0.9);
  display: none;
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  background: #357abd;
  transform: scale(1.05);
}

/* Responsive */
@media (min-width: 1201px) {
  .sidebar {
    display: flex;
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 300px;
    width: calc(100% - 300px);
  }
  
  .sidebar-toggle {
    display: none;
  }
}

@media (max-width: 1200px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    z-index: 2000;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .info-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 280px;
  }
  
  .sidebar-toggle {
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
  }
}

.chat-status {
  font-style: italic;
  color: #555;
  margin: 4px 0;
  font-size: 0.9em;
}

/* ========================================
STATUS BAR STYLES
======================================== */

.status-bar {
  padding: 12px 24px;
  background: #f0f4f8;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 48px;
  max-height: 200px;
  overflow-y: auto;
}

.status-item {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(53, 122, 189, 0.1) 100%);
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: #4A90E2;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  animation: statusFadeIn 0.3s ease-in-out;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
  backdrop-filter: blur(10px);
}

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

.status-item::before {
  content: '●';
  font-size: 0.6rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (max-width: 600px) {
  .status-bar {
    padding: 10px 16px;
    min-height: 44px;
  }

  .status-item {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

/* ========================================
   REGLEMENT ICON & MODAL STYLES
   ======================================== */

.reglement-cell {
  text-align: center;
  padding: 8px !important;
}

.reglement-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: #4A90E2;
}

.reglement-icon-btn:hover {
  background: rgba(74, 144, 226, 0.1);
  transform: scale(1.1);
}

.reglement-icon-btn:active {
  transform: scale(0.95);
}

.reglement-icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Modal Styles */
.reglement-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
}

.reglement-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

.reglement-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
}

.reglement-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.reglement-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.reglement-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.reglement-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Reglement table uses same style as main table (class 'table') */

@media (max-width: 768px) {
  .reglement-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .reglement-modal-header {
    padding: 16px 20px;
  }

  .reglement-modal-header h3 {
    font-size: 1.1rem;
  }

  .reglement-modal-body {
    padding: 16px;
  }
}

/* Popup Modal Styles */
.popup-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
}

.popup-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.popup-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
}

.popup-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.popup-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.popup-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.popup-modal-body {
  padding: 24px;
  color: #333;
  line-height: 1.6;
}

.popup-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  background: #f8f9fa;
}

.popup-modal-ok {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.popup-modal-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.popup-modal-ok:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .popup-modal-content {
    width: 95%;
    max-width: 400px;
  }

  .popup-modal-header {
    padding: 16px 20px;
  }

  .popup-modal-header h3 {
    font-size: 1.1rem;
  }

  .popup-modal-body {
    padding: 16px;
  }

  .popup-modal-footer {
    padding: 12px 16px;
  }
}

