/* style.css - Estilo tipo Copilot con organización alfabética - RESPONSIVE */

/* A */
.anime-personality-config {
  padding: 15px 0;
}

/* B */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* Transparencia para cuando hay imagen de fondo */
body.background-image .sidebar,
body.background-image .content-area,
body.background-image .chat-container,
body.background-image .input-area,
body.background-image .message-content,
body.background-image .config-section,
body.background-image .main-header {
  background-color: rgba(16, 16, 16, 0.85) !important;
  backdrop-filter: blur(5px);
}

body.background-image.light-theme .sidebar,
body.background-image.light-theme .content-area,
body.background-image.light-theme .chat-container,
body.background-image.light-theme .input-area,
body.background-image.light-theme .message-content,
body.background-image.light-theme .config-section,
body.background-image.light-theme .main-header {
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(5px);
}

/* Mejorar visibilidad del texto sobre fondo */
body.background-image .message-content,
body.background-image .brand,
body.background-image .conversation-item,
body.background-image .btn-config,
body.background-image .config-dropdown {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Modo claro */
body.light-theme {
  background: #f6f8fa;
  color: #24292f;
}

body.light-theme .sidebar {
  background: #ffffff;
  border-right: 1px solid #e1e4e8;
}

body.light-theme .brand {
  color: #24292f;
  border-bottom: 1px solid #e1e4e8;
}

body.light-theme .message-content {
  background: #ffffff;
  border: 1px solid #e1e4e8;
}

body.light-theme .message-wrapper.ai .message-content {
  background: #f6f8fa;
}

body.light-theme .message-wrapper.user .message-content {
  background: #ddf4ff;
  border-color: #54aeff;
}

body.light-theme .input-wrapper textarea {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  color: #24292f;
}

body.light-theme .input-wrapper textarea:focus {
  border-color: #54aeff;
  box-shadow: 0 0 0 3px rgba(84, 174, 255, 0.1);
}

/* Fondo con imagen */
body.background-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.brand {
  padding: 20px 15px;
  font-size: 18px;
  font-weight: 600;
  color: #f0f6fc;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-chat-action {
  background: transparent;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-chat-action:hover {
  background: #161b22;
  border-color: #8b949e;
}

body.light-theme .btn-chat-action {
  border: 1px solid #e1e4e8;
  color: #24292f;
}

body.light-theme .btn-chat-action:hover {
  background: #f6f8fa;
}

.btn-config {
  background: transparent;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-config:hover {
  background: #161b22;
  border-color: #8b949e;
}

body.light-theme .btn-config {
  border: 1px solid #e1e4e8;
  color: #24292f;
}

.btn-history-action {
  background: #238636;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  width: 100%;
  margin-top: 10px;
}

.btn-history-action:hover {
  background: #2ea043;
}

.btn-new-chat {
  background: #238636;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin: 15px;
  width: calc(100% - 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-new-chat:hover {
  background: #2ea043;
}

.btn-send {
  background: #238636;
  border: 1px solid #2ea043;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  order: 3;
}

.btn-send:hover {
  background: #2ea043;
  border-color: #3fb950;
}

body.light-theme .btn-send {
  background: #1a7f37;
  border-color: #2da44e;
}

body.light-theme .btn-send:hover {
  background: #2da44e;
}

.btn-system {
  background: #238636;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 15px;
  transition: background 0.2s;
  display: block;
  width: 100%;
}

.btn-system:hover {
  background: #2ea043;
}

.btn-thinking {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid #484f58;
  background: #30363d;
  color: #8b949e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  order: 1;
}

.btn-thinking:hover {
  background: #3d444d;
  border-color: #6e7681;
}

.btn-thinking.active {
  background: #238636;
  border-color: #2ea043;
  color: white;
}

body.light-theme .btn-thinking {
  border: 1px solid #e1e4e8;
  background: #f6f8fa;
  color: #57606a;
}

body.light-theme .btn-thinking:hover {
  background: #eaeef2;
}

body.light-theme .btn-thinking.active {
  background: #1a7f37;
  border-color: #2da44e;
  color: white;
}

/* C */
.chat-actions {
  display: flex;
  gap: 8px;
}

/* CHAT CONTAINER - ARREGLADO PARA SCROLL */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 0; /* Importante para flex scroll */
  scrollbar-width: thin;
  scrollbar-color: #30363d #0d1117;
}

/* Estilos personalizados para scrollbar */
.chat-container::-webkit-scrollbar {
  width: 8px;
}

.chat-container::-webkit-scrollbar-track {
  background: #0d1117;
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

body.light-theme .chat-container::-webkit-scrollbar-track {
  background: #f6f8fa;
}

body.light-theme .chat-container::-webkit-scrollbar-thumb {
  background: #e1e4e8;
}

body.light-theme .chat-container::-webkit-scrollbar-thumb:hover {
  background: #d0d7de;
}

.chat-header {
  padding: 15px 20px;
  border-bottom: 1px solid #21262d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d1117;
  position: sticky;
  top: 0;
  z-index: 10;
}

body.light-theme .chat-header {
  background: #f6f8fa;
  border-bottom: 1px solid #e1e4e8;
}

/* MEJORAR FORMATO DE CÓDIGO Y TEXTOS */
.code-block {
  background: #161b22 !important;
  border-radius: 6px;
  padding: 16px !important;
  margin: 10px 0 !important;
  overflow-x: auto;
  border: 1px solid #30363d !important;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  white-space: pre !important;
  color: #f0f6fc !important;
}

body.light-theme .code-block {
  background: #f6f8fa !important;
  border: 1px solid #e1e4e8 !important;
  color: #24292f !important;
}

.code-block-container {
  position: relative;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  border-radius: 6px 6px 0 0;
}

body.light-theme .code-block-header {
  background: #eaeef2;
  border-bottom: 1px solid #e1e4e8;
}

.code-block-wrapper {
  margin: 15px 0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  border: 1px solid #30363d !important;
  background: #161b22 !important;
}

body.light-theme .code-block-wrapper {
  border: 1px solid #e1e4e8 !important;
  background: #f6f8fa !important;
}

.code-language {
  font-size: 12px;
  color: #8b949e;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
}

body.light-theme .code-language {
  color: #57606a;
}

.config-card {
  background: #161b22;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #30363d;
}

/* CONFIG DROPDOWN MEJORADO - FUNCIONAL EN PC */
.config-dropdown {
  position: fixed !important;
  top: 70px !important;
  right: 20px !important;
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  min-width: 250px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
  z-index: 1100 !important;
  display: none;
}

.config-dropdown.active {
  display: block !important;
}

.config-dropdown-content {
  padding: 8px 0;
}

.config-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid #30363d;
  font-weight: 600;
  font-size: 14px;
}

.config-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c9d1d9;
  transition: background 0.2s;
  font-size: 14px;
}

.config-dropdown-item:hover {
  background: #1c2128;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  padding: 20px;
}

.config-section {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.config-section.active {
  display: block;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  transition: margin-left 0.3s;
  overflow: hidden;
}

body.light-theme .content-area {
  background: #f6f8fa;
}

.content-section {
  display: none;
  flex: 1;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.content-section.active {
  display: flex;
}

.conversation-actions {
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.conversation-date {
  font-size: 11px;
  color: #8b949e;
}

body.light-theme .conversation-date {
  color: #57606a;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.conversation-item {
  padding: 12px 15px;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  border: 1px solid #30363d;
}

.conversation-item.active {
  background: #1c2128;
}

.conversation-item:hover {
  background: #161b22;
}

.conversation-item:hover .conversation-actions {
  opacity: 1;
}

body.light-theme .conversation-item {
  border: 1px solid #e1e4e8;
}

body.light-theme .conversation-item.active {
  background: #eaeef2;
}

body.light-theme .conversation-item:hover {
  background: #f6f8fa;
}

.conversation-preview {
  font-size: 12px;
  color: #8b949e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .conversation-preview {
  color: #57606a;
}

.conversation-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.copy-code-btn {
  background: #30363d;
  border: 1px solid #484f58;
  color: #c9d1d9;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.copy-code-btn:hover {
  background: #3d444d;
  border-color: #6e7681;
}

body.light-theme .copy-code-btn {
  background: #eaeef2;
  border: 1px solid #e1e4e8;
  color: #24292f;
}

body.light-theme .copy-code-btn:hover {
  background: #d0d7de;
}

/* D */
/* E */
.empty-hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.empty-icon {
  font-size: 48px;
  color: #238636;
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8b949e;
  max-width: 600px;
  margin: 0 auto;
}

body.light-theme .empty-state {
  color: #57606a;
}

/* F */
.filter-select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

body.light-theme .filter-select {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  color: #24292f;
}

.footer-actions {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  border-top: 1px solid #21262d;
  margin-top: auto;
}

body.light-theme .footer-actions {
  border-top: 1px solid #e1e4e8;
}

/* G */
.gradient-text {
  background: linear-gradient(90deg, #58a6ff, #238636);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* H */
.hint {
  background: #161b22;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  display: inline-block;
  margin: 4px 0;
}

body.light-theme .hint {
  background: #eaeef2;
}

.history-actions {
  padding: 10px;
  border-top: 1px solid #30363d;
}

body.light-theme .history-actions {
  border-top: 1px solid #e1e4e8;
}

.history-collapsible {
  border-top: 1px solid #21262d;
  margin-top: 10px;
}

.history-collapsible-content {
  padding: 10px 15px;
  max-height: 400px;
  overflow-y: auto;
}

.history-collapsible-toggle {
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  user-select: none;
}

/* I */
.input-area {
    padding: 20px;
    background: #161b22;
    border-top: 1px solid #30363d;
    margin-top: -15px;  /* 👈 Mueve la barra 15px hacia arriba */
}

body.light-theme .input-area {
  background: #f6f8fa;
  border-top: 1px solid #e1e4e8;
}

.input-hints {
  font-size: 12px;
  color: #8b949e;
  text-align: center;
  margin-top: 10px;
  padding: 0 10px;
}

body.light-theme .input-hints {
  color: #57606a;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.input-wrapper textarea {
  flex: 1;
  background: #161b22;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  font-family: inherit;
  order: 2;
  outline: none;
}

.input-wrapper textarea:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

body.light-theme .input-wrapper textarea {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  color: #24292f;
}

body.light-theme .input-wrapper textarea:focus {
  border-color: #54aeff;
  box-shadow: 0 0 0 3px rgba(84, 174, 255, 0.1);
}

/* L */
/* M */
.main-header {
  padding: 12px 20px;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  background: #0d1117;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 60px;
}

body.light-theme .main-header {
  background: #f6f8fa;
  border-bottom: 1px solid #e1e4e8;
}

.main-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* MEJORAR FORMATO DE MENSAJES - NO LINEAL */
.message-content {
  background: #161b22;
  padding: 16px 20px !important;
  border-radius: 12px !important;
  border: 1px solid #30363d;
  line-height: 1.6 !important;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 15px !important;
  white-space: pre-wrap !important;
}

/* Mejorar párrafos y estructura */
.message-content p {
  margin-bottom: 1em !important;
  line-height: 1.6 !important;
}

.message-content ul, .message-content ol {
  margin-left: 20px !important;
  margin-bottom: 1em !important;
  padding-left: 20px !important;
}

.message-content li {
  margin-bottom: 0.5em !important;
  line-height: 1.5 !important;
}

.message-content h1, 
.message-content h2, 
.message-content h3 {
  margin-top: 1.5em !important;
  margin-bottom: 0.8em !important;
  font-weight: 600 !important;
}

.message-content h1 {
  font-size: 1.5em !important;
}

.message-content h2 {
  font-size: 1.3em !important;
}

.message-content h3 {
  font-size: 1.1em !important;
}

.message-content blockquote {
  border-left: 4px solid #30363d;
  padding-left: 16px;
  margin: 1em 0;
  color: #8b949e;
  font-style: italic;
}

.message-content pre:not(.code-block) {
  background: #1c2128;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
}

.message-content code:not(.code-block code) {
  background: #1c2128;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

body.light-theme .message-content {
  background: #ffffff;
  border: 1px solid #e1e4e8;
}

.message-wrapper {
  display: flex;
  margin-bottom: 20px !important;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-wrapper.ai {
  justify-content: flex-start;
}

.message-wrapper.ai .message-content {
  background: #161b22;
  border-color: #30363d;
}

body.light-theme .message-wrapper.ai .message-content {
  background: #f6f8fa;
}

.message-wrapper.user {
  justify-content: flex-end;
}

.message-wrapper.user .message-content {
  background: #0d4430;
  border-color: #238636;
}

body.light-theme .message-wrapper.user .message-content {
  background: #ddf4ff;
  border-color: #54aeff;
}

/* N */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #161b22;
  border: 1px solid #30363d;
  padding: 12px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(150%);
  transition: transform 0.3s;
  z-index: 2000;
  max-width: 300px;
}

.notification.error {
  border-color: #f85149;
}

.notification.success {
  border-color: #238636;
}

.notification.show {
  transform: translateX(0);
}

body.light-theme .notification {
  background: #ffffff;
  border: 1px solid #e1e4e8;
}

/* S */
.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  color: #c9d1d9;
  font-size: 14px;
  font-weight: 500;
}

body.light-theme .setting-item label {
  color: #24292f;
}

.setting-item select,
.setting-item textarea,
.setting-item input[type="text"],
.setting-item input[type="range"] {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

body.light-theme .setting-item select,
body.light-theme .setting-item textarea,
body.light-theme .setting-item input[type="text"],
body.light-theme .setting-item input[type="range"] {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  color: #24292f;
}

.setting-item textarea {
  min-height: 100px;
  resize: vertical;
}

.sidebar {
  width: 280px;
  background: #161b22;
  border-right: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  flex-shrink: 0;
  height: 100vh;
  position: relative;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 60px;
  transform: translateX(-280px);
}

.sidebar.collapsed .brand span,
.sidebar.collapsed .btn-new-chat span,
.sidebar.collapsed .history-collapsible-toggle span,
.sidebar.collapsed .conversation-title,
.sidebar.collapsed .conversation-date,
.sidebar.collapsed .conversation-preview,
.sidebar.collapsed .conversation-actions,
.sidebar.collapsed .footer-actions span {
  display: none;
}

.stat-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  float: right;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #30363d;
  transition: .4s;
  border-radius: 24px;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #238636;
}

.switch input:checked + .slider:before {
  transform: translateX(26px);
}

/* T */
.theme-config {
  margin-top: 15px;
}

.theme-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.theme-preset-btn {
  background: #30363d;
  border: 1px solid #484f58;
  color: #c9d1d9;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.theme-preset-btn:hover {
  background: #3d444d;
  border-color: #6e7681;
}

body.light-theme .theme-preset-btn {
  background: #eaeef2;
  border: 1px solid #e1e4e8;
  color: #24292f;
}

body.light-theme .theme-preset-btn:hover {
  background: #d0d7de;
}

.thinking-config {
  margin-top: 15px;
}

.toggle-sidebar {
  background: transparent;
  border: none;
  color: #c9d1d9;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.toggle-sidebar:hover {
  background: #161b22;
}

body.light-theme .toggle-sidebar {
  color: #24292f;
}

body.light-theme .toggle-sidebar:hover {
  background: #eaeef2;
}

/* RESPONSIVE DESIGN */

/* Tablets */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  
  .chat-container {
    padding: 15px;
  }
  
  .input-area {
      padding: 20px;
      background: #161b22;
      border-top: 1px solid #30363d;
      margin-top: -15px;  /* 👈 Mueve la barra 15px hacia arriba */
  }
  .message-content {
    max-width: 90%;
    padding: 14px 18px !important;
  }
  
  .theme-preset-btn {
    min-width: 100px;
  }
}

/* Móviles grandes */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 1050;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .content-area {
    width: 100%;
    margin-left: 0 !important;
  }
  
  .chat-container {
    height: calc(100vh - 140px);
    padding: 10px;
  }
  
  .input-area {
      padding: 20px;
      background: #161b22;
      border-top: 1px solid #30363d;
      margin-top: -15px;  /* 👈 Mueve la barra 15px hacia arriba */
  }
    
  .input-wrapper {
    gap: 6px;
  }
  
  .btn-thinking, .btn-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  
  .input-wrapper textarea {
    padding: 10px 12px;
    min-height: 40px;
  }
  
  .message-content {
    max-width: 95%;
    padding: 12px 16px !important;
  }
  
  .empty-state {
    padding: 40px 15px;
  }
  
  .empty-icon {
    font-size: 36px;
  }
  
  .config-dropdown {
    position: fixed !important;
    top: 70px !important;
    right: 10px !important;
    left: auto !important;
    width: 250px !important;
  }
  
  .theme-presets {
    flex-direction: column;
  }
  
  .theme-preset-btn {
    min-width: 100%;
    justify-content: flex-start;
  }
  
  .main-header h2 {
    font-size: 16px;
  }
  
  .input-hints span {
    font-size: 11px;
    line-height: 1.4;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .sidebar {
    width: 100%;
    left: -100%;
  }
  
  .chat-container {
    padding: 8px;
    height: calc(100vh - 130px);
  }
  
   .input-area {
      padding: 20px;
      background: #161b22;
      border-top: 1px solid #30363d;
      margin-top: -15px;  /* 👈 Mueve la barra 15px hacia arriba */
  }
    
  .btn-thinking, .btn-send {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  
  .input-wrapper textarea {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .message-wrapper {
    margin-bottom: 12px !important;
  }
  
  .message-content {
    max-width: 100%;
    padding: 10px 14px !important;
    font-size: 14px !important;
  }
  
  .empty-state {
    padding: 30px 10px;
  }
  
  .empty-hints .hint {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .config-dropdown {
    width: 90% !important;
    left: 5% !important;
    right: 5% !important;
  }
  
  .config-section {
    padding: 10px;
  }
  
  .setting-item {
    margin-bottom: 15px;
  }
  
  .main-header {
    padding: 10px 15px;
    min-height: 50px;
  }
  
  .main-header h2 {
    font-size: 15px;
  }
  
  .input-hints {
    display: none;
  }
}

/* Orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    width: 220px;
  }
  
  .chat-container {
    height: calc(100vh - 120px);
    padding: 8px;
  }
  
  .input-area {
      padding: 20px;
      background: #161b22;
      border-top: 1px solid #30363d;
      margin-top: -55px;  /* 👈 Mueve la barra 15px hacia arriba */
  }
    
  .history-collapsible-content {
    max-height: 150px;
  }
  
  .empty-state {
    padding: 20px;
  }
  
  .empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
  }
  
  .empty-state h2 {
    font-size: 18px;
    margin-bottom: 5px;
  }
  
  .empty-state p {
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  .empty-hints .hint {
    font-size: 11px;
    padding: 4px 8px;
    margin: 2px 0;
  }
}

/* Pantallas muy grandes */
@media (min-width: 1600px) {
  .sidebar {
    width: 320px;
  }
  
  .content-area {
    margin-left: 320px;
  }
  
  .chat-container {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .message-content {
    max-width: 70%;
  }
}

.icon-format {
  height: 80px;
  width: 80px;
}

/* Agregar al final de style.css */

/* VISOR DE CÓDIGO */
.code-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.code-viewer-modal.show {
    opacity: 1;
}

.code-viewer-content {
    background: #161b22;
    border: 2px solid #30363d;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.code-viewer-modal.show .code-viewer-content {
    transform: translateY(0);
}

.code-viewer-header {
    padding: 15px 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-viewer-header h3 {
    margin: 0;
    font-size: 18px;
    color: #58a6ff;
}

.btn-close-viewer {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.btn-close-viewer:hover {
    background: #30363d;
    color: #f0f6fc;
}

.code-viewer-tabs {
    display: flex;
    border-bottom: 1px solid #30363d;
    background: #0d1117;
}

.code-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.code-tab:hover {
    color: #c9d1d9;
    background: #161b22;
}

.code-tab.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
    background: #161b22;
}

.code-viewer-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.code-viewer-body pre {
    margin: 0;
    background: #0d1117;
    border-radius: 8px;
    padding: 20px;
}

.code-viewer-actions {
    padding: 15px 20px;
    border-top: 1px solid #30363d;
    display: flex;
    gap: 10px;
}

.btn-copy-code, .btn-suggest-modification {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #238636;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-suggest-modification {
    background: #8957e5;
}

.btn-copy-code:hover {
    background: #2ea043;
}

.btn-suggest-modification:hover {
    background: #9d6bff;
}

.btn-code-viewer {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #484f58;
    background: #30363d;
    color: #58a6ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-code-viewer:hover {
    background: #3d444d;
    border-color: #58a6ff;
}

/* Indicador de emoción */
#emotion-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #238636;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

#emotion-indicator:hover {
    transform: scale(1.1);
    background: #2ea043;
}

/* Bloques de texto normales (no código) */
.text-block {
    background: #1c2128;
    border-left: 4px solid #30363d;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 0 6px 6px 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    color: #c9d1d9;
}

body.light-theme .text-block {
    background: #f6f8fa;
    border-left-color: #e1e4e8;
    color: #24292f;
}

/* Modo claro para visor de código */
body.light-theme .code-viewer-content {
    background: #ffffff;
    border-color: #e1e4e8;
}

body.light-theme .code-viewer-header {
    border-bottom-color: #e1e4e8;
}

body.light-theme .code-viewer-header h3 {
    color: #0969da;
}

body.light-theme .code-tab {
    color: #57606a;
    background: #f6f8fa;
}

body.light-theme .code-tab:hover {
    color: #24292f;
    background: #ffffff;
}

body.light-theme .code-tab.active {
    color: #0969da;
    background: #ffffff;
}

body.light-theme .code-viewer-body pre {
    background: #f6f8fa;
}

/* Responsive */
@media (max-width: 768px) {
    .code-viewer-content {
        width: 95%;
        height: 90vh;
    }
    
    .code-tab {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    #emotion-indicator {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* CONFIG DROPDOWN MEJORADO - FUNCIONAL EN PC Y MÓVILES */
.config-dropdown {
    position: fixed !important;
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    min-width: 250px !important;
    max-width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
    z-index: 1100 !important;
    display: none;
    overflow: hidden;
}

.config-dropdown.active {
    display: block !important;
}

/* === SECCIÓN DE PROGRAMACIÓN === */

.programming-section {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}

.programming-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.programming-buttons .sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--button-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.programming-buttons .sidebar-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.programming-buttons .sidebar-btn i {
    font-size: 14px;
    color: var(--accent-color);
}

/* === COMANDOS RÁPIDOS EN CHAT VACÍO === */

.quick-commands {
    margin-top: 30px;
    padding: 20px;
    background: rgba(var(--accent-rgb), 0.1);
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.quick-commands h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
    font-size: 16px;
}

.command-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cmd-btn {
    padding: 12px 15px;
    background: var(--button-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.cmd-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.cmd-btn i {
    font-size: 16px;
}

/* === MEJORAS PARA BLOQUES DE CÓDIGO EDUCATIVOS === */

.code-block-wrapper {
    position: relative;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--code-bg);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.code-language {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-code-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.copy-code-btn:hover {
    background: rgba(var(--accent-rgb), 0.2);
}

.copy-code-btn.copied {
    background: var(--success-color);
    color: white;
}

.copy-code-btn.error {
    background: var(--error-color);
    color: white;
}

.code-block-container {
    position: relative;
}

.code-block {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-comment {
    color: #6A9955;
    font-style: italic;
}

/* === INDICADOR DE NIVEL DE PROGRAMACIÓN === */

.skill-level {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.level-beginner {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.level-intermediate {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.level-advanced {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* === RESULTADOS DE EVALUACIÓN === */

.evaluation-result {
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.evaluation-passed {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: #4CAF50;
}

.evaluation-failed {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: #F44336;
}

.evaluation-warning {
    background: rgba(255, 152, 0, 0.1);
    border-left-color: #FF9800;
}

.test-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 5px 0;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
}

.test-passed {
    color: #4CAF50;
}

.test-failed {
    color: #F44336;
}

/* === RESPONSIVE PARA PROGRAMACIÓN === */

@media (max-width: 768px) {
    .command-buttons {
        grid-template-columns: 1fr;
    }
    
    .programming-buttons .sidebar-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .quick-commands {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .code-block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .copy-code-btn {
        align-self: flex-start;
    }
}

/* style.css - Updated for Admin Input & Markdown */

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  height: 100vh;
  overflow: hidden;
}

/* --- NEW ADMIN INPUT STYLES --- */
.model-input {
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #58a6ff !important;
    font-size: 12px !important;
    padding: 8px !important;
    margin-top: 5px;
    font-family: monospace;
}

.model-input:focus {
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2) !important;
}

/* --- MARKDOWN STYLES --- */
.message-content {
    background: #161b22;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    border: 1px solid #30363d;
    line-height: 1.6 !important;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 15px !important;
}

.message-content h1, 
.message-content h2, 
.message-content h3 {
    color: #e6edf3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
}

.message-content h1 { font-size: 1.5em; border-bottom: 1px solid #30363d; padding-bottom: 0.3em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.1em; }

.inline-code {
    background: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    color: #e6edf3;
}

.code-block-wrapper {
    margin: 16px 0;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    color: #8b949e;
    font-size: 12px;
}

.code-block-wrapper pre {
    padding: 16px;
    overflow: auto;
    margin: 0;
    background: #0d1117;
}

.code-block-wrapper code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    color: #e6edf3;
    font-size: 13px;
    white-space: pre;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 11px;
}

.copy-code-btn:hover {
    background: #21262d;
    border-color: #8b949e;
}

.message-content ul, .message-content ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.message-content li {
    margin-bottom: 4px;
}

/* GENERAL STRUCTURE */
.sidebar {
    width: 280px;
    background: #161b22;
    border-right: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d1117;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.input-area {
    padding: 20px;
    background: #161b22;
    border-top: 1px solid #30363d;
    margin-top: -15px;  /* 👈 Mueve la barra 15px hacia arriba */
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

textarea {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    padding: 10px;
    resize: none;
    min-height: 44px;
}

textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

.btn-send, .btn-thinking {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    cursor: pointer;
}

.btn-send:hover {
    background: #238636;
    color: white;
    border-color: #238636;
}

.gradient-text {
    background: linear-gradient(90deg, #58a6ff, #238636);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand {
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.icon-format {
    width: 32px;
    height: 32px;
}

.btn-new-chat {
    margin: 0 15px;
    padding: 10px;
    background: #238636;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.history-collapsible {
    margin-top: 20px;
}

.history-collapsible-toggle {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #8b949e;
}

.history-collapsible-content {
    padding: 0 15px;
}

.footer-actions {
    padding: 15px;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: flex-end;
}

.toggle-sidebar {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.main-header {
    padding: 15px 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    background: #0d1117;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8b949e;
    text-align: center;
}

.empty-state img {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.empty-hints {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.hint {
    background: #161b22;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #30363d;
    font-size: 14px;
}

.notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-overlay.active {
        display: block;
    }
}

/* --- SIDEBAR CORRECTIONS (PC & MOBILE) --- */
.sidebar {
    transition: all 0.3s ease !important;
    width: 280px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Clase para colapsar en PC */
.sidebar.collapsed {
    width: 0px !important;
    min-width: 0px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

/* --- INDIVIDUAL CONVERSATION ITEMS --- */
.conversation-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    margin: 4px 8px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    color: #8b949e !important;
    border: 1px solid transparent !important;
}

.conversation-item:hover {
    background: #21262d !important;
    color: #fff !important;
}

.conversation-item.active {
    background: rgba(31, 111, 235, 0.15) !important;
    color: #58a6ff !important;
    border: 1px solid #1f6feb !important;
}

.conv-info {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    overflow: hidden !important;
    pointer-events: none !important; /* Evita que el click se pierda */
}

.conv-title {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 13px !important;
}

/* --- DELETE BUTTON --- */
.delete-conv-btn {
    background: transparent !important;
    border: none !important;
    color: #484f58 !important;
    padding: 4px 8px !important;
    cursor: pointer !important;
    opacity: 0 !important; /* Oculto por defecto */
    transition: all 0.2s !important;
    z-index: 10 !important;
}

.conversation-item:hover .delete-conv-btn {
    opacity: 1 !important; /* Aparece al hacer hover en el item */
}

.delete-conv-btn:hover {
    color: #f85149 !important;
    transform: scale(1.1) !important;
}

/* --- SCROLLBAR FOR HISTORY --- */
#conversation-history-list {
    max-height: 400px !important;
    overflow-y: auto !important;
}

#conversation-history-list::-webkit-scrollbar {
    width: 4px !important;
}

#conversation-history-list::-webkit-scrollbar-thumb {
    background: #30363d !important;
    border-radius: 10px !important;
}

/* --- BOTÓN DE TOGGLE SIEMPRE VISIBLE --- */
#sidebar-toggle-btn {
    background: transparent !important;
    border: 1px solid #30363d !important;
    color: #8b949e !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1100 !important;
    transition: all 0.2s ease !important;
}

#sidebar-toggle-btn:hover {
    background: #21262d !important;
    color: #fff !important;
}

/* --- AJUSTE DE LA CABECERA --- */
.main-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* --- CORRECCIÓN SIDEBAR PC --- */
.sidebar {
    transition: width 0.3s ease, margin 0.3s ease !important;
    width: 280px !important;
    position: relative !important;
    z-index: 1050 !important;
}

.sidebar.collapsed {
    width: 0px !important;
    min-width: 0px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    visibility: hidden !important; /* Esconde el contenido pero permite la transición */
}

/* En móvil sigue siendo fixed */
@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        left: -280px !important;
    }
    .sidebar.active {
        left: 0 !important;
        visibility: visible !important;
        width: 280px !important;
    }
}