/* =============================================================
   LA JUGLA PRODUCCIONES - COMUNIDAD STYLES
   Custom styles for the community and interactive comments feed.
   ============================================================= */

/* Contenedor principal de Comunidad */
.comunidad-section {
    padding: 120px 0 100px 0;
    min-height: calc(100vh - 120px);
    background: radial-gradient(circle at 50% 0%, rgba(0, 255, 102, 0.03) 0%, rgba(5, 5, 5, 1) 70%);
}

.comunidad-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    margin-top: 40px;
}

@media (max-width: 992px) {
    .comunidad-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Columna Izquierda: Info y Secciones */
.comunidad-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

@media (max-width: 992px) {
    .comunidad-sidebar {
        position: relative;
        top: 0;
    }
}

.comunidad-title-area {
    margin-bottom: 30px;
}

.comunidad-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.comunidad-icon {
    font-size: 2.2rem;
    animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.comunidad-main-title {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text-white) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer; /* Permite doble clic para admin */
}

.comunidad-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    font-weight: 300;
}

.secciones-header {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Lista de Secciones (Tabs) */
.secciones-tabs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 992px) {
    .secciones-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
}

.tab-btn {
    display: block;
    text-align: left;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition-normal);
    scroll-snap-align: start;
}

@media (max-width: 992px) {
    .tab-btn {
        flex: 0 0 280px;
    }
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 255, 102, 0.3);
    transform: translateX(5px);
}

@media (max-width: 992px) {
    .tab-btn:hover {
        transform: translateY(-2px);
    }
}

.tab-btn.active {
    background: rgba(0, 255, 102, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.1);
}

.tab-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.tab-btn.active .tab-title {
    color: var(--primary);
}

.tab-desc {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.4;
    padding-left: 12px;
    border-left: 2px solid var(--text-muted);
    transition: var(--transition-fast);
}

.tab-btn.active .tab-desc {
    border-left-color: var(--primary);
    color: var(--text-white);
}

/* Columna Derecha: Feed y Formulario */
.comunidad-feed-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Formulario para publicar */
.comment-form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.comment-form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.comment-form-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-white);
}

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

.form-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-white);
    transition: var(--transition-normal);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.15);
    background: rgba(0, 0, 0, 0.6);
}

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

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.input-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-submit-comment {
    background: var(--primary);
    color: #000000;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 15px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-normal);
}

.btn-submit-comment:hover {
    background: var(--primary-bright);
    box-shadow: 0 0 25px var(--primary);
    transform: translateY(-2px);
}

.btn-submit-comment:active {
    transform: translateY(0);
}

.btn-submit-comment:disabled {
    background: var(--text-muted);
    color: var(--bg-dark);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Vista de Vista Previa de Música */
.music-embed-preview {
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border-glow);
    padding: 10px;
    display: none; /* Se activa con JS */
}

/* Feed de Comentarios */
.comments-feed-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 18px;
    animation: fade-slide-up 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    transition: var(--transition-normal);
}

.comment-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-card-hover);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.comment-main {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author {
    font-weight: 700;
    color: var(--text-white);
    font-size: 1.05rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Reproductor incrustado de música */
.music-embed-container {
    margin-top: 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    background: #000;
    border: 1px solid rgba(255,255,255,0.05);
}

.music-embed-container iframe {
    display: block;
    border: none;
    width: 100%;
}

/* Footer de la tarjeta: Reacciones y Moderación */
.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reactions-group {
    display: flex;
    gap: 12px;
}

.reaction-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.reaction-btn:active {
    transform: scale(0.95);
}

.reaction-btn.reacted {
    background: rgba(0, 255, 102, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.reaction-count {
    font-weight: 600;
    color: var(--text-gray);
}

.reaction-btn.reacted .reaction-count {
    color: var(--primary);
}

/* Moderación */
.btn-delete-comment {
    background: rgba(255, 0, 50, 0.1);
    border: 1px solid rgba(255, 0, 50, 0.2);
    color: #ff3366;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    display: none; /* Activado solo en modo admin */
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.btn-delete-comment:hover {
    background: rgba(255, 0, 50, 0.2);
    border-color: #ff3366;
    box-shadow: 0 0 10px rgba(255, 0, 50, 0.3);
}

.admin-mode-active .btn-delete-comment {
    display: flex;
}

/* Indicador de carga (Skeleton) */
.comment-skeleton {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 18px;
}

.skeleton-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-text-group {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-line.title {
    width: 30%;
    height: 14px;
}

.skeleton-line.body-1 {
    width: 85%;
}

.skeleton-line.body-2 {
    width: 60%;
}

@keyframes skeleton-pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

/* Feed vacío */
.empty-feed-message {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
}

.empty-feed-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-feed-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-white);
    margin-bottom: 8px;
}

/* Controles de admin */
.admin-badge {
    background: rgba(0, 255, 102, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: none;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

.admin-mode-active .admin-badge {
    display: inline-flex;
}

.admin-lock-icon {
    display: inline-block;
    font-size: 0.9rem;
    opacity: 0.3;
    margin-left: auto;
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-lock-icon:hover {
    opacity: 0.8;
    color: var(--primary);
}
