body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
}

.subheader {
    background: linear-gradient(135deg, #4a6bdf 0%, #3a5bce 100%);
    padding: 40px 15px; /* Padding lateral ajustado para móvil */
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    max-width: 1160px; /* Máximo ancho en desktop */
    width: 100%; /* Ancho total en móvil */
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 0 0 15px 15px;
    position: relative;
    overflow: hidden;
}

.subheader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.6;
  z-index: 0;
}

.subheader h1 {
  margin: 0;
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 0px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}
.header-subtitle {
  font-size: 18px;
  margin: 0 0 20px 0;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.header-description {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 30px;
  max-width: 700px;
  line-height: 1.7;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.header-search-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}

#search-input {
  padding: 15px 25px 15px 50px;
  border: none;
  border-radius: 50px;
  width: 350px;
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.95);
  position: relative;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
  background-size: 20px;
}

#search-input:focus {
  outline: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  width: 380px;
  background-color: white;
}

.create-sia-btn {
  padding: 15px 25px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.create-sia-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

#add-project-section {
  padding: 25px;
  background-color: #fff;
  margin: 25px auto;
  max-width: 600px;
  box-shadow: 0px 5px 15px rgba(0,0,0,0.1);
  border-radius: 12px;
}

#add-project-section input[type="text"],
#add-project-section textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border 0.3s ease;
}

#add-project-section input[type="text"]:focus,
#add-project-section textarea:focus {
  outline: none;
  border-color: #4a6bdf;
  box-shadow: 0 0 0 2px rgba(74, 107, 223, 0.2);
}

#add-project-section button {
  padding: 12px 25px;
  font-size: 16px;
  border: none;
  background-color: #4a6bdf;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

#add-project-section button:hover {
  background-color: #3a5bce;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#add-project-section button:disabled {
  background-color: #9ca8db;
  cursor: not-allowed;
  transform: none;
}

#projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.project-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0px 5px 15px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  border: 1px solid #eef1f8;
  position: relative;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0px 10px 20px rgba(0,0,0,0.12);
}

.project-thumbnail {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, #f0f2f5 0%, #e2e8f0 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.project-thumbnail img,
.project-thumbnail svg {
  width: 100px;
  height: 100px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  border-radius: 10px;
  margin-left: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.project-card:hover .project-thumbnail img {
  transform: scale(1.05);
}

.badge-container {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 2;
}

.model-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.model-badge.sia-local {
  background-color: #4c51bf;
}

.model-badge.openai {
  background-color: #10a37f;
}

.model-badge.claude {
  background-color: #8b5cf6;
}

.model-badge.deepseek {
  background-color: #3182ce;
}

.telegram-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background-color: #0088cc;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.project-info {
  padding: 20px;
  flex-grow: 1;
}

.project-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
}

.project-description {
  font-size: 15px;
  margin: 12px 0 0 0;
  color: #718096;
  line-height: 1.5;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
  font-size: 14px;
  color: #718096;
}

.project-stats {
  display: flex;
  margin-top: 10px;
  width: 100%;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #2d3748;
  text-align: center;
  width: 50%;
}

.stat-title {
  font-size: 12px;
  color: #718096;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.stat-value {
  font-weight: 600;
}

.stat svg {
  fill: #4a6bdf;
}

.project-footer {
  padding: 12px 20px;
  border-top: 1px solid #eef1f8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.chat-btn, .telegram-btn {
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  color: white;
  flex: 1;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-btn {
  background: linear-gradient(135deg, #4a6bdf 0%, #3a5bce 100%);
}

.chat-btn:hover {
  background: linear-gradient(135deg, #3a5bce 0%, #2d4eb5 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(74, 107, 223, 0.3);
}

.telegram-btn {
  background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%);
}

.telegram-btn:hover {
  background: linear-gradient(135deg, #0077b5 0%, #005f92 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 136, 204, 0.3);
}

.telegram-disabled {
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  color: #a0aec0;
  background-color: #f0f2f5;
  flex: 1;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-btn svg, .telegram-btn svg {
  fill: white;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateY(20px);
  animation: modal-appear 0.3s forwards;
}

@keyframes modal-appear {
  to { transform: translateY(0); }
}

.modal-content h2 {
  margin-top: 0;
  color: #2d3748;
  font-size: 24px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 12px;
}

.modal-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #4a6bdf, #3a5bce);
  border-radius: 3px;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #a0aec0;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #2d3748;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #4a5568;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  background-color: #f8fafc;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4a6bdf;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(74, 107, 223, 0.2);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-description {
  font-size: 13px;
  color: #718096;
  margin-top: 6px;
}

.thumbnail-preview {
  width: 100%;
  height: 150px;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f2f5;
  border: 2px dashed #cbd5e0;
  transition: all 0.3s ease;
}

.thumbnail-preview.loading {
  border-color: #4a6bdf;
  background-color: rgba(74, 107, 223, 0.05);
}

.thumbnail-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.btn-add-project {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4a6bdf 0%, #3a5bce 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-add-project:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 107, 223, 0.4);
}

.btn-add-project:active {
  transform: translateY(0);
}

.btn-add-project:disabled {
  background: linear-gradient(135deg, #9ca8db 0%, #8794cf 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.loading-indicator {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px;
  margin: 40px auto;
  max-width: 1200px;
  width: 100%;
  color: #718096;
}

.empty-state svg {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 22px;
  color: #2d3748;
  margin-bottom: 10px;
}

/* Add pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  margin: 30px 0 50px 0;
  gap: 8px;
  align-items: center;
}

.pagination button {
  padding: 8px 16px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 40px;
}

.pagination button.active {
  background-color: #4a6bdf;
  color: white;
  border-color: #4a6bdf;
  font-weight: 600;
}

.pagination button:hover:not(.active):not(.disabled) {
  background-color: #f0f2f5;
}

.pagination button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .ellipsis {
  margin: 0 4px;
  color: #718096;
}

.pagination .prev-btn,
.pagination .next-btn {
  font-weight: bold;
}

#pagination-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Update responsive grid for 4 items per row */
@media (min-width: 1200px) {
  #projects-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Floating button for opening modal */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #4a6bdf;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(74, 107, 223, 0.4);
  transition: all 0.3s ease;
  z-index: 1100;
}

.floating-btn:hover {
  transform: scale(1.1) rotate(90deg);
  background-color: #3a5bce;
  box-shadow: 0 8px 20px rgba(74, 107, 223, 0.5);
}

/* Añade esto al final de tu archivo style.css */

/* Estilos para dispositivos móviles */
@media (max-width: 768px) {
  .header-search-container {
    flex-direction: column;
    width: 100%;
  }

  #search-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #search-input:focus {
    width: 100%;
  }

  .create-sia-btn {
    margin-top: 15px;
    width: 85%;
    align-self: center;
  }
}
