/* ============================================================
   DEBATES — Comentarios solo registrados
   Apple-style thread con avatares circulares + replies anidadas
   ============================================================ */

.ad-s-debates {
    position: relative;
}
.ad-s-debates-head { margin-bottom: 28px; }
.ad-s-debates-sub {
    font-size: 14px; color: var(--ad-text-muted);
    line-height: 1.55; max-width: 640px;
    margin: 0;
}

.ad-deb-wrap {
    background: var(--ad-bg-surface);
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-r-xl);
    padding: 28px;
    position: relative;
    overflow: hidden;
}
.ad-deb-wrap::before {
    content: ''; position: absolute;
    top: -50%; left: 50%; transform: translateX(-50%);
    width: 100%; height: 60%;
    background: radial-gradient(ellipse at center top, rgba(90,200,250,0.05), transparent 60%);
    pointer-events: none;
}

/* ============================================================
   COMMENT LIST
   ============================================================ */
.ad-deb-list {
    list-style: none;
    padding: 0; margin: 0 0 24px;
    display: flex; flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}
.ad-deb-list ul.children {
    list-style: none;
    padding: 0;
    margin: 14px 0 0 24px;
    display: flex; flex-direction: column;
    gap: 14px;
    position: relative;
}
.ad-deb-list ul.children::before {
    content: '';
    position: absolute;
    left: -16px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--ad-accent) 0%, transparent 100%);
    opacity: 0.4;
    border-radius: 2px;
}

.ad-deb-item.is-reply { margin-left: 0; }

.ad-deb-art {
    display: flex; flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(19, 26, 45, 0.5);
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-r-md);
    transition: border-color 280ms var(--ad-ease-out), transform 280ms var(--ad-ease-out);
}
.ad-deb-art:hover {
    border-color: rgba(90,200,250,0.25);
    transform: translateY(-1px);
}

.ad-deb-art-head {
    display: flex; align-items: center; gap: 12px;
}
.ad-deb-avatar {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ad-grad-primary);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.ad-deb-avatar-img {
    width: 100% !important; height: 100% !important;
    border-radius: 50% !important;
    display: block;
}
.ad-deb-art-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ad-deb-art-author {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 14px;
    color: var(--ad-text);
}
.ad-deb-art-author strong { font-weight: 650; letter-spacing: -0.005em; }
.ad-deb-badge {
    display: inline-block;
    padding: 2px 7px; border-radius: var(--ad-r-full);
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ad-deb-badge-author {
    background: rgba(255,159,10,0.15);
    border: 1px solid rgba(255,159,10,0.32);
    color: var(--ad-accent-3);
}
.ad-deb-badge-admin {
    background: rgba(90,200,250,0.15);
    border: 1px solid rgba(90,200,250,0.32);
    color: var(--ad-accent);
}
.ad-deb-art-time {
    font-size: 12px;
    color: var(--ad-text-dim);
    text-decoration: none;
    transition: color 200ms ease;
}
.ad-deb-art-time:hover { color: var(--ad-accent); }

.ad-deb-art-body {
    font-size: 14.5px; line-height: 1.65; color: var(--ad-text);
}
.ad-deb-art-body p { margin: 0 0 8px; }
.ad-deb-art-body p:last-child { margin: 0; }
.ad-deb-art-body a {
    color: var(--ad-accent);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}
.ad-deb-art-body a:hover { border-bottom-color: var(--ad-accent); }
.ad-deb-art-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    background: var(--ad-bg-elevated);
    color: var(--ad-accent-3);
    padding: 2px 6px; border-radius: 4px;
}
.ad-deb-moderation {
    color: var(--ad-warning); font-size: 12px;
    display: block; margin-bottom: 8px;
}

