/* --- Reset y Variables Globales --- */
:root {
  --primary-color: #6c5ce7;
  --secondary-color: #a29bfe;
  --title-color: #8854d0;
  --text-color: #636e72;
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --border-color: #dfe6e9;
  --white: #ffffff;
  --green: #28a745;
  --red: #dc3545;
  --blue: #007bff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  --border-radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

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

a {
  text-decoration: none;
  color: var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.main-title {
    font-size: 2.0rem;
    color: #6c5ce7;
    margin-bottom: 2rem;
    text-align: center;
}

/* --- Header --- */
.header {
  background-color: var(--white);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.btn-add-ad {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-add-ad:hover {
  background-color: #5848d1;
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 2rem 0;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}



/* --- Página de Inicio (index.ejs) --- */
.conta-buscar {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 10px;    /* mantiene 20px arriba */
  padding-bottom: 0px;  /* cambia el padding inferior a 0 */
  padding-left: 0;
  padding-right: 0;
}



.hero img {
  display: block;
  margin: 0 auto;
}
.hero h1 {
    font-size: 3rem;
    color: #6c5ce7;
}

.hero p {
  font-weight: bold;
  font-size: 18px;
}

.cta-section p {
  font-weight: bold;
  font-size: 18px;
}



.search-box {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}
.search-box h2 {
  color:#6c5ce7;
}
.cta-section h2 {
  color:#6c5ce7;
}
.home-form .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}
.home-form .form-group {
    flex: 1;
    text-align: left;
}
.btn-search, .btn-cta {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.cta-section {
    margin-top: 3rem;
}
.btn-cta {
    display: inline-block;
    width: auto;
    padding: 1rem 2rem;
    margin-top: 1rem;
}

/* --- Filtros de Búsqueda (results.ejs) --- */
.search-filters {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}
.filter-form .form-group {
    flex: 1;
    min-width: 150px;
}
.filter-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.filter-form select, .filter-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
}
.btn-filter {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Grid de Anuncios y Tarjetas (results.ejs) --- */
/* ————— Tarjetas / imágenes ajustadas ————— */

.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.ad-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 380px;
  height: auto;
}

.ad-image-container {
  position: relative;
  width: 100%;
  max-height: 70%;
  overflow: hidden;
}

.ad-image {
  position: relative;
  width: 100%;
  height: auto;
  object-fit: contain;
}


.ad-card-link {
    display: block;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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







.image-count {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 500;
}
.image-count svg {
    stroke: var(--white);
}

.ad-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
}

.ad-id {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: #f1f2f6;
  color: #747d8c;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 6px;
}

.ad-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--title-color);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  /*padding-right: 50px; /* Space for the ID molestaba al titulo de tarjeta lado derecho*/ 
}

.ad-description {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.ad-attributes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.ad-attribute {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.ad-attribute svg {
    stroke: var(--primary-color);
}

.ad-date {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1rem;
}

.ad-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
}

.ad-contact-btn, .share-btn {
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
  width: 100%;
}

.ad-contact-btn {
  background-color: var(--green);
  color: var(--white);
}
.share-btn {
  background-color: var(--red);
  color: var(--white);
}
.ad-contact-btn:hover, .share-btn:hover {
    opacity: 0.85;
}

.special-ad-container {
    grid-column: 1 / -1;
    padding: 1rem;
    background: #f0f0f0;
    border-radius: var(--border-radius);
}
/* ————— oculta botonones blancos vscios :  ————— */
.ad-actions button:empty {
  display: none;
}


/* --- Paginación --- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2rem;
  gap: 0.5rem;
}
.page-link {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--primary-color);
}
.page-link.active {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}
/* --- Página de videos (videos.ejs) --- */
.video-title {
  font-size: 1.5rem;
  color: #6c5ce7;
  word-break: break-word;
  overflow-wrap: break-word;
}


/* --- Página de Detalles (ad-detail.ejs) --- */
.ad-detail-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.ad-detail-title {
  font-size: 1.5rem;
  color: #6c5ce7;
  word-break: break-word;
  overflow-wrap: break-word;
}

.ad-detail-date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}
.ad-detail-description {
  font-size: 1.1rem;
  margin: 1rem 0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.ad-detail-socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.social-link { 
    padding: 0.75rem 1.5rem; 
    border-radius: 8px; 
    color: var(--white); 
    display: flex; 
    align-items: center; 
    gap: 8px;
}
.social-link.whatsapp { background-color: #25D366; }
.social-link.facebook { background-color: #1877F2; }
.social-link.instagram { background-color: #C13584; }
.social-link.tiktok { background-color: #000000; }
.social-link.youtube { background-color: #FF0000; }
.social-link.onlyfans { background-color: #4f0800; }
.gallery-main-image img { border-radius: var(--border-radius); width: 100%; }
.gallery-thumbnails { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.gallery-thumbnails img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}
.gallery-thumbnails img:hover { border-color: var(--primary-color); }


/* --- Formulario (add-ad.ejs) --- */
.add-ad-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.form-section { margin-bottom: 2rem; }
.form-section h3 { margin-bottom: 1rem; color: #333; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .5rem; font-weight: 500; color:#6c5ce7; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: .75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}
.form-container h1 {
    color: #6c5ce7; /* Elegí el color que quieras */

}

.form-container p1 {
  font-weight: bold;
  font-size: 18px;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.subtitle { text-align: center; margin-bottom: 2rem; font-size: 1.1rem; }


/* --- Otras páginas (Confirmation, 404) --- */
.confirmation-box, .error-container {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}
.check-icon { stroke: var(--green); margin-bottom: 1rem; }
.confirmation-box h1 { color: #333; }
.ad-id-confirmation {
    font-size: 1.2rem;
    margin: 1rem 0 1.5rem;
}
.payment-instructions {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}
.btn-whatsapp-confirm {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--green);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: bold;
    text-decoration: none;
}
.qr-code { margin: 2rem 0; }
.qr-code img { max-width: 200px; margin: 0 auto; }
.btn-download, .btn-home {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    margin-top: 1rem;
}
.btn-home {
    background-color: #6c757d;
    margin-left: 0.5rem;
}

/* --- Pantalla de Bienvenida --- */
#age-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    padding: 1rem;
}

#age-gate.hidden {
    display: none;
}

.age-gate-content {
    max-width: 600px;
    width: 100%;
}

.age-gate-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.age-gate-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.age-gate-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #ccc;
}

.terms-box {
    height: 200px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    color: #ddd;
}

.terms-box h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.age-gate-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.age-gate-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    min-width: 120px;
}

#age-gate-accept {
    background-color: var(--primary-color);
    color: var(--white);
}

#age-gate-reject {
    background-color: #6c757d;
    color: var(--white);
}


/* --- Admin Panel --- */
.admin-body { background-color: #e9ecef; }
.admin-container { padding: 2rem 5%; }
.admin-title { text-align: center; margin-bottom: 2rem; }
.admin-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}
.admin-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}
.admin-card-img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 1rem;}
.admin-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-approve, .btn-delete, .btn-view {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: var(--white);
}
.btn-approve { background-color: var(--green); }
.btn-delete { background-color: var(--red); }
.btn-view { background-color: var(--primary-color); }
.special-ads-forms { display: flex; gap: 1rem; margin-bottom: 1rem; }

/* --- Responsividad --- */
@media (min-width: 768px) {
    /* Layout de 2 columnas para el detalle del anuncio */
    .ad-detail-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .ad-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    .ad-card {
        flex-direction: row;
    }
    .ad-image-container {
        width: 40%;
        padding-top: 0;
        height: auto; /* Anula el aspect ratio en desktop */
        flex-shrink: 0;
    }
    .ad-image {
        position: static;
    }
}

@media (max-width: 767px) {
    .main-title { font-size: 2rem; }
    .hero h1 { font-size: 2.2rem; }
    .filter-form { flex-direction: column; gap: 1rem; align-items: stretch;}
    .home-form .form-row { flex-direction: column; }
    .header-content {
        padding: 0 5%;
    }
    .container {
        width: 100%;
        padding: 20px 5%;
    }
    .add-ad-form, .search-box, .search-filters, .confirmation-box, .ad-detail-container {
        padding: 1.5rem;
    }
}

    

/* --- Ajustes específicos para escritorio (results.ejs) --- */
@media (min-width: 768px) {
  .ad-grid {
    display: flex;
    justify-content: center;   /* Centra las tarjetas horizontalmente */
    flex-wrap: wrap;           /* Permite que bajen a la siguiente fila */
    gap: 2rem;                 /* Espacio uniforme entre tarjetas */
  }

  .ad-card {
    flex: 0 1 calc(33.333% - 2rem); /* 3 por fila con espacio */
    max-width: 320px;               /* Ancho máximo para que no se estiren demasiado */
  }
}
/* --- Botón "Ver Fotos y Detalles" --- */
.ad-card .view-details-btn {
  width: 100%;                /* Ocupar todo el ancho disponible */
  background-color: var(--blue);
  color: var(--white);
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.ad-card .view-details-btn:hover {
  background-color: #0056b3;  /* Azul más oscuro al pasar el mouse */
}

/* --- Botón "Videos" en la tarjeta --- */
.btn-videos {
  display: block;
  width: 100%;
  background-color: #e67e22; /* Un naranja fuerte */
  color: var(--white);
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  margin: 0.5rem 0;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn-videos:hover {
  background-color: #cf711c; /* Un tono más oscuro al pasar el mouse */
}


/* --- Botón "Fotos" en la tarjeta --- */
.btn-fotos {
  display: block;
  width: 100%;
  background-color: var(--blue);
  color: var(--white);
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  margin: 0.5rem 0;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn-fotos:hover {
  background-color: #0056b3;
}


/* --- Ajuste definitivo para el número de aviso --- */
.ad-id {
  all: unset;
  display: block;
  color: #666 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  margin-bottom: 0.3rem !important;
}


/* --- Ajustes de texto en títulos y descripciones --- */
.ad-title,
.ad-description {
  word-wrap: break-word;      /* Corta palabras largas */
  overflow-wrap: break-word;  /* Compatible con navegadores modernos */
  white-space: normal;        /* Permite saltos de línea */
  line-height: 1.4;           /* Mejor legibilidad */
}

/* La descripción se limita a 3 líneas con "..." */
.ad-description {
  max-height: 4.5em;          
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;      
  -webkit-box-orient: vertical;
}


.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-prev-page,
.btn-next-page {
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-prev-page:hover,
.btn-next-page:hover {
  background-color: #5848d1;
}


/* ========== TITLES Terminos========== */
.terms-container h1 {
  font-size: 1.5rem;
  color: #6c5ce7;
  border-bottom: 3px solid #e63946;
  padding-bottom: 0.4em;
  margin-bottom: 1.5em;
}

.terms-container h2 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  border-left: 4px solid var(--secondary-color);
  padding-left: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* --- Estilo Mejorado para los Botones del Age Gate --- */
.age-gate-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.btn-accept,
.btn-reject {
    flex: 1;
    max-width: 200px;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Botón Aceptar */
.btn-accept {
    background: linear-gradient(135deg, var(--primary-color), #5848d1);
}

.btn-accept:hover {
    background: linear-gradient(135deg, #5848d1, var(--primary-color));
    transform: translateY(-3px);
}

/* Botón Rechazar */
.btn-reject {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.btn-reject:hover {
    background: linear-gradient(135deg, #5a6268, #6c757d);
    transform: translateY(-3px);
}

/* Pequeña animación al hacer clic */
.btn-accept:active,
.btn-reject:active {
    transform: scale(0.97);
}
.home-container {
    text-align: center;
    width: 90%;
  max-width: 1200px;
  margin: 0 auto;
    padding-top: 0;
    padding-bottom: 20px;
    padding-left: 0;
    padding-right: 0;
}

/* add-ad aviso error rojo  */

.alert-danger {
    color: #ff0000;        /* Texto rojo */
    background: #ffe5e5;   /* Fondo rosado suave (opcional) */
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ff0000;
    margin-bottom: 15px;
}
