/* ===== IMPORTACIÓN DE FUENTE ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

/* ===== NUEVA PALETA DE COLORES Y RESET ===== */
:root {
    --bg-color: #121212;
    --surface-color: #1E1E1E;
    --surface-lighter: #2A2A2A;
    --primary-color: #3B82F6;
    --primary-gradient: linear-gradient(90deg, #3B82F6, #9333EA);
    --text-color: #E0E0E0;
    --text-muted: #8A8A8A;
    --border-color: #333333;
    --google-blue: #4285F4;
    --google-blue-hover: #357ae8;
    --pro-color: #9333ea;
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
    --delete-color: #ff3b30;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== ELEMENTOS GENERALES Y LAYOUT ===== */

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image:
        linear-gradient(to right, var(--border-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.1;
    z-index: -1;
}

.navbar {
    width: 100%;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text-color);
}

.auth-button-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-button-container a.profile-nav-link {
    margin-right: 12px;
}

/* ===== BOTONES (CTA) ===== */

.cta-button {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    display: inline-block;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
}

.cta-button.primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.cta-button.primary:hover:not(.disabled) {
    background-color: #2563EB;
    border-color: #2563EB;
}
.cta-button.primary.disabled {
    background-color: var(--surface-lighter);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.cta-button.secondary {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.cta-button.secondary:hover:not(.disabled) {
    background-color: var(--surface-lighter);
    border-color: var(--text-muted);
}
.cta-button.secondary.disabled {
    background-color: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.cta-button.loading {
    background-color: var(--surface-color);
    color: var(--text-muted);
    cursor: default;
}

.google-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    padding: 12px 28px;
    border: none;
    background-color: var(--google-blue);
    color: white;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition);
}
.google-login-btn:hover {
    background-color: var(--google-blue-hover);
}
.google-login-btn svg {
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    padding: 2px;
}

/* ===== SECCIÓN HERO ===== */

.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 140px 24px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    max-width: 800px;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.main-cta-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.main-cta-container .cta-button,
.main-cta-container .google-login-btn {
    padding: 14px 32px;
    font-size: 16px;
}

/* ===== SECCIONES DE PÁGINA ===== */

.page-section {
    padding: 60px 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.page-section.alt-bg {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color);
}

/* ===== Contenido específico del foro ===== */
.topic-metadata-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    max-width: 800px;
    margin: 0 auto 2rem;
    text-align: left;
}
.topic-metadata-card h3 {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.topic-metadata-card h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 5px;
    padding-bottom: 0;
    border: none;
    text-align: left;
    font-weight: 600;
}
.topic-metadata-card h2::after { display:none; }

.content-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    max-width: 800px;
    margin: 0 auto 2rem;
    transition: transform var(--transition), box-shadow var(--transition);
}
.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.content-card h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}
.content-card p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 16px;
    text-align: left;
}
.content-card hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
    opacity: 0.5;
}
.content-card .idea-principal h4 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-style: italic;
    font-weight: 500;
}
.content-card .idea-principal p {
    font-style: italic;
    font-weight: 500;
    margin-bottom: 0;
    color: var(--text-color);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--border-radius);
  margin-top: 1rem;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== SECCIÓN DE OPINIONES ===== */
.opinion-section {
  max-width: 800px;
  margin: 0 auto;
}
.opinion-section .section-title {
    margin-bottom: 2rem;
}

.debate-prompt {
    background: var(--surface-lighter);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--pro-color);
    margin-bottom: 2rem;
    text-align: center;
}
.debate-prompt p {
    font-style: italic;
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.opinion-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--input-bg, var(--surface-lighter));
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.opinion-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

#submit-opinion-btn {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto;
}

.opinions-list {
    margin-top: 3rem;
}

.opinion-item {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition);
    /* No lleva la animación base aquí */
}
.opinion-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.opinion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 8px;
}

.opinion-author {
    font-weight: 600;
    color: var(--primary-color);
}

.opinion-date {
    color: var(--text-muted);
    font-size: 0.8em;
}

.opinion-content {
    color: var(--text-color);
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 1rem;
}