.ad-deb-art-foot {
    display: flex; gap: 14px; align-items: center;
    padding-top: 4px;
    font-size: 12px;
}
.ad-deb-reply-wrap .comment-reply-link {
    display: inline-flex; align-items: center;
    color: var(--ad-accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 200ms ease;
}
.ad-deb-reply-wrap .comment-reply-link:hover { color: #fff; }
.ad-deb-edit a { color: var(--ad-text-muted); font-size: 11px; }

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.ad-deb-pages {
    display: flex; gap: 8px; justify-content: center;
    margin: 24px 0;
}
.ad-deb-pages a, .ad-deb-pages .page-numbers {
    padding: 8px 14px; border-radius: var(--ad-r-md);
    background: var(--ad-bg-elevated);
    border: 1px solid var(--ad-line);
    color: var(--ad-text-muted);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: all 200ms ease;
}
.ad-deb-pages a:hover { color: var(--ad-text); background: rgba(255,255,255,0.06); }
.ad-deb-pages .current {
    background: var(--ad-grad-primary);
    color: #fff; border-color: transparent;
}

/* ============================================================
   FORM (logged in)
   ============================================================ */
.ad-deb-form-wrap {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--ad-line);
    position: relative;
    z-index: 1;
}
.ad-deb-form-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 16px;
}
.ad-deb-form-header > div:last-child {
    display: flex; flex-direction: column; gap: 1px;
}
.ad-deb-user {
    font-size: 14px; font-weight: 650;
    color: var(--ad-text);
}
.ad-deb-form-cta {
    font-size: 12px;
    color: var(--ad-text-muted);
}

.ad-deb-form { display: flex; flex-direction: column; gap: 14px; }
.ad-deb-textarea-wrap { position: relative; }
.ad-deb-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--ad-bg-base);
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-r-md);
    color: var(--ad-text);
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: border-color 220ms ease, box-shadow 220ms ease;
}
.ad-deb-textarea:focus {
    outline: none;
    border-color: var(--ad-accent);
    box-shadow: 0 0 0 3px rgba(90,200,250,0.18);
}
.ad-deb-textarea::placeholder { color: var(--ad-text-dim); }
.ad-deb-textarea-counter {
    position: absolute; bottom: 10px; right: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--ad-text-dim);
    pointer-events: none;
}
.ad-deb-textarea-counter.is-warn { color: var(--ad-warning); }
.ad-deb-textarea-counter.is-danger { color: var(--ad-danger); }

.form-submit { margin: 0; }
.ad-deb-submit-btn,
.ad-deb-form .submit,
.ad-deb-form #submit {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    background: var(--ad-grad-primary);
    color: #fff !important;
    border: 0; border-radius: var(--ad-r-md);
    font-family: inherit;
    font-size: 14px; font-weight: 650; letter-spacing: 0.005em;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(90,200,250,0.32);
    transition: transform 280ms var(--ad-ease-out), box-shadow 280ms var(--ad-ease-out);
}
.ad-deb-submit-btn:hover,
.ad-deb-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(90,200,250,0.48);
}

.ad-deb-rules {
    margin: 0; font-size: 12px;
    color: var(--ad-text-dim);
    line-height: 1.5;
}
.ad-deb-rules a { color: var(--ad-accent); }

/* ============================================================
   GATE (no logueado)
   ============================================================ */
.ad-deb-gate {
    margin-top: 8px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(90,200,250,0.05) 0%, rgba(191,90,242,0.05) 100%),
        var(--ad-bg-elevated);
    border: 1px solid rgba(90,200,250,0.18);
    border-radius: var(--ad-r-lg);
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 18px;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.ad-deb-gate::before {
    content: ''; position: absolute;
    top: -50%; right: -10%;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(90,200,250,0.12), transparent 60%);
    pointer-events: none;
}
.ad-deb-gate-icon {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(90,200,250,0.12);
    border: 1px solid rgba(90,200,250,0.3);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ad-accent);
    flex-shrink: 0;
    position: relative; z-index: 1;
}
.ad-deb-gate-body { position: relative; z-index: 1; }
.ad-deb-gate-title {
    font-size: 18px; font-weight: 700;
    letter-spacing: -0.01em; color: var(--ad-text);
    margin: 0 0 6px;
}
.ad-deb-gate-text {
    font-size: 14px; line-height: 1.55;
    color: var(--ad-text-muted);
    margin: 0 0 16px;
}
.ad-deb-gate-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ad-deb-gate-btn { padding: 10px 18px; font-size: 13.5px; }

/* ============================================================
   EMPTY / CLOSED
   ============================================================ */
.ad-deb-closed {
    padding: 32px;
    text-align: center;
    color: var(--ad-text-muted);
    font-size: 14px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--ad-r-md);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ad-deb-wrap { padding: 20px 18px; border-radius: var(--ad-r-lg); }
    .ad-deb-list ul.children { margin-left: 16px; }
    .ad-deb-list ul.children::before { left: -12px; }
    .ad-deb-art { padding: 14px 16px; }
    .ad-deb-avatar { width: 38px; height: 38px; }
    .ad-deb-gate {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .ad-deb-gate-icon { margin: 0 auto; }
    .ad-deb-gate-actions { justify-content: center; }
}
