/* ================== TU CSS ORIGINAL ================== */
/* Variables de color y tipografía */
:root {
  --primary-color: #E63946;
  --secondary-color: #1D3557;
  --accent-color: #F1C40F;
  --dark-bg: #0F1A20;
  --light-bg: #F8F9FA;
  --text-dark: #212529;
  --text-light: #F8F9FA;
  --text-gray: #6C757D;
  --border-radius: 2px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;

   --primary: #E63946;
    --primary-dark: #C1121F;
    --secondary: #1D3557;
    --secondary-light: #457B9D;
    --accent: #F1C40F;
    --accent-dark: #D4AC0D;
    --dark: #0F1A20;
    --light: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;

}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--light-bg);
  line-height: 1.6;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/img/fondo-grupos-nimetsu.png') center/cover no-repeat;
  opacity: 0.05;
  z-index: -1;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Tipografía */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  color: white;
}

.btn-primary:hover {
  background-color: #C1121F;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #14213D;
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
}

.btn-outline:hover {
  color: white;
}

.btn-login {
  background-color: transparent;
  color: var(--accent-color);
  margin-left: 15px;
}

.btn-login:hover {
  color: var(--text-dark);
}

/* Header */
.main-header {
  background-color: rgba(15, 26, 32, 0.9);
  backdrop-filter: blur(5px);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  color: var(--accent-color);
  font-size: 1.8rem;
  margin-bottom: 0;
}

.tagline {
  color: var(--text-light);
  font-size: 0.8rem;
  opacity: 0.8;
}

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav a {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 25px;
  font-weight: 500;
  transition: var(--transition);
}

.main-nav a:hover {
  color: var(--accent-color);
}

.main-nav a.active {
  color: var(--accent-color);
  font-weight: 600;
}

/* Hero section */
.hero {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-bg) 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: white;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

/* Search section */
.search-section {
  margin: 40px 0;
}

.search-form {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-group {
  flex: 1;
  min-width: 300px;
  position: relative;
}

.search-input-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-gray);
}

.search-input-group input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  font-size: 1rem;
  transition: var(--transition);
}

.search-input-group input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}

.search-form select {
  padding: 12px 20px;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  font-size: 1rem;
  min-width: 200px;
  background-color: white;
}

.filter-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tags span {
  font-weight: 500;
  color: var(--text-gray);
}

.tag {
  background-color: #E9ECEF;
  color: var(--text-dark);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition);
}

.tag:hover {
  background-color: #DEE2E6;
}

/* Groups section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-options select {
  padding: 8px 15px;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  font-size: 0.9rem;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.group-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.group-badge {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  background-color: var(--light-bg);
  border-bottom: 1px solid #eee;
}

.members-count {
  color: var(--text-gray);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.group-category {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.group-category.anime {
  background-color: #FFE8E8;
  color: #D64045;
}

.group-category.manga {
  background-color: #E8F4FF;
  color: #1A6FC9;
}

.group-category.gaming {
  background-color: #E8FFEE;
  color: #1C7C54;
}

.group-category.cultura {
  background-color: #FFF5E8;
  color: #D67F1A;
}

.group-content {
  padding: 20px;
  flex: 1;
}

.group-card h4 {
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.group-description {
  color: var(--text-gray);
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.group-meta {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--text-gray);
  margin-top: auto;
}

.group-meta i {
  margin-right: 5px;
}

.group-actions {
  display: flex;
  border-top: 1px solid #eee;
}

.group-actions a {
  flex: 1;
  text-align: center;
  padding: 12px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.group-actions a:first-child {
  border-right: 1px solid #eee;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
}

.page-nav,
.page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
}

.page-nav {
  background-color: #f8f9fa;
}

.page-number {
  background-color: white;
  border: 1px solid #ddd;
}

.page-number.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-nav:hover,
.page-number:hover:not(.active) {
  background-color: #e9ecef;
  cursor: pointer;
}

.page-nav.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* CTA Section */
.cta-section {
  background-color: var(--secondary-color);
  color: white;
  padding: 60px 0;
  text-align: center;
  margin-top: 60px;
}

.cta-content h3 {
  color: white;
  margin-bottom: 15px;
}

.cta-content p {
  max-width: 600px;
  margin: 0 auto 25px;
  opacity: 0.9;
}

/* ===== Modal NSFW (home) ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.modal.open {
  display: flex;
}

.modal-dialog {
  background: #fff;
  color: var(--text-dark);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
  max-width: 520px;
  width: 100%;
  padding: 20px;
}

.modal-dialog h3 {
  margin-top: 0;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-dialog p {
  margin: 10px 0 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}



/* Footer profesional */
.footer {
    background-color: var(--dark);
    color: white;
    padding-top: 60px;
    position: relative;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.f__grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 40px;
    padding-bottom: 40px;
}

@media (min-width: 768px) {
    .f__grid {
    grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .f__grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

.f__about h4 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--accent);
}

.f__about p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.social {
    display: flex;
    gap: 12px;
}

.social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social a:hover {
    background-color: var(--accent);
    color: var(--dark);
    transform: translateY(-3px);
}

.f__col h5 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.f__col h5::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px;
}

.f__col ul {
    list-style: none;
}

.f__col li {
    margin-bottom: 12px;
}

.f__col a {
    color: rgba(255, 255, 255, 0.75);
    transition: var(--transition);
    display: block;
}

.f__col a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.f__col p {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
}

.f__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.f__bottom small {
    color: rgba(255, 255, 255, 0.6);
}

.f__links {
    display: flex;
    gap: 20px;
}

.f__links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.f__links a:hover {
    color: var(--accent);
}

/* ================== MEJORAS MOBILE-FIRST AÑADIDAS ================== */
/* Botón de envío dentro del input de búsqueda */
.icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--primary-color);
  color: #fff;
  display: grid;
  place-items: center;
}

/* Menú hamburguesa sin JS */
.nav-toggle {
  display: none;
}

.hamburger {
  display: none;
}

/* Mejoras de accesibilidad táctil */
.group-actions a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========= Responsive ========= */
@media (max-width: 992px) {

  /* Hacer las tarjetas a 1 columna si el viewport es estrecho */
  .groups-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {

  /* Header en columnas y menú colapsable */
  .logo-nav-container {
    position: relative;
    align-items: center;
  }

  .hamburger {
    display: grid;
    gap: 4px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
  }

  .hamburger span {
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: .2s;
  }

  /* Nav como panel */
  .main-nav {
    position: absolute;
    right: 0;
    top: 58px;
    left: 0;
    background: rgba(15, 26, 32, .98);
    padding: 10px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    display: grid;
    gap: 8px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: var(--transition);
  }

  .main-nav a {
    margin: 0;
    border-radius: 10px;
    padding: 10px 12px;
  }

  /* Toggle states */
  #nav-toggle:checked~.hamburger span:nth-child(2) {
    opacity: 0;
  }

  #nav-toggle:checked~.hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  #nav-toggle:checked~.hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  #nav-toggle:checked~.main-nav {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  /* Búsqueda en columna y chips scrolleables */
  .search-form {
    flex-direction: column;
  }

  .search-input-group {
    min-width: 100%;
  }

  .search-form select {
    min-width: 100%;
  }

  .filter-tags {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .filter-tags::-webkit-scrollbar {
    display: none;
  }

  /* Botones táctiles a ancho completo cuando tiene sentido */
  .btn-primary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 48px 0;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-header {
    margin-bottom: 20px;
  }
}