.opinion-actions {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-reply, .btn-delete, .btn-delete-reply {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
}
.btn-reply { color: var(--primary-color); }
.btn-reply:hover { color: #60a5fa; text-decoration: underline; }
.btn-delete { color: var(--delete-color); }
.btn-delete:hover { color: #f87171; text-decoration: underline; }
.btn-delete-reply { color: var(--delete-color); font-weight: 500; font-size: 0.85rem; margin-left: auto; }
.btn-delete-reply:hover { color: #f87171; text-decoration: underline; }

.replies-container {
    margin-top: 15px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}
.reply-item {
    background-color: var(--surface-lighter);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.reply-form {
    margin-top: 15px;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reply-textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    resize: vertical;
    background-color: var(--input-bg, var(--surface-color));
    color: var(--text-color);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.reply-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}
.reply-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.reply-form .cta-button {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ===== BANNER FLOTANTE ===== */
.floating-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--surface-lighter);
    color: var(--text-muted);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
.floating-banner.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}
.close-banner-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color var(--transition);
}
.close-banner-btn:hover { color: var(--text-color); }


/* ===== FOOTER ===== */

.footer {
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 40px;
}

/* ===== UTILIDADES ===== */
.hidden { display: none !important; }
.error-message { color: var(--delete-color); font-size: 13px; margin-top: 10px; text-align: center; }

/* ===== ANIMACIONES ===== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUpOpinion {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll { opacity: 0; transition: opacity 0.6s ease-out, transform 0.6s ease-out; transform: translateY(20px); }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* Animación solo para opiniones nuevas */
.opinion-item.newly-added {
    animation: fadeInUpOpinion 0.5s ease-out forwards;
}

/* ===== RESPONSIVIDAD ===== */

@media (max-width: 768px) {
    .hero-section h1 { font-size: 48px; }
    .nav-links { display: none; }
    .navbar .auth-button-container .cta-button { padding: 8px 14px; font-size: 13px; }
    .navbar-container { padding: 0 16px; }
    .page-section { padding: 60px 16px; }
    .section-title { font-size: 32px; margin-bottom: 32px; }
    .replies-container { margin-left: 10px; padding-left: 10px; }
}

@media (max-width: 480px) {
    .hero-section { padding-top: 100px; min-height: 50vh; }
    .hero-section h1 { font-size: 36px; }
    .subtitle { font-size: 16px; }
    .main-cta-container .cta-button, .main-cta-container .google-login-btn { width: 100%; padding: 12px 24px; font-size: 15px; }
    .section-title { font-size: 28px; }
    .login-input-phone { font-size: 14px; padding: 10px; }
    #phone-form-step1 .cta-button, #phone-form-step2 .cta-button { width: 100%; margin-bottom: 10px; font-size: 14px; padding: 10px; }
    #phone-form-step2 div { flex-direction: column; }
    .content-card { padding: 24px; }
    .opinion-item { padding: 1rem; }
    .opinion-header { font-size: 0.85rem; }
    .opinion-content, .reply-item p { font-size: 15px; }
    .btn-reply, .btn-delete { font-size: 0.85rem; }
    .reply-item { padding: 0.8rem; }
    .replies-container { margin-left: 5px; padding-left: 10px; }
    .floating-banner { bottom: 10px; right: 10px; padding: 8px 12px; font-size: 0.8rem; }
    .close-banner-btn { font-size: 1.2rem; }
}

/* ======================================= */
/* ===== ESTILOS AÑADIDOS PARA LA IMAGEN HERO ===== */
/* ======================================= */

/* Estilos para el contenedor de la imagen en la sección hero */
.hero-image-container {
    max-width: 1000px; /* Ancho máximo para el contenedor */
    width: 100%;
    /* Mueve el margen inferior (3rem) que antes estaba en .subtitle al contenedor para centrar y dar espacio */
    margin: 0 auto 3rem; 
    
    /* Usa la variable de borde redondeado que ya tienes definida */
    border-radius: var(--border-radius); 
    
    overflow: hidden; /* Asegura que la imagen respete el border-radius */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Sombra sutil para destacarla */
}

/* Estilos para la imagen en sí */
.hero-main-image {
    width: 100%; /* La imagen ocupa todo el ancho de su contenedor */
    height: auto; /* Mantiene la proporción */
    display: block; /* Elimina espacios extra debajo de la imagen */
}