/* Modern ChatGPT Clone - Scoped Styles */

/* Force scrolling to work everywhere - override any conflicts */
html, body {
  overflow: auto !important;
  height: auto !important;
}

/* Only apply styles when ChatGPT wrapper is present */
.chatgpt-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Reset styles only within the chatgpt wrapper */
.chatgpt-wrapper * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Main Wrapper - Full Screen Edge to Edge */
.chatgpt-wrapper {
  display: flex;
  height: calc(100vh - 70px); /* Full height minus navigation */
  width: 100vw;
  max-width: 100vw;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  position: fixed;
  top: 70px; /* Start below navigation */
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  color: #ffffff;
  box-sizing: border-box;
  z-index: 100;
}

/* Sidebar - Floating Overlay Design */
.chatgpt-sidebar {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 320px;
  max-height: calc(100vh - 200px);
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatgpt-sidebar:hover {
  background: rgba(15, 15, 35, 0.98);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* Collapsed state */
.chatgpt-sidebar.collapsed {
  width: 60px;
  height: 60px;
  padding: 16px;
  max-height: 60px;
  justify-content: center;
  align-items: center;
  gap: 0;
}

/* Sidebar header with toggle */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  position: relative;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

/* Enhanced visibility for open state (when acting as close button) */
.chatgpt-sidebar:not(.collapsed) .sidebar-toggle {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.chatgpt-sidebar:not(.collapsed) .sidebar-toggle:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.chatgpt-sidebar:not(.collapsed) .sidebar-toggle:active {
  background: rgba(239, 68, 68, 0.35);
  transform: scale(1.05);
}

/* Hide content when collapsed */
.chatgpt-sidebar.collapsed .sidebar-content {
  display: none;
}

.chatgpt-sidebar.collapsed .sidebar-header h2 {
  display: none;
}

/* Show only toggle when collapsed - Enhanced visibility */
.chatgpt-sidebar.collapsed .sidebar-toggle {
  background: rgba(16, 163, 127, 0.15);
  color: #10a37f;
  border: 1px solid rgba(16, 163, 127, 0.3);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.2);
}

.chatgpt-sidebar.collapsed .sidebar-toggle:hover {
  background: rgba(16, 163, 127, 0.25);
  color: #ffffff;
  border-color: rgba(16, 163, 127, 0.5);
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(16, 163, 127, 0.3);
}

.chatgpt-sidebar.collapsed .sidebar-toggle:active {
  background: rgba(16, 163, 127, 0.35);
  transform: scale(1.05);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  flex: 1;
}

.chatgpt-sidebar::-webkit-scrollbar {
  width: 6px;
}

.chatgpt-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.chatgpt-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.chatgpt-sidebar h2 {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

#new-chat-btn {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10a37f 0%, #0d8f6a 100%);
  color: white;
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(16, 163, 127, 0.3);
  position: relative;
  overflow: hidden;
}

#new-chat-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#new-chat-btn:hover::before {
  left: 100%;
}

#new-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 163, 127, 0.4);
}

#new-chat-btn:active {
  transform: translateY(0);
}

#chatgpt-history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chatgpt-history-list li {
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#chatgpt-history-list li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(135deg, #10a37f, #0d8f6a);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

#chatgpt-history-list li:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

#chatgpt-history-list li:hover::before {
  transform: scaleY(1);
}

#chatgpt-history-list li.active {
  background: rgba(16, 163, 127, 0.15);
  border-color: rgba(16, 163, 127, 0.3);
  color: #ffffff;
  font-weight: 500;
}

#chatgpt-history-list li.active::before {
  transform: scaleY(1);
}

.no-chat-msg {
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  font-style: italic;
  padding: 20px;
}

/* Chat item content */
.chat-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.chat-delete-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

#chatgpt-history-list li:hover .chat-delete-btn {
  opacity: 1;
  transform: scale(1);
}

.chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  transform: scale(1.1);
}

.chat-delete-btn:active {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(0.95);
}

/* Chat Container - Full Screen */
.chatgpt-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

/* Chat Messages Area - Full Screen with proper clearance */
.chatgpt-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 60px 20px 60px; /* Removed bottom padding - form no longer overlays */
  display: flex;
  flex-direction: column;
  gap: 32px;
  scroll-behavior: smooth;
  background: transparent;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-height: 0; /* Allow flex item to shrink */
}

/* Center messages for better readability on wide screens */
@media (min-width: 1200px) {
  .chatgpt-messages {
    padding: 20px 10% 20px 10%;
  }
}

@media (min-width: 1600px) {
  .chatgpt-messages {
    padding: 20px 15% 20px 15%;
  }
}

.chatgpt-messages::-webkit-scrollbar {
  width: 8px;
}

