/* ===== CHATBOX STYLES ===== */

/* ===== IMPORTS & FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */
:root {
  /* Color Palette */
  --primary-bg: #0a0b14;
  --secondary-bg: #0f1419;
  --sidebar-bg: #121426;
  --accent-blue: #00d4ff;
  --text-cyan: #4fc3f7;
  --accent-green: #00ff88;
  --text-primary: #ffffff;
  --text-secondary: #a8d2ff;
  --text-muted: #6b7280;
  --border-color: #1e213a;
  --hover-bg: rgba(255, 255, 255, 0.1);
  
  /* Effects */
  --glow-effect: 0 0 20px rgba(0, 212, 255, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Delete/Error States */
  --delete-color: #ff5252;
  --delete-bg: rgba(255, 82, 82, 0.1);
  --delete-hover-bg: rgba(255, 82, 82, 0.2);
  --delete-glow: 0 0 15px rgba(255, 82, 82, 0.4);
  
  /* Typography */
  --font-primary: 'Rajdhani', sans-serif;
  --font-mono: 'Orbitron', monospace;
  
  /* Layout */
  --container-width: 420px;
  --container-height: 500px;
  --border-radius: 8px;
  --border-radius-lg: 16px;
}

/* ===== CHAT CONTAINER ===== */
.container {
  position: fixed;
  bottom: 1px;
  right: 24px;
  width: var(--container-width);
  height: var(--container-height);
  display: flex;
  flex-direction: column;
  /* Transparent dark liquid-glass background (slightly lighter for more transparency) */
  background: rgba(8, 12, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glow-effect);
  z-index: 150;
  width: 500px;
}

/* ===== CHAT INTERFACE ===== */
.header-bar {
  background: rgba(15, 20, 25, 0.9);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}

.header-bar h1 {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-cyan);
  text-shadow: 0 0 15px var(--text-cyan);
  letter-spacing: 1px;
  margin: 0;
  display: flex;
  align-items: center;
}

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

.header-actions button {
  font-size: 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
}

/* AI Model Button - same style as new-chat and export-chat */



.header-actions button i {
  color: #a8d2ff;
  transition: var(--transition);
}

.header-actions .separator {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.header-actions button:hover {
  background: var(--hover-bg);
  border-color: var(--text-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

.header-actions button:hover i {
  color: #a8d2ff;
}

/* AI MODEL SELECTOR styles moved to css/components/ai-dropdown.css */

/* AI Modal Buttons - exclude from general header-actions styles */
.ai-modal-btn {
  min-width: auto !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  border-radius: 4px !important;
  width: 20px !important;
  height: 20px !important;
  font-size: 11px !important;
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  background: rgba(0, 0, 0, 0.4) !important;
  z-index: 15 !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  /* Force square shape with rounded corners */
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

.ai-modal-btn:hover {
  background: rgba(0, 255, 255, 0.15) !important;
  border-color: var(--text-cyan) !important;
  color: var(--text-cyan) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.3) !important;
}

/* ===== SYSTEM MESSAGES ===== */
.message.system-message {
  background: rgba(79, 195, 247, 0.1);
  border-left: 3px solid var(--text-cyan);
  border-radius: 8px;
  margin: 8px 0;
  padding: 12px 16px;
  animation: slideInFromLeft 0.3s ease-out;
}

.message.system-message .message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message.system-message .message-text {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
}

.message.system-message .message-timestamp {
  color: var(--text-secondary);
  font-size: 11px;
  opacity: 0.7;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Ensure transparent chat background over the glass panel */
  background: transparent;
}

/* ===== CHAT BUBBLES ===== */
.bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-weight: 400;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
  color: #a8d2ff;
}

.bubble.user {
  align-self: flex-end;
  background: rgba(0, 212, 255, 0.25);
  color: var(--text-primary);
  border: 1px solid rgba(0, 212, 255, 0.5);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
  font-weight: 500;
}

.bubble.bot,
.bubble.assistant {
  align-self: flex-start;
  background: rgba(79, 195, 247, 0.15);
  color: #a8d2ff;
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.1);
}

.bubble.success,
.bubble.welcome-message {
  align-self: flex-start;
  background: rgba(79, 195, 247, 0.15);
  color: #a8d2ff;
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.1);
}

.bubble.error {
  background: rgba(255, 82, 82, 0.15);
  color: #ff9999;
  border: 1px solid rgba(255, 82, 82, 0.3);
  animation: shake 0.5s ease-in-out;
}



/* ===== INPUT AREA ===== */
.input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  border-bottom-left-radius: var(--border-radius-lg);
  border-bottom-right-radius: var(--border-radius-lg);
  background: rgba(15, 20, 25, 0.9);
  display: flex;
  gap: 12px;
  position: relative;
}

.input-area input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  transition: var(--transition);
}

