/* ===================================
   SIDEBAR FLOTANTE DE FILTROS
   =================================== */

/* ===== SIDEBAR PRINCIPAL ===== */
.projects-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding-top: 70px; /* Para el navbar fijo */
}

.projects-sidebar.active {
  transform: translateX(0);
}

/* ===== HEADER DEL SIDEBAR ===== */
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-header h3 i {
  color: var(--primary-green);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-color);
}

/* ===== CONTENIDO DEL SIDEBAR ===== */
.sidebar-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ===== SECCIÓN DE BÚSQUEDA ===== */
.search-section label,
.filter-section label,
.sort-section label,
.tech-filter-section label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9rem;
}

.search-box-sidebar {
  position: relative;
}

.search-box-sidebar i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-box-sidebar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-box-sidebar input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ===== OPCIONES DE FILTRO ===== */
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.filter-option:hover {
  border-color: var(--primary-green);
  background: rgba(16, 185, 129, 0.05);
}

.filter-option.active {
  background: var(--primary-green);
  border-color: var(--primary-green);
  color: white;
}

.filter-option i {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
}

.filter-option span {
  flex: 1;
  font-weight: 500;
}

.filter-option .count {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  flex: none;
}

.filter-option.active .count {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== SECCIÓN DE ORDENAMIENTO ===== */
.sort-select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-green);
}

/* ===== FILTROS DE TECNOLOGÍA ===== */
.tech-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-filter {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: var(--bg-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.tech-filter:hover {
  background: var(--primary-green);
  color: white;
  border-color: var(--primary-green);
}

.tech-filter.active {
  background: var(--primary-green);
  color: white;
  border-color: var(--primary-green);
}

/* ===== ACCIONES DEL SIDEBAR ===== */
.sidebar-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== BOTÓN FLOTANTE ===== */
.floating-filter-btn {
  position: fixed;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  background: var(--primary-green);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.floating-filter-btn:hover {
  background: var(--secondary-green);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.floating-filter-btn i {
  font-size: 1rem;
}

/* ===== HEADER ACTUALIZADO ===== */
.projects-header {
  text-align: center;
  margin-bottom: 2rem;
}

.projects-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.projects-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== ESTADÍSTICAS RÁPIDAS ===== */
.quick-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 1rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== AJUSTES PARA EL CONTENIDO PRINCIPAL ===== */
.projects-showcase {
  transition: margin-left 0.3s ease;
}

.sidebar-open .projects-showcase {
  margin-left: 320px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .sidebar-open .projects-showcase {
    margin-left: 0;
  }
  
  .floating-filter-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    top: auto;
    left: auto;
    transform: none;
  }
}

@media (max-width: 768px) {
  .projects-sidebar {
    width: 280px;
  }
  
  .floating-filter-btn {
    bottom: 2rem;
    right: 1rem;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
  }
  
  .floating-filter-btn span {
    display: none;
  }
  
  .quick-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .projects-header h2 {
    font-size: 1.5rem;
  }
  
  .sidebar-content {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .projects-sidebar {
    width: 100vw;
  }
  
  .sidebar-content {
    padding: 1rem;
  }
  
  .sidebar-header {
    padding: 1rem;
  }
  
  .floating-filter-btn {
    width: 3rem;
    height: 3rem;
    bottom: 1.5rem;
    right: 1rem;
  }
  
  .filter-options {
    gap: 0.4rem;
  }
  
  .filter-option {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .tech-filters {
    gap: 0.3rem;
  }
  
  .tech-filter {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* ===== TEMA OSCURO ===== */
.dark-theme .projects-sidebar {
  background: #000000;
  border-right-color: #333333;
  box-shadow: 4px 0 20px rgba(255, 255, 255, 0.1);
}

.dark-theme .sidebar-header {
  background: #000000;
  border-bottom-color: #333333;
}

.dark-theme .search-box-sidebar input,
.dark-theme .filter-option,
.dark-theme .sort-select,
.dark-theme .tech-filter {
  background: #000000;
  border-color: #333333;
  color: #ffffff;
}

.dark-theme .filter-option:hover,
.dark-theme .tech-filter:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary-green);
}

.dark-theme .sidebar-actions {
  border-top-color: #333333;
}

.dark-theme .floating-filter-btn {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.dark-theme .floating-filter-btn:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}