.chatgpt-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatgpt-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.chatgpt-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Message Bubbles */
.chatgpt-message {
  word-break: break-word;
  white-space: pre-wrap;
  padding: 24px 28px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.7;
  position: relative;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chatgpt-message.user {
  align-self: flex-end;
  max-width: 70%;
  background: linear-gradient(135deg, #10a37f 0%, #0d8f6a 100%);
  color: white;
  border-radius: 20px 20px 6px 20px;
  box-shadow: 0 4px 20px rgba(16, 163, 127, 0.3);
  font-weight: 500;
}

.chatgpt-message.bot {
  align-self: flex-start;
  max-width: 95%; /* Take up almost full width for immersive experience */
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 20px 20px 20px 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Make bot messages even wider on larger screens */
@media (min-width: 1200px) {
  .chatgpt-message.bot {
    max-width: 98%;
  }
}

.chatgpt-message.bot pre {
  background: rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  padding: 16px 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.chatgpt-message.bot pre::-webkit-scrollbar {
  height: 6px;
}

.chatgpt-message.bot pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chatgpt-message.bot pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* Error Messages */
.chatgpt-message.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* Typing Indicator */
.chatgpt-message.typing {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 20px 24px;
  border-radius: 20px 20px 20px 6px;
  align-self: flex-start;
  max-width: 80px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatgpt-typing {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatgpt-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10a37f, #0d8f6a);
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.chatgpt-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatgpt-typing span:nth-child(2) { animation-delay: -0.16s; }

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

/* Copy Button */
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Enhanced visibility for bot message content */
.chatgpt-message.bot h1,
.chatgpt-message.bot h2,
.chatgpt-message.bot h3,
.chatgpt-message.bot h4,
.chatgpt-message.bot h5,
.chatgpt-message.bot h6 {
  color: #f1f5f9 !important;
  font-weight: 600 !important;
  margin: 16px 0 12px 0 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.chatgpt-message.bot h1 { font-size: 1.8em !important; }
.chatgpt-message.bot h2 { font-size: 1.6em !important; }
.chatgpt-message.bot h3 { font-size: 1.4em !important; }
.chatgpt-message.bot h4 { font-size: 1.2em !important; }
.chatgpt-message.bot h5 { font-size: 1.1em !important; }
.chatgpt-message.bot h6 { font-size: 1em !important; }

.chatgpt-message.bot p {
  color: #f8fafc !important;
  margin: 12px 0 !important;
  line-height: 1.7 !important;
}

.chatgpt-message.bot ul,
.chatgpt-message.bot ol {
  color: #f8fafc !important;
  margin: 12px 0 !important;
  padding-left: 24px !important;
}

.chatgpt-message.bot li {
  color: #f8fafc !important;
  margin: 6px 0 !important;
  line-height: 1.6 !important;
}

.chatgpt-message.bot a {
  color: #60a5fa !important;
  text-decoration: underline !important;
  font-weight: 500 !important;
  transition: color 0.2s ease !important;
}

.chatgpt-message.bot a:hover {
  color: #93c5fd !important;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.chatgpt-message.bot strong,
.chatgpt-message.bot b {
  color: #f1f5f9 !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chatgpt-message.bot em,
.chatgpt-message.bot i {
  color: #e2e8f0 !important;
  font-style: italic !important;
}

.chatgpt-message.bot blockquote {
  background: rgba(255, 255, 255, 0.08) !important;
  border-left: 4px solid #60a5fa !important;
  margin: 16px 0 !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  color: #e2e8f0 !important;
  font-style: italic !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chatgpt-message.bot table {
  border-collapse: collapse !important;
  width: 100% !important;
  margin: 16px 0 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chatgpt-message.bot th,
.chatgpt-message.bot td {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  padding: 12px 16px !important;
  text-align: left !important;
  color: #f8fafc !important;
}

.chatgpt-message.bot th {
  background: rgba(255, 255, 255, 0.1) !important;
  font-weight: 600 !important;
  color: #f1f5f9 !important;
}

.chatgpt-message.bot code:not(pre code) {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #fbbf24 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.chatgpt-message.bot hr {
  border: none !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
  margin: 24px 0 !important;
}

/* Input Area - Fixed at bottom using flexbox */
.chatgpt-form {
  flex-shrink: 0; /* Prevent form from shrinking */
  padding: 12px 60px 16px 60px;
  background: rgba(15, 15, 35, 0.98);
  backdrop-filter: blur(40px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  min-height: 60px;
}

/* Responsive input padding to match messages */
@media (min-width: 1200px) {
  .chatgpt-messages {
    padding: 20px 10% 20px 10%;
  }
}

@media (min-width: 1600px) {
  .chatgpt-messages {
    padding: 20px 15% 20px 15%;
  }
}

/* Generation Mode Buttons - Ultra Compact */
.generation-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.gen-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  min-height: 28px;
}

.gen-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.gen-btn:hover::before {
  left: 100%;
}

.gen-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: #ffffff;
}

.gen-btn.active {
  background: linear-gradient(135deg, #10a37f 0%, #0d8f6a 100%);
  border-color: rgba(16, 163, 127, 0.5);
  color: white;
  box-shadow: 0 4px 20px rgba(16, 163, 127, 0.3);
}

.gen-btn .gen-text {
  display: none;
  white-space: nowrap;
}

.gen-btn.active .gen-text {
  display: inline;
}

.gen-btn .gen-icon {
  font-size: 18px;
}

/* Input Container */
.input-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 4px;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.input-container:focus-within {
  border-color: rgba(16, 163, 127, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.chatgpt-input {
  flex: 1;
  resize: none;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 15px;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  min-height: 20px;
  max-height: 120px;
  line-height: 1.4;
  overflow-y: auto;
  outline: none;
}

.chatgpt-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chatgpt-input::-webkit-scrollbar {
  width: 6px;
}

.chatgpt-input::-webkit-scrollbar-track {
  background: transparent;
}

.chatgpt-input::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Action Buttons - Ultra Compact */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
}

#upload-btn, #record-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

#upload-btn:hover, #record-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: scale(1.05);
}

#record-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
}

.chatgpt-send-btn {
  background: linear-gradient(135deg, #10a37f 0%, #0d8f6a 100%);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(16, 163, 127, 0.3);
}

.chatgpt-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 163, 127, 0.4);
}

.chatgpt-send-btn:active {
  transform: translateY(0);
}

.chatgpt-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Attachment Preview */
#chatgpt-attachment-preview {
  padding: 0 4px 8px;
}

.attachment-file {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  gap: 10px;
  max-width: 300px;
  backdrop-filter: blur(10px);
}

.attachment-file small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.attachment-file .remove-attachment {
  cursor: pointer;
  margin-left: auto;
  color: #ef4444;
  font-weight: bold;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.attachment-file .remove-attachment:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

/* File type indicators */
.attachment-file[data-type="image"] {
  border-left: 4px solid #10a37f;
}

.attachment-file[data-type="audio"] {
  border-left: 4px solid #3b82f6;
}

.attachment-file[data-type="document"] {
  border-left: 4px solid #f59e0b;
}

/* Audio Message Styles */
.chatgpt-message.audio-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 20px;
  min-height: 60px;
}

.chatgpt-message.user.audio-message {
  flex-direction: row-reverse;
  background: linear-gradient(135deg, #10a37f 0%, #0d8f6a 100%);
}

.chatgpt-message.bot.audio-message {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.waveform {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
}

.waveform canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px;
}

.waveplay-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.waveplay-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .chatgpt-sidebar {
    width: 240px;
  }
  
  .chatgpt-messages {
    padding: 24px;
  }
  
  .chatgpt-message {
    max-width: 85%;
  }
}

@media (max-width: 768px) {
  .chatgpt-wrapper {
    flex-direction: column;
    height: calc(100vh - 70px);
    top: 70px;
  }

  .chatgpt-sidebar {
    width: 100%;
    height: 120px;
    padding: 16px;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .chatgpt-sidebar h2 {
    display: none;
  }

  #new-chat-btn {
    min-width: 120px;
    padding: 12px 16px;
    font-size: 14px;
  }

  #chatgpt-history-list {
    flex-direction: row;
    gap: 12px;
  }

  #chatgpt-history-list li {
    min-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chatgpt-container {
    flex: 1;
    min-height: 0;
  }

  .chatgpt-messages {
    padding: 16px;
    gap: 16px;
  }

  .chatgpt-message {
    max-width: 90%;
    padding: 16px 20px;
    font-size: 14px;
  }

  .chatgpt-form {
    padding: 16px 20px 24px;
  }

  .generation-buttons {
    gap: 8px;
  }

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

  .chatgpt-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 14px 16px;
  }

  .chatgpt-send-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .chatgpt-wrapper {
    height: calc(100vh - 70px);
    top: 70px;
  }

  .chatgpt-sidebar {
    height: 100px;
    padding: 12px;
  }

  #new-chat-btn {
    min-width: 100px;
    padding: 10px 12px;
    font-size: 13px;
  }

  #chatgpt-history-list li {
    min-width: 120px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .chatgpt-container {
    flex: 1;
    min-height: 0;
  }

  .chatgpt-messages {
    padding: 12px;
    gap: 12px;
  }

  .chatgpt-message {
    padding: 14px 16px;
    font-size: 14px;
  }

  .chatgpt-form {
    padding: 12px 16px 20px;
    gap: 12px;
  }

  .generation-buttons {
    gap: 6px;
  }

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

  .gen-btn .gen-icon {
    font-size: 16px;
  }

  .input-container {
    padding: 3px;
  }

  .chatgpt-input {
    padding: 12px 14px;
  }

  .action-buttons {
    gap: 6px;
    padding: 6px;
  }

  #upload-btn, #record-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .chatgpt-send-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* Smooth scrollbar for chatgpt elements only */
.chatgpt-wrapper * {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #10a37f;
  outline-offset: 2px;
}

/* Loading animation for messages */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.loading-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}
