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

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

.chat-container {
  display: flex;
  height: 100vh;
  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); }
.chat-input:disabled { background: rgba(255, 200, 200, 0.7); border-color: #ff6b6b; color: #d32f2f; }
.chat-input:disabled::placeholder { color: #d32f2f; opacity: 0.8; }
.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;
}

@media (max-width: 768px) {
  .chat-container { flex-direction: column; }
  .sidebar { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid #4a4b53; }
  .conversation-list { max-height: 150px; }
  .chat-input-wrapper { max-width: 100%; }
  .message-content { max-width: 90%; }
  .form-row { flex-direction: column; gap: 10px; }
}