/* GPT-5 Ask Page Styles - Water Theme */

/* Tab Navigation Styles */
.tab-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tab-nav {
  display: flex;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-bottom: 2px solid rgba(33, 150, 243, 0.3);
  padding: 0 16px;
  gap: 8px;
  flex-shrink: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #1976d2;
  padding: 12px 24px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(33, 150, 243, 0.1);
  color: #1565c0;
}

.tab-btn.active {
  color: #0d47a1;
  border-bottom-color: #2196f3;
  background: rgba(255, 255, 255, 0.5);
}

.tab-btn i {
  font-size: 16px;
}

.tab-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  display: none;
  height: 100%;
  overflow: hidden;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* Table Content Styles */
.table-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(227, 242, 253, 0.3);
  overflow: hidden;
}

.table-header {
  padding: 16px 24px;
  background: rgba(227, 242, 253, 0.8);
  border-bottom: 1px solid rgba(33, 150, 243, 0.3);
  flex-shrink: 0;
}

.table-header h3 {
  color: #0d47a1;
  font-size: 20px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.table-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.event-filter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.event-filter-box label {
  color: #1565c0;
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.event-filter-box input {
  padding: 6px 10px;
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 4px;
  font-size: 14px;
  color: #0d47a1;
  flex: 1;
}

.event-filter-hint {
  color: #1976d2;
  font-size: 12px;
  opacity: 0.8;
}

.refresh-btn {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.refresh-btn:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

#eventTableContainer {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Event Table Styles */
.event-table {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(33, 150, 243, 0.15);
}

.event-table table {
  width: 100%;
  border-collapse: collapse;
}

.event-table th {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.event-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(33, 150, 243, 0.1);
  color: #263238;
  font-size: 14px;
}

.event-table tr:hover {
  background: rgba(33, 150, 243, 0.05);
}

.event-table .event-id {
  font-weight: 600;
  color: #e53e3e;
}

.event-table .event-code {
  background: #1976d2;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.event-table .guarantee-badge {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

body {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 40%, #90caf9 100%);
  color: #1565c0;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  font-family: 'Segoe UI', 'Microsoft JhengHei', Arial, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
}

.chat-container {
  display: flex;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background: rgba(144, 202, 249, 0.15);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(33, 150, 243, 0.3);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.1);
}

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

.sidebar-toggle {
  position: absolute;
  left: 16px;
  top: 20px;
  background: rgba(33, 150, 243, 0.8);
  border: 1px solid rgba(33, 150, 243, 0.6);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  padding: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.sidebar-toggle:hover { background: rgba(25, 118, 210, 0.9); }

.search-container { padding: 12px 16px; border-bottom: 1px solid rgba(33, 150, 243, 0.3); }

.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: #1976d2; font-size: 14px; z-index: 1; }
.search-input {
  width: 100%; padding: 8px 12px 8px 36px; background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(33, 150, 243, 0.3); border-radius: 8px; color: #0d47a1; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: #2196f3; box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2); }
.search-input::placeholder { color: #1976d2; opacity: 0.7; }

.sidebar-header { padding: 16px; border-bottom: 1px solid rgba(33, 150, 243, 0.3); display: flex; align-items: center; justify-content: space-between; }
.sidebar-title { font-size: 16px; font-weight: 600; color: #0d47a1; text-shadow: 0 1px 2px rgba(13, 71, 161, 0.2); }
.new-chat-btn { background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); color: white; border: none; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 14px; transition: all 0.2s; box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3); }
.new-chat-btn:hover { background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4); }

.conversation-list { flex: 1; overflow-y: auto; padding: 8px; position: relative; }
.conversation-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; margin-bottom: 4px; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: #1565c0; font-size: 14px; line-height: 1.4; font-weight: 500; }
.conversation-item:hover { background: rgba(33, 150, 243, 0.1); transform: translateX(4px); }
.conversation-item.active { background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); color: white; box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4); }
.conversation-content { flex: 1; min-width: 0; }
.conversation-title { font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #0d47a1; }
.conversation-preview { color: #1976d2; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.conversation-item.active .conversation-preview { color: rgba(255, 255, 255, 0.9); }

.conversation-actions { display: none; gap: 4px; margin-left: 8px; }
.conversation-item:hover .conversation-actions { display: flex; }
.conversation-item.active .conversation-actions { display: flex; }
.action-btn { background: none; border: none; color: #1976d2; cursor: pointer; padding: 4px; border-radius: 6px; font-size: 12px; transition: all 0.2s; }
.action-btn:hover { background: rgba(33, 150, 243, 0.1); color: #0d47a1; }
.action-btn.edit:hover { color: #2196f3; background: rgba(33, 150, 243, 0.1); }
.action-btn.delete:hover { color: #d32f2f; background: rgba(211, 47, 47, 0.1); }

.edit-title-input { width: 100%; padding: 4px 8px; background: rgba(255, 255, 255, 0.95); border: 1px solid #2196f3; border-radius: 6px; color: #0d47a1; font-size: 14px; outline: none; font-weight: 500; }
.edit-title-input:focus { border-color: #1976d2; box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2); }

.main-content-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.chat-header { padding: 16px 24px 16px 60px; border-bottom: 1px solid rgba(33, 150, 243, 0.3); display: flex; align-items: center; justify-content: space-between; background: rgba(227, 242, 253, 0.8); backdrop-filter: blur(10px); flex-shrink: 0; }
.chat-title { font-size: 18px; font-weight: 700; color: #0d47a1; text-shadow: 0 1px 3px rgba(13, 71, 161, 0.2); }
.nav-btn { background: linear-gradient(90deg, #4fc3f7 0%, #1976d2 100%); color: #fff; border: none; border-radius: 8px; padding: 0.5rem 1rem; text-decoration: none; display: inline-block; margin-left: 0.5rem; transition: background 0.2s; font-size: 14px; }
.nav-btn:hover { background: linear-gradient(90deg, #1976d2 0%, #4fc3f7 100%); color: #fff; text-decoration: none; }

.share-btn { background: linear-gradient(90deg, #ff6b6b 0%, #ee5a24 100%); color: #fff; border: none; border-radius: 8px; padding: 0.5rem 1rem; text-decoration: none; display: inline-block; margin-left: 0.5rem; transition: background 0.2s; font-size: 14px; cursor: pointer; }
.share-btn:hover { background: linear-gradient(90deg, #ee5a24 0%, #ff6b6b 100%); color: #fff; text-decoration: none; }
.share-btn:disabled { background: #4a4b53; cursor: not-allowed; opacity: 0.6; }

.main-content { flex: 1; display: flex; flex-direction: column; background: rgba(227, 242, 253, 0.3); min-height: 0; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; scroll-behavior: smooth; position: relative; }
.scroll-to-bottom-btn { position: absolute; bottom: 20px; right: 20px; width: 40px; height: 40px; background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); border: none; border-radius: 50%; color: white; cursor: pointer; display: none; align-items: center; justify-content: center; transition: all 0.2s; z-index: 1000; box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4); }
.scroll-to-bottom-btn.visible { display: flex; }

.message { margin-bottom: 24px; display: flex; gap: 16px; }
.message.user { flex-direction: row-reverse; }
.message-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; flex-shrink: 0; }
.message.user .message-avatar { background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); color: white; }
.message.assistant .message-avatar { background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%); color: white; }
.message-content { flex: 1; max-width: 80%; padding: 16px; border-radius: 16px; line-height: 1.6; word-wrap: break-word; overflow-wrap: break-word; }
.message.user .message-content { background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); color: white; box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3); }
.message.assistant .message-content { background: rgba(255, 255, 255, 0.95); color: #263238; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); border: 1px solid rgba(33, 150, 243, 0.1); line-height: 1.7; }

.typing-indicator { display: inline-block; margin-left: 8px; }
.typing-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background-color: #2196f3; margin: 0 2px; animation: typing 1.4s infinite ease-in-out; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

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

.chat-input-container { padding: 24px; border-top: 1px solid rgba(33, 150, 243, 0.3); background: rgba(227, 242, 253, 0.8); backdrop-filter: blur(10px); flex-shrink: 0; }
.chat-input-wrapper { position: relative; max-width: 768px; margin: 0 auto; }
.chat-input { width: 100%; padding: 16px 48px 16px 16px; background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(33, 150, 243, 0.3); border-radius: 12px; color: #0d47a1; font-size: 16px; resize: none; min-height: 52px; max-height: 200px; outline: none; transition: all 0.2s; box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1); font-weight: 500; }
.chat-input::placeholder { color: #1976d2; opacity: 0.7; }
.chat-input:focus { border-color: #2196f3; box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1), 0 2px 8px rgba(33, 150, 243, 0.2); }
.send-button { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); border: none; border-radius: 8px; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3); }
.send-button:hover { background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4); }
.send-button:disabled { background: #bbbbbb; cursor: not-allowed; transform: none; box-shadow: none; }
.send-button.processing { background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); animation: pulse 1.5s infinite; }
.send-button.processing:hover { background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); transform: none; }

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

/* Image Upload Styles */
.image-upload-area {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(33, 150, 243, 0.3);
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item .remove-image {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(255, 0, 0, 0.8);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-upload-controls { display: flex; justify-content: space-between; align-items: center; }
.remove-all-images-btn { background: #dc3545; color: white; border: none; border-radius: 4px; padding: 6px 12px; font-size: 12px; cursor: pointer; transition: background-color 0.2s; }
.remove-all-images-btn:hover { background: #c82333; }
.image-count-info { color: #1976d2; font-size: 12px; font-weight: 500; }

.input-controls { display: flex; align-items: flex-end; gap: 8px; }
.image-upload-btn { background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%); color: white; border: none; border-radius: 8px; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3); }
.image-upload-btn:hover { background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%); transform: translateY(-1px); }
.image-upload-btn.has-images { background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%); }
.image-upload-btn.has-images:hover { background: linear-gradient(135deg, #4caf50 0%, #43a047 100%); }

/* Drag & Drop highlight */
.chat-input-wrapper.dragover { outline: 2px dashed #2196f3; outline-offset: 4px; border-radius: 12px; background: rgba(33, 150, 243, 0.05); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: #1565c0; }
.empty-state h1 { font-size: 32px; font-weight: 700; margin-bottom: 16px; color: #0d47a1; text-shadow: 0 2px 4px rgba(13, 71, 161, 0.2); }
.suggestions { display: flex; flex-direction: column; gap: 12px; max-width: 400px; width: 100%; }
.suggestion-btn { padding: 12px 16px; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(33, 150, 243, 0.3); border-radius: 12px; color: #1565c0; text-align: left; cursor: pointer; transition: all 0.2s; font-size: 14px; box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1); font-weight: 500; }
.suggestion-btn:hover { background: rgba(33, 150, 243, 0.1); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2); }

.error-message {
  padding: 8px 12px;
  background: rgba(244, 67, 54, 0.1);
  border-left: 3px solid #d32f2f;
  color: #b71c1c;
  font-size: 14px;
  margin: 4px 0;
  border-radius: 6px;
  font-weight: 500;
}

/* Request Info Modal Styles */
.request-info-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}
.request-info-section {
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}
.section-header {
  background: rgba(227, 242, 253, 0.8);
  padding: 10px 15px;
  font-weight: 700;
  color: #0d47a1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-content {
  padding: 15px;
  color: #263238;
  line-height: 1.6;
  font-weight: 400;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-label {
  color: #1976d2;
  font-weight: 600;
}
.info-value {
  color: #0d47a1;
  word-break: break-all;
  font-weight: 500;
}
.info-value.monospace {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
}
.info-item.full-width {
  grid-column: 1 / -1;
  background: rgba(13, 110, 253, 0.05);
  padding: 8px;
  border-radius: 4px;
  margin-top: 4px;
}
.request-info-section.full-width {
  grid-column: 1 / -1;
  width: 100%;
}
.section-content.text-content {
  text-align: left;
  font-size: 0.95em;
  white-space: pre-wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.info-label {
  font-size: 0.85em;
  color: #1976d2;
  font-weight: 600;
}
.fas {
  color: #2196f3;
}

/* Markdown Table Styles */
.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.message-content table th,
.message-content table td {
  border: 1px solid rgba(33, 150, 243, 0.3);
  padding: 12px;
  text-align: left;
}

.message-content table th {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #0d47a1;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.5px;
}

.message-content table tr:nth-child(even) {
  background: rgba(227, 242, 253, 0.3);
}

.message-content table tr:hover {
  background: rgba(33, 150, 243, 0.08);
  transition: background 0.2s ease;
}

.message-content table td {
  color: #263238;
  font-size: 0.95em;
}

/* Responsive table scroll */
.message-content table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

/* User message tables (white text on blue background) */
.message.user .message-content table {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.message.user .message-content table th,
.message.user .message-content table td {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.message.user .message-content table th {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.message.user .message-content table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

.message.user .message-content table tr:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Brand Serial Tab */
.brandserial-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(227, 242, 253, 0.3);
  overflow: hidden;
}

.brandserial-header {
  padding: 20px 24px;
  background: rgba(227, 242, 253, 0.85);
  border-bottom: 1px solid rgba(33, 150, 243, 0.2);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brandserial-header-text h3 {
  margin: 0 0 6px 0;
  color: #0d47a1;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brandserial-header-text h3 i {
  color: #1976d2;
}

.brandserial-current {
  margin: 0;
  color: #1565c0;
  font-size: 14px;
}

.brandserial-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brandserial-search {
  position: relative;
  min-width: 260px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
}

.brandserial-search i {
  position: absolute;
  left: 12px;
  color: #1976d2;
  font-size: 14px;
}

.brandserial-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  color: #0d47a1;
  background: transparent;
  outline: none;
}

.brandserial-search input::placeholder {
  color: #1976d2;
  opacity: 0.7;
}

.brandserial-loading,
.brandserial-error,
.brandserial-empty {
  margin: 0 24px;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.brandserial-loading {
  color: #1976d2;
  background: rgba(33, 150, 243, 0.08);
}

.brandserial-loading i {
  font-size: 18px;
}

.brandserial-error {
  color: #d32f2f;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.brandserial-empty {
  color: #1565c0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px dashed rgba(33, 150, 243, 0.4);
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 8px;
}

.brandserial-empty i {
  font-size: 32px;
  color: #90caf9;
}

.brandserial-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.brandserial-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  border: 1px solid rgba(33, 150, 243, 0.2);
  box-shadow: 0 6px 18px rgba(33, 150, 243, 0.12);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brandserial-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(33, 150, 243, 0.18);
  border-color: rgba(33, 150, 243, 0.4);
}

.brandserial-item.active {
  border-color: #1976d2;
  box-shadow: 0 12px 26px rgba(25, 118, 210, 0.25);
}

.brandserial-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.brandserial-banner {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(227, 242, 253, 0.6);
  border: 1px solid rgba(33, 150, 243, 0.2);
  flex-shrink: 0;
}

.brandserial-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brandserial-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 700;
  color: #0d47a1;
}

.brandserial-divider {
  color: rgba(25, 118, 210, 0.4);
}

.brandserial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #1976d2;
}

.brandserial-meta i {
  color: #1976d2;
  margin-right: 4px;
}

.brandserial-location {
  font-size: 13px;
  color: #1565c0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brandserial-location i {
  color: #ff7043;
}

.brandserial-actions-line {
  display: flex;
  justify-content: flex-end;
}

.brandserial-apply-btn {
  background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(33, 150, 243, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.brandserial-apply-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(33, 150, 243, 0.3);
}

.brandserial-apply-btn.active {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
  box-shadow: 0 6px 14px rgba(67, 160, 71, 0.25);
}

.brandserial-apply-btn:disabled {
  background: #b0bec5;
  cursor: not-allowed;
  box-shadow: none;
}

.brandserial-apply-btn i {
  color: inherit;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  /* Tab Styles for Mobile */
  .tab-nav {
    padding: 0 8px;
    gap: 4px;
  }

  .brandserial-header {
    padding: 16px;
  }

  .brandserial-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brandserial-search {
    flex: 1;
    min-width: 0;
  }

  .brandserial-search input {
    padding: 10px 12px 10px 34px;
  }

  .brandserial-list {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  .brandserial-item {
    padding: 16px;
  }

  .brandserial-actions .refresh-btn {
    width: 100%;
    justify-content: center;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .tab-btn i {
    font-size: 14px;
  }

  .table-header {
    padding: 12px 16px;
  }

  .table-header h3 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .table-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .event-filter-box {
    flex-wrap: wrap;
  }

  .event-filter-box input {
    width: 100%;
    margin-top: 4px;
  }

  .refresh-btn {
    width: 100%;
    justify-content: center;
  }

  #eventTableContainer {
    padding: 12px;
  }

  .event-table {
    font-size: 12px;
  }

  .event-table th,
  .event-table td {
    padding: 8px;
    font-size: 12px;
  }

  /* Horizontal scroll for table on mobile */
  .event-table {
    overflow-x: auto;
  }

  .event-table table {
    min-width: 600px;
  }

  .chat-container {
    position: relative;
  }

  /* Sidebar as overlay on mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  /* Overlay when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }

  .sidebar:not(.collapsed) ~ .sidebar-overlay {
    display: block;
  }

  .sidebar-toggle {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 1200;
    width: 40px;
    height: 40px;
    padding: 10px;
  }

  .main-content-wrapper {
    width: 100%;
  }

  .chat-header {
    padding: 12px 16px 12px 56px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .chat-title {
    font-size: 16px;
    width: 100%;
  }

  .nav-btn, .share-btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  .chat-messages {
    padding: 12px;
  }

  .message {
    margin-bottom: 16px;
    gap: 12px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .message-content {
    max-width: 85%;
    padding: 12px;
    font-size: 14px;
  }

  .chat-input-container {
    padding: 16px 12px;
  }

  .chat-input {
    font-size: 14px;
    padding: 12px 44px 12px 12px;
    min-height: 44px;
  }

  .send-button {
    width: 32px;
    height: 32px;
    right: 6px;
    bottom: 6px;
  }

  .image-upload-btn {
    width: 32px;
    height: 32px;
  }

  /* Empty state mobile */
  .empty-state h1 {
    font-size: 24px;
  }

  .suggestions {
    padding: 0 12px;
    max-width: 100%;
  }

  .suggestion-btn {
    font-size: 13px;
    padding: 10px 12px;
  }

  /* Conversation list mobile */
  .conversation-item {
    font-size: 13px;
    padding: 10px;
  }

  .conversation-preview {
    display: none;
  }

  .new-chat-btn {
    font-size: 13px;
    padding: 6px 10px;
  }

  /* Image preview mobile */
  .image-preview-item {
    width: 60px;
    height: 60px;
  }

  /* Table responsive */
  .message-content table {
    font-size: 12px;
  }

  .message-content table th,
  .message-content table td {
    padding: 8px;
  }

  /* Code blocks */
  .message-content pre {
    font-size: 12px;
    padding: 8px;
    overflow-x: auto;
  }

  .message-content code {
    font-size: 12px;
  }

  /* Request info modal mobile */
  .request-info-container {
    max-height: 70vh;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .section-content {
    padding: 10px;
    font-size: 13px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .sidebar-toggle {
    width: 36px;
    height: 36px;
    padding: 8px;
    font-size: 16px;
  }

  .chat-header {
    padding: 10px 12px 10px 50px;
  }

  .chat-title {
    font-size: 14px;
  }

  .nav-btn, .share-btn {
    font-size: 11px;
    padding: 5px 8px;
    margin-left: 4px;
  }

  .message-content {
    max-width: 90%;
    padding: 10px;
    border-radius: 12px;
  }

  .chat-input {
    font-size: 13px;
    padding: 10px 40px 10px 10px;
  }

  .send-button, .image-upload-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .empty-state h1 {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .suggestion-btn {
    font-size: 12px;
    padding: 8px 10px;
  }

  /* Smaller image previews on small screens */
  .image-preview-item {
    width: 50px;
    height: 50px;
  }

  .image-preview-item .remove-image {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-header {
    padding: 8px 12px 8px 50px;
  }

  .chat-input-container {
    padding: 12px;
  }

  .chat-messages {
    padding: 8px;
  }

  .message {
    margin-bottom: 12px;
  }

  .empty-state h1 {
    font-size: 20px;
  }
}