.input-area input:focus {
  outline: none;
  border-color: var(--text-cyan);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

.input-area button {
  font-size: 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
}

.input-area button:hover {
  background: var(--hover-bg);
  border-color: var(--text-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-container {
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  background: rgba(18, 20, 38, 0.98);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  backdrop-filter: blur(20px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 200;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.autocomplete-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30, 33, 58, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: rgba(79, 195, 247, 0.1);
  border-left: 3px solid var(--text-cyan);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-command {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-cyan);
  font-weight: 600;
  margin-bottom: 4px;
}

.autocomplete-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.autocomplete-example {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.8;
}

/* ===== NEW CHAT BUTTON ===== */
#new-chat {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
}

#new-chat:hover {
  background: var(--hover-bg);
  border-color: var(--text-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

#new-chat:hover i {
  transform: rotate(90deg);
}

#new-chat::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(79, 195, 247, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: var(--transition);
}

#new-chat:active::before {
  width: 100%;
  height: 100%;
}

#new-chat.creating {
  animation: newChatPulse 0.6s ease-in-out;
}

/* ===== EXPORT CHAT BUTTON ===== */
#export-chat:hover i {
  animation: saveAnimation 0.6s ease-in-out;
}

#export-chat.exporting {
  animation: exportPulse 0.8s ease-in-out;
}

#export-chat.exporting i {
  animation: saveSuccess 1s ease-in-out;
}

/* ===== SCROLLBAR STYLING ===== */
.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(79, 195, 247, 0.3);
  border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 195, 247, 0.5);
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes newChatPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes saveAnimation {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-10deg); }
  50% { transform: scale(1.05) rotate(0deg); }
  75% { transform: scale(1.1) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes exportPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(79, 195, 247, 0.6); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
}

@keyframes saveSuccess {
  0% { transform: scale(1); }
  25% { transform: scale(0.8); }
  50% { transform: scale(1.2); }
  75% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: calc(100vw - 48px);
    height: 400px;
    border-radius: 0;
    border: none;
  }
  
  .bubble {
    max-width: 90%;
  }
  
  .header-bar {
    padding: 12px 16px;
    min-height: 56px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  
  .header-actions button {
    padding: 6px;
    min-height: 32px;
    min-width: 32px;
    aspect-ratio: 1;
  }
  
  /* AI Model Button responsive styles */
  #ai-model-btn {
    padding: 6px 10px;
    border-radius: 6px;
  }

  /* AI Modal Buttons responsive styles */
  .ai-modal-btn {
    width: 16px !important;
    height: 16px !important;
    font-size: 9px !important;
    top: 2px !important;
    right: 2px !important;
    border-radius: 3px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }

  
  .chat-container {
    padding: 16px;
  }
  
  .input-area {
    padding: 12px 16px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

@media (max-width: 480px) {
  .header-bar h1 {
    font-size: 18px;
  }
  
  .header-actions button {
    padding: 6px;
    font-size: 12px;
    min-height: 28px;
    min-width: 28px;
    aspect-ratio: 1;
  }
  
  /* AI Model Button mobile responsive styles */
  #ai-model-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  /* AI Modal Buttons mobile responsive styles */
  .ai-modal-btn {
    width: 14px !important;
    height: 14px !important;
    font-size: 8px !important;
    top: 1px !important;
    right: 1px !important;
    border-radius: 2px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }


  
  .bubble {
    padding: 10px 14px;
    max-width: 95%;
  }
  
  .input-area input,
  .input-area button {
    padding: 10px 14px;
  }
}

/* ===== CODE BLOCK STYLES ===== */
.code-block-container {
  background: var(--background-dark, #0e121b);
  border: 1px solid var(--text-cyan, #4fc3f7);
  border-radius: 8px;
  margin: 12px 0;
  position: relative;
  overflow: hidden;
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  line-height: 1.45;
}

.code-block-content {
  max-height: 240px;
  overflow: auto;
  padding: 8px 12px;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

.code-block-container pre {
  margin: 0;
}

.code-block-container .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--text-cyan, #4fc3f7);
  color: var(--background-dark, #0e121b);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 150ms ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.code-block-container .copy-btn:hover {
  opacity: 1;
}

.code-block-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@media (max-width: 600px) {

  .code-block-container .copy-btn {
    top: 6px;
    right: 6px;
    padding: 3px 6px;
    font-size: 10px;
  }
}
/* ===== CODE MODAL STYLES ===== */

/* Modal Backdrop */
.code-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.code-modal-backdrop.hide {
  opacity: 0 !important;
  visibility: hidden !important;
  /* Debug: Ensure transition is applied */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  /* Debug: Force animation */
  transform: scale(0.95) !important;
}

/* Modal Container */
.code-modal {
  background: var(--primary-bg, #0a0b14);
  border: 2px solid var(--text-cyan, #4fc3f7);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 195, 247, 0.3);
  width: 90vw;
  max-width: 1000px;
  height: 80vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.code-modal-backdrop.show .code-modal {
  transform: scale(1) translateY(0);
}

.code-modal-backdrop.hide .code-modal {
  transform: scale(0.9) translateY(20px) !important;
  /* Debug: Ensure modal animation is smooth */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  /* Debug: Force modal animation */
  opacity: 0.8 !important;
}

/* Modal Header */
.code-modal-header {
  background: linear-gradient(135deg, var(--secondary-bg, #0f1419), var(--sidebar-bg, #121426));
  border-bottom: 1px solid var(--border-color, #1e213a);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.code-modal-title {
  font-family: var(--font-mono, 'Orbitron', monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-cyan, #4fc3f7);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

.code-modal-title i {
  font-size: 20px;
  animation: codeIconPulse 2s ease-in-out infinite;
}

.code-modal-close {
  background: transparent;
  border: 1px solid var(--border-color, #1e213a);
  color: var(--text-secondary, #a8d2ff);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
}

.code-modal-close:hover {
  background: var(--delete-bg, rgba(255, 82, 82, 0.1));
  border-color: var(--delete-color, #ff5252);
  color: var(--delete-color, #ff5252);
  box-shadow: 0 0 15px rgba(255, 82, 82, 0.3);
}

/* Modal Body */
.code-modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.code-modal-content {
  flex: 1;
  background: var(--primary-bg, #0a0b14);
  overflow: auto;
  padding: 24px;
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.code-modal-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-primary, #ffffff);
  background: transparent;
}

.code-modal-content code {
  font-family: inherit;
  color: inherit;
  background: transparent;
}

/* Custom Scrollbar for Modal */
.code-modal-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.code-modal-content::-webkit-scrollbar-track {
  background: rgba(30, 33, 58, 0.3);
  border-radius: 6px;
}

.code-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-blue, #00d4ff), var(--text-cyan, #4fc3f7));
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.code-modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--text-cyan, #4fc3f7), var(--accent-green, #00ff88));
  background-clip: content-box;
}

.code-modal-content::-webkit-scrollbar-corner {
  background: rgba(30, 33, 58, 0.3);
}

/* Modal Footer */
.code-modal-footer {
  background: linear-gradient(135deg, var(--secondary-bg, #0f1419), var(--sidebar-bg, #121426));
  border-top: 1px solid var(--border-color, #1e213a);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  gap: 16px;
}

.code-modal-stats {
  display: flex;
  gap: 20px;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
  font-family: var(--font-mono, 'Orbitron', monospace);
}

.code-modal-stats span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-modal-stats i {
  color: var(--text-cyan, #4fc3f7);
  font-size: 12px;
}

.code-modal-btn {
  background: linear-gradient(135deg, var(--accent-blue, #00d4ff), var(--text-cyan, #4fc3f7));
  color: var(--primary-bg, #0a0b14);
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}



.code-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(79, 195, 247, 0.5);
  background: linear-gradient(135deg, var(--text-cyan, #4fc3f7), var(--accent-green, #00ff88));
}

.code-modal-btn:active {
  transform: translateY(0);
}

.code-modal-btn.success {
  background: linear-gradient(135deg, var(--accent-green, #00ff88), #4caf50);
  animation: successPulse 0.6s ease-in-out;
}

.code-modal-btn.error {
  background: linear-gradient(135deg, var(--delete-color, #ff5252), #f44336);
  animation: errorShake 0.5s ease-in-out;
}

.download-btn {
  background: linear-gradient(135deg, #9c27b0, #e91e63);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.download-btn:hover {
  background: linear-gradient(135deg, #e91e63, #ff9800);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(156, 39, 176, 0.5);
}

.copy-btn {
  background: linear-gradient(135deg, var(--accent-blue, #00d4ff), var(--text-cyan, #4fc3f7));
  color: var(--primary-bg, #0a0b14);
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(79, 195, 247, 0.5);
  background: linear-gradient(135deg, var(--text-cyan, #4fc3f7), var(--accent-green, #00ff88));
}

.open-tab-btn {
  background: linear-gradient(135deg, #4caf50, #8bc34a);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.open-tab-btn:hover {
  background: linear-gradient(135deg, #8bc34a, #cddc39);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
}

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

/* Language Badge Styling */
.language-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.html-badge {
  background: rgba(79, 195, 247, 0.15);
  color: var(--text-cyan, #4fc3f7);
  border: 1px solid rgba(79, 195, 247, 0.3);
}

.html-badge:hover {
  background: rgba(79, 195, 247, 0.25);
  border-color: rgba(79, 195, 247, 0.5);
  transform: translateY(-1px);
}

/* ===== ENHANCED CODE BLOCK PREVIEW STYLES ===== */

.code-block-container {
  background: linear-gradient(135deg, rgba(10, 11, 20, 0.9), rgba(18, 20, 38, 0.9));
  border: 1px solid var(--text-cyan, #4fc3f7);
  border-radius: 12px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.code-block-container:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(79, 195, 247, 0.3);
  border-color: var(--accent-green, #00ff88);
}

.code-block-preview {
  padding: 16px 20px;
  max-height: 150px;
  overflow: hidden;
  position: relative;
}

.code-block-preview pre {
  margin: 0;
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #a8d2ff);
}

.code-block-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, rgba(10, 11, 20, 0.9));
  pointer-events: none;
}

.code-expand-indicator {
  background: linear-gradient(135deg, var(--accent-blue, #00d4ff), var(--text-cyan, #4fc3f7));
  color: var(--primary-bg, #0a0b14);
  padding: 12px 20px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.code-block-container:hover .code-expand-indicator {
  background: linear-gradient(135deg, var(--text-cyan, #4fc3f7), var(--accent-green, #00ff88));
}

.code-expand-indicator i {
  animation: expandPulse 2s ease-in-out infinite;
}

.quick-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(79, 195, 247, 0.9);
  color: var(--primary-bg, #0a0b14);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.3s ease;
  opacity: 0.8;
  backdrop-filter: blur(5px);
  z-index: 10;
}

/* Professional copy icon using CSS */
.quick-copy-btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Success state */
.quick-copy-btn.success::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

/* Error state */
.quick-copy-btn.error::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}

.quick-copy-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: var(--accent-green, #00ff88);
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

/* ===== ANIMATIONS ===== */

@keyframes codeIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@keyframes expandPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
  .code-modal {
    width: 95vw;
    height: 85vh;
    border-radius: 12px;
  }
  
  .code-modal-header,
  .code-modal-footer {
    padding: 16px 20px;
  }
  
  .code-modal-content {
    padding: 20px 16px;
    font-size: 13px;
  }
  
  .code-modal-title {
    font-size: 16px;
  }
  
  .code-modal-footer {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .code-modal-stats {
    justify-content: center;
    order: 1;
  }
  
  .code-modal-btn {
    width: 100%;
    justify-content: center;
  }
  
  .code-block-container {
    margin: 12px 0;
  }
  
  .code-block-preview {
    padding: 12px 16px;
  }
  
  .quick-copy-btn {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .code-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .code-modal-header {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  
  .code-modal-footer {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  
  .code-modal-content {
    font-size: 12px;
    padding: 16px;
  }
  
  .code-modal-content::-webkit-scrollbar {
    width: 8px;
  }
}

/* ===== DARK MODE ENHANCEMENTS ===== */

@media (prefers-color-scheme: dark) {
  .code-modal-backdrop {
    background: rgba(0, 0, 0, 0.9);
  }
  
  .code-modal {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.8), 
      0 0 30px rgba(79, 195, 247, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

/* ===== ACCESSIBILITY ===== */

.code-modal:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: -2px;
}

.code-modal-btn:focus,
.code-modal-close:focus,
.quick-copy-btn:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .code-modal-backdrop,
  .code-modal,
  .code-modal-btn,
  .code-block-container,
  .quick-copy-btn {
    border: 1px solid var(--text-cyan, #4fc3f7);
  }
  
  .codeIconPulse,
  .expandPulse {
    animation: none;
  }
}
/* ===== ADAUGĂ ACESTE STILURI ÎN CSS-UL TĂU =====  */

/* ===== CODE MODAL TABS ===== */
.code-modal-tabs {
  display: flex;
  background: linear-gradient(135deg, var(--secondary-bg, #0f1419), var(--sidebar-bg, #121426));
  border-bottom: 1px solid var(--border-color, #1e213a);
}

.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-muted, #6b7280);
  border: none;
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.tab-btn:hover {
  background: rgba(79, 195, 247, 0.1);
  color: var(--text-cyan, #4fc3f7);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(79, 195, 247, 0.2), rgba(0, 212, 255, 0.1));
  color: var(--text-cyan, #4fc3f7);
  box-shadow: inset 0 -3px 0 var(--text-cyan, #4fc3f7);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue, #00d4ff), var(--text-cyan, #4fc3f7));
  border-radius: 2px 2px 0 0;
}

.tab-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.tab-btn:hover i {
  transform: scale(1.1);
}





/* ===== PREVIEW BUTTON ===== */
.preview-btn {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.preview-btn:hover {
  background: linear-gradient(135deg, #f7931e, #ffb347);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(247, 147, 30, 0.4);
}



/* ===== RESPONSIVE DESIGN FOR TABS ===== */
@media (max-width: 768px) {
  .tab-btn {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .tab-btn i {
    font-size: 14px;
  }
  
  .code-modal-content {
    padding: 16px;
    font-size: 13px;
  }
  
  .preview-content {
    margin: 8px;
  }
  
  .html-preview-frame {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .code-modal-tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  
  .tab-btn.active::after {
    height: 2px;
  }
  
  .preview-content::before {
    font-size: 10px;
    padding: 3px 8px;
  }
  
  .html-preview-frame {
    min-height: 250px;
  }
}

/* ===== LOADING STATE FOR PREVIEW ===== */
.html-preview-frame[src=""] {
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
              linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  animation: previewLoading 1s linear infinite;
}

@keyframes previewLoading {
  0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
  100% { background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px; }
}

/* ===== TAB INDICATOR ANIMATION ===== */
.tab-btn.active {
  animation: tabActivate 0.3s ease-out;
}

@keyframes tabActivate {
  0% {
    transform: translateY(2px);
  box-shadow: inset 0 -1px 0 var(--text-cyan, #4fc3f7);
  }
  100% {
    transform: translateY(0);
  box-shadow: inset 0 -3px 0 var(--text-cyan, #4fc3f7);
  }
}

/* ===== PREVIEW ENHANCEMENT EFFECTS ===== */
.preview-content:hover::before {
  background: rgba(0, 212, 255, 0.9);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.html-preview-frame:hover {
  box-shadow: inset 0 0 0 2px rgba(79, 195, 247, 0.3);
  transition: box-shadow 0.3s ease;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.tab-btn:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: -2px;
}

.html-preview-frame:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: 2px;
}

/* ===== DARK MODE ENHANCEMENTS ===== */
@media (prefers-color-scheme: dark) {
  .html-preview-frame {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  .preview-content::before {
    background: rgba(79, 195, 247, 0.8);
    backdrop-filter: blur(10px);
  }
}
/* ===== NOAH AI ANALYSIS STYLES - VERSIUNE FINALĂ COMPLETĂ ===== */

/* ===== MODAL BODY STRUCTURE - CORECTAT ===== */
.code-modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative; /* Important pentru positioning */
}

/* ===== TAB CONTENT DISPLAY RULES - CORECTAT ===== */
.code-modal-content {
  position: absolute;
  top: 57px; /* Înălțimea tab-urilor + border */
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1;
}

/* Content-urile care sunt direct în body (fără tabs) */
.code-modal-body > .code-modal-content:first-child:not(.code-modal-tabs ~ .code-modal-content) {
  position: relative;
  top: 0;
  flex: 1;
  opacity: 1;
  visibility: visible;
}

/* Doar tab-ul activ este vizibil */
.code-modal-content.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* FORCE HIDE NON-ACTIVE TABS */
.code-modal-content:not(.active) {
  display: none !important;
}

.code-modal-content.active {
  display: block !important;
}

/* Special case pentru AI analysis care trebuie să fie flex */
#ai-tab-content.code-modal-content.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* ===== TAB NAVIGATION STRUCTURE ===== */
.code-modal-tabs {
  display: flex;
  background: linear-gradient(135deg, var(--secondary-bg, #0f1419), var(--sidebar-bg, #121426));
  border-bottom: 1px solid var(--border-color, #1e213a);
  flex-shrink: 0; /* Nu se micșorează */
  position: relative;
  z-index: 20; /* Deasupra content-urilor */
}

/* ===== TAB BUTTONS - STYLING ===== */
.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-muted, #6b7280);
  border: none;
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  min-height: 57px;
}

.tab-btn:hover {
  background: rgba(79, 195, 247, 0.1);
  color: var(--text-cyan, #4fc3f7);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(79, 195, 247, 0.2), rgba(0, 212, 255, 0.1));
  color: var(--text-cyan, #4fc3f7);
  box-shadow: inset 0 -3px 0 var(--text-cyan, #4fc3f7);
  animation: tabActivate 0.3s ease-out;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue, #00d4ff), var(--text-cyan, #4fc3f7));
  border-radius: 2px 2px 0 0;
}

/* ===== AI TAB SPECIFIC STYLING ===== */
.tab-btn.ai-tab {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(233, 30, 99, 0.1));
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.tab-btn.ai-tab:hover {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(233, 30, 99, 0.2));
  color: #e91e63;
  transform: translateY(-1px);
}

.tab-btn.ai-tab.active {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.3), rgba(233, 30, 99, 0.2));
  color: #e91e63;
  border-bottom-color: #e91e63;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3), inset 0 -3px 0 #e91e63;
}

.tab-btn.ai-tab.active::after {
  background: linear-gradient(90deg, #9c27b0, #e91e63);
}

/* ===== CODE TAB SPECIFIC ===== */
#code-tab-content {
  padding: 24px;
  background: var(--primary-bg, #0a0b14);
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 14px;
  line-height: 1.6;
}

#code-tab-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-primary, #ffffff);
  background: transparent;
}

#code-tab-content code {
  font-family: inherit;
  color: inherit;
  background: transparent;
}

/* ===== PREVIEW TAB SPECIFIC ===== */
#preview-tab-content {
  padding: 0;
  background: #ffffff;
  border-radius: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.html-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.preview-content::before {
  content: '🌐 HTML Preview';
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(79, 195, 247, 0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  z-index: 15;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-content:hover::before {
  background: rgba(0, 212, 255, 0.9);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.html-preview-frame:hover {
  box-shadow: inset 0 0 0 2px rgba(79, 195, 247, 0.3);
  transition: box-shadow 0.3s ease;
}

/* ===== AI ANALYSIS TAB SPECIFIC - CENTRAT PERFECT ===== */
#ai-tab-content {
  padding: 40px !important;
  background: linear-gradient(135deg, var(--primary-bg, #0a0b14), rgba(156, 39, 176, 0.03));
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
}

.ai-analysis-intro {
  text-align: center;
  max-width: 500px;
  width: 100%;
  background: rgba(18, 20, 38, 0.8);
  padding: 40px;
  border-radius: 16px;
  border: 1px solid rgba(156, 39, 176, 0.3);
  box-shadow: 0 8px 32px rgba(156, 39, 176, 0.2);
  backdrop-filter: blur(10px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Center the AI icon */
.ai-icon {
  font-size: 64px;
  margin: 0 auto 20px;
  display: block;
  text-align: center;
  animation: aiIconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(156, 39, 176, 0.5));
}

.ai-analysis-intro h3 {
  font-family: var(--font-mono, 'Orbitron', monospace);
  font-size: 24px;
  color: #e91e63;
  margin-bottom: 16px;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(233, 30, 99, 0.5);
  text-align: center;
}

.ai-analysis-intro p {
  color: var(--text-secondary, #a8d2ff);
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.6;
  text-align: center;
}

.ai-analysis-intro ul {
  text-align: left;
  margin: 24px 0;
  padding: 0;
  list-style: none;
  width: 100%;
  max-width: 400px; /* Limit width for better readability */
}

.ai-analysis-intro li {
  color: var(--text-secondary, #a8d2ff);
  padding: 8px 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  justify-content: flex-start; /* Align list items to the left within centered container */
}

.ai-analysis-intro li:hover {
  transform: translateX(8px);
  color: var(--text-primary, #ffffff);
}

/* Center the start analysis button */
.start-analysis-btn {
  background: linear-gradient(135deg, #9c27b0, #e91e63);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px auto 0; /* Center horizontally with top margin */
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  box-shadow: 0 8px 25px rgba(156, 39, 176, 0.4);
  position: relative;
  overflow: hidden;
  justify-content: center; /* Center content within button */
}

.start-analysis-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.6s ease;
}

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

.start-analysis-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(156, 39, 176, 0.6);
  background: linear-gradient(135deg, #e91e63, #ff9800);
}

.start-analysis-btn:active {
  transform: translateY(-1px) scale(1);
}

.start-analysis-btn i {
  font-size: 18px;
  animation: playIconPulse 2s ease-in-out infinite;
}

/* ===== ENHANCED MODAL HEADER ===== */
.code-modal-header.enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--secondary-bg, #0f1419), var(--sidebar-bg, #121426));
  border-bottom: 1px solid var(--border-color, #1e213a);
}

.header-left {
  display: flex;
  align-items: center;
}

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

.quick-ai-btn {
  background: linear-gradient(135deg, #9c27b0, #e91e63);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.quick-ai-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px rgba(156, 39, 176, 0.5);
  background: linear-gradient(135deg, #e91e63, #ff9800);
}

.quick-ai-btn:active {
  transform: translateY(0) scale(1);
}

.separator {
  width: 1px;
  height: 24px;
  background: var(--border-color, #1e213a);
}

/* ===== ENHANCED FOOTER - CU AI BUTTON ===== */
.code-modal-footer.enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--secondary-bg, #0f1419), var(--sidebar-bg, #121426));
  border-top: 1px solid var(--border-color, #1e213a);
  gap: 20px;
}

.footer-left {
  flex: 1;
}

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

.language-info {
  background: rgba(79, 195, 247, 0.2);
  color: var(--text-cyan, #4fc3f7);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(79, 195, 247, 0.3);
}

/* ===== AI ANALYSIS BUTTON DIN FOOTER - PĂSTRAT ===== */
.ai-analysis-btn {
  background: linear-gradient(135deg, #9c27b0, #e91e63);
  position: relative;
  overflow: hidden;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--font-primary, 'Rajdhani', sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.ai-analysis-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.ai-analysis-btn:hover::after {
  width: 300px;
  height: 300px;
}

.ai-analysis-btn:hover {
  background: linear-gradient(135deg, #e91e63, #ff9800);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(156, 39, 176, 0.5);
}

/* ===== INPUT ENHANCEMENT FOR AI MODE ===== */
.input-area input.ai-analysis-mode {
  border-color: #e91e63;
  box-shadow: 0 0 20px rgba(233, 30, 99, 0.5);
  background: rgba(233, 30, 99, 0.05);
  animation: aiInputPulse 1.5s ease-in-out;
}

/* ===== LOADING STATE FOR AI ANALYSIS - CENTRAT ===== */
.ai-loading {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: var(--text-secondary, #a8d2ff);
  min-height: 400px;
  text-align: center;
}

.ai-loading-icon {
  font-size: 48px;
  color: #e91e63;
  animation: aiLoadingRotate 2s linear infinite;
  margin-bottom: 20px;
}

.ai-loading-text {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
}

.ai-loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(233, 30, 99, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.ai-loading-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #9c27b0, #e91e63);
  animation: aiProgressBar 2s ease-in-out infinite;
}

/* ===== LOADING STATE FOR PREVIEW ===== */
.html-preview-frame[src=""] {
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
              linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  animation: previewLoading 1s linear infinite;
}



/* ===== ANIMATIONS ===== */
@keyframes aiIconFloat {
  0%, 100% { 
    transform: translateY(0) rotate(0deg); 
  }
  25% { 
    transform: translateY(-8px) rotate(2deg); 
  }
  50% { 
    transform: translateY(-5px) rotate(0deg); 
  }
  75% { 
    transform: translateY(-8px) rotate(-2deg); 
  }
}

@keyframes playIconPulse {
  0%, 100% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.1); 
  }
}

@keyframes aiInputPulse {
  0% { 
    border-color: var(--border-color); 
    box-shadow: none; 
  }
  50% { 
    border-color: #e91e63; 
    box-shadow: 0 0 25px rgba(233, 30, 99, 0.7); 
  }
  100% { 
    border-color: #e91e63; 
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.5); 
  }
}

@keyframes aiLoadingRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes aiProgressBar {
  0% { left: -100%; }
  50% { left: 0%; }
  100% { left: 100%; }
}



/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.tab-btn:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: -2px;
}

.html-preview-frame:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: 2px;
}

.code-modal:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: -2px;
}

.code-modal-btn:focus,
.code-modal-close:focus,
.quick-copy-btn:focus {
  outline: 2px solid var(--text-cyan, #4fc3f7);
  outline-offset: 2px;
}

/* ===== DARK MODE ENHANCEMENTS ===== */
@media (prefers-color-scheme: dark) {
  .html-preview-frame {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  .preview-content::before {
    background: rgba(79, 195, 247, 0.8);
    backdrop-filter: blur(10px);
  }
  
  .code-modal-backdrop {
    background: rgba(0, 0, 0, 0.9);
  }
  
  .code-modal {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.8), 
      0 0 30px rgba(79, 195, 247, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .code-modal-content {
    top: 50px; /* Tabs mai mici pe mobile */
  }
  
  .tab-btn {
    padding: 12px 16px;
    font-size: 13px;
    min-height: 50px;
  }
  
  .ai-analysis-intro {
    padding: 30px 20px;
    max-width: 90%;
  }
  
  .ai-icon {
    font-size: 48px;
  }
  
  .ai-analysis-intro h3 {
    font-size: 20px;
  }
  
  .start-analysis-btn {
    padding: 12px 24px;
    font-size: 14px;
    width: 100%;
    max-width: 280px;
  }
  
  .quick-ai-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .code-modal-footer.enhanced {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .footer-actions {
    justify-content: center;
    gap: 8px;
  }
  
  .footer-actions .code-modal-btn {
    flex: 1;
    max-width: 120px;
  }
  
  #code-tab-content {
    padding: 16px;
    font-size: 13px;
  }
  
  #ai-tab-content {
    padding: 20px !important;
  }
}

@media (max-width: 480px) {
  .code-modal-tabs {
    flex-direction: column;
  }
  
  .code-modal-content {
    top: 150px; /* 3 tabs stacked vertically */
  }
  
  .tab-btn {
    padding: 10px 12px;
    font-size: 12px;
    min-height: 45px;
  }
  
  .tab-btn.active::after {
    height: 2px;
  }
  
  .ai-analysis-content {
    padding: 20px;
  }
  
  .ai-analysis-intro {
    padding: 24px 16px;
  }
  
  .ai-analysis-intro li {
    font-size: 14px;
  }
  
  .start-analysis-btn {
    width: 100%;
    justify-content: center;
    max-width: none;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .quick-ai-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .footer-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .footer-actions .code-modal-btn {
    width: 100%;
    max-width: none;
  }
  
  .code-modal-content::-webkit-scrollbar {
    width: 8px;
  }
}

/* ===== REDUCE MOTION FOR ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  .code-modal-backdrop,
  .code-modal,
  .code-modal-btn,
  .code-block-container,
  .quick-copy-btn,
  .tab-btn {
    transition: none;
  }
  
  .aiIconFloat,
  .playIconPulse,
  .aiLoadingRotate,
  .previewLoading,
  .tabActivate {
    animation: none;
  }
}
.code-block-container.placeholder {
    border: 2px dashed #ffa726 !important;
    background: rgba(255, 167, 38, 0.1) !important;
}

.placeholder-indicator {
    background: rgba(255, 167, 38, 0.2) !important;
    color: #ffa726 !important;
}

.code-block-container.placeholder:hover {
    border-color: #ff9800 !important;
    box-shadow: 0 8px 30px rgba(255, 152, 0, 0.3) !important;
}

/* ===== SIDEBAR CONVERSATION ITEMS ===== */
/* Using existing JARVIS styling from style.css */

/* ===== SIDEBAR HISTORY STYLES MOVED TO style.css ===== */
/* All sidebar history related styles have been moved to public/style.css for better organization */

/* Fullscreen functionality */
.container.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.container.fullscreen .chat-container {
  position: fixed !important;
  top: 64px !important; /* Header height */
  left: 0 !important;
  right: 0 !important;
  bottom: 80px !important; /* Input area height */
  height: calc(100vh - 144px) !important; /* 100vh - header(64px) - input(80px) */
  max-height: none !important;
  overflow-y: auto !important;
}

.container.fullscreen .input-area {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  border-top: 1px solid var(--border-color, #333) !important;
  padding: 16px 24px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.container.fullscreen header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  border-bottom: 1px solid var(--border-color, #333) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  z-index: 1000 !important;
}

/* Fullscreen button */
.fullscreen-btn {
  background: transparent !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  margin-left: 8px !important;
}

.fullscreen-btn:hover {
  background: var(--hover-bg) !important;
  border-color: var(--text-cyan) !important;
  color: var(--text-cyan) !important;
  transform: scale(1.05) !important;
}

.fullscreen-btn.fullscreen {
  background: rgba(0, 212, 255, 0.2) !important;
  border-color: var(--text-cyan) !important;
  color: var(--text-cyan) !important;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4) !important;
}

.fullscreen-btn.fullscreen:hover {
  background: rgba(0, 212, 255, 0.3) !important;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5) !important;
  transform: scale(1.05) !important;
}

/* Enhanced input focus for better UX */
#user-input:focus {
  outline: none !important;
  border-color: var(--text-cyan) !important;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2) !important;
}

/* Fullscreen transition animations */
.container {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}



.container.fullscreen .chat-container {
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.container.fullscreen .input-area {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.container.fullscreen header {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Responsive adjustments for fullscreen */
@media (max-width: 768px) {
  .container.fullscreen {
    padding: 0 !important;
  }
  
  .container.fullscreen .chat-container {
    top: 56px !important; /* Smaller header on mobile */
    bottom: 72px !important; /* Smaller input on mobile */
    height: calc(100vh - 128px) !important;
  }
  
  .container.fullscreen .input-area {
    padding: 12px 16px !important;
  }
  
  .container.fullscreen header {
    padding: 8px 16px !important;
  }
}

@media (max-width: 480px) {
  .container.fullscreen .chat-container {
    top: 48px !important; /* Even smaller header on mobile */
    bottom: 64px !important; /* Even smaller input on mobile */
    height: calc(100vh - 112px) !important;
  }
  
  .container.fullscreen .input-area {
    padding: 8px 12px !important;
  }
  
  .container.fullscreen header {
    padding: 6px 12px !important;
  }
}

/* ===== MINIMIZE BUTTON ===== */
.minimize-btn {
  transition: var(--transition);
  position: relative;
}

.minimize-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
  transform: scale(1.05);
}

.minimize-btn.minimized {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--accent-green);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.minimize-btn.minimized:hover {
  background: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

/* ===== MINIMIZED STATE ===== */
.container.minimized {
  height: 64px;
  overflow: hidden;
  transition: var(--transition);
}

.container.minimized .chat-container,
.container.minimized .input-area {
  display: none;
}

.container.minimized .header-bar {
  border-radius: var(--border-radius-lg);
  border-bottom: none;
}

/* ===== MINIMIZED IN FULLSCREEN ===== */
.container.fullscreen.minimized {
  height: 64px !important;
  width: 500px !important;
  position: fixed !important;
  bottom: 1px !important;
  right: 24px !important;
  z-index: 150 !important;
}

.container.fullscreen.minimized .chat-container,
.container.fullscreen.minimized .input-area {
  display: none !important;
}

/* ===== RESTORE ANIMATION ===== */
@keyframes restoreChatbox {
  0% {
    height: 64px;
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    height: var(--container-height);
    transform: scale(1);
  }
}

.container.restoring {
  animation: restoreChatbox 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}