/* ═══════════════════════════════════════════
   CHAT STORY BLOCK — Frontend Styles
   BPM 86'S — v1.0.0
   ═══════════════════════════════════════════ */

.csb-container {
    margin: 2em auto;
    max-width: 680px;
    padding: 28px 24px;
    border-radius: 16px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

/* ── TEMAS ── */
.csb-theme-dark {
    background: #0f0f1a;
    background-image:
        radial-gradient( ellipse at 20% 10%, rgba(108,99,255,0.07) 0%, transparent 55% ),
        radial-gradient( ellipse at 80% 90%, rgba(67,217,178,0.05) 0%, transparent 55% );
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.csb-theme-dark .csb-bubble-left {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.11);
    color: #dde0f0;
}

.csb-theme-dark .csb-bubble-right {
    background: var(--csb-accent);
    border-color: var(--csb-accent);
    color: #ffffff;
}

.csb-theme-light {
    background: #faf9f6;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.csb-theme-light .csb-bubble-left {
    background: #fff;
    border-color: rgba(0,0,0,0.10);
    color: #222;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.csb-theme-light .csb-bubble-right {
    background: var(--csb-accent);
    border-color: var(--csb-accent);
    color: #fff;
}

.csb-theme-terminal {
    background: #020c02;
    border: 1px solid rgba(0,255,65,0.15);
    font-family: 'Courier New', 'Consolas', monospace;
    box-shadow: 0 0 40px rgba(0,255,65,0.06), inset 0 0 80px rgba(0,0,0,0.4);
}

.csb-theme-terminal .csb-bubble-left {
    background: rgba(0,255,65,0.05);
    border-color: rgba(0,255,65,0.20);
    color: #adffc0;
}

.csb-theme-terminal .csb-bubble-right {
    background: rgba(0,255,65,0.12);
    border-color: rgba(0,255,65,0.35);
    color: #00ff41;
}

.csb-theme-terminal .csb-name {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    font-size: 10px !important;
    letter-spacing: 0.12em;
}

/* ── FILAS ── */
.csb-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 18px;
    animation: csb-fade-in 0.3s ease both;
}

.csb-left  { flex-direction: row; }
.csb-right { flex-direction: row-reverse; }

/* ── AVATAR ── */
.csb-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── BUBBLE WRAP ── */
.csb-bubble-wrap {
    max-width: 68%;
    display: flex;
    flex-direction: column;
}

.csb-left  .csb-bubble-wrap { align-items: flex-start; }
.csb-right .csb-bubble-wrap { align-items: flex-end; }

/* ── NOMBRE ── */
.csb-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
}

/* ── BURBUJAS ── */
.csb-bubble {
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 14.5px;
    line-height: 1.6;
    word-break: break-word;
    transition: opacity 0.2s;
    position: relative;
}

.csb-bubble-left  { border-radius: 4px 18px 18px 18px; }
.csb-bubble-right { border-radius: 18px 4px 18px 18px; }

/* ── ANIMACIÓN ── */
@keyframes csb-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .csb-row { animation: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .csb-container { padding: 18px 14px; }
    .csb-bubble-wrap { max-width: 80%; }
    .csb-avatar { width: 32px; height: 32px; font-size: 11px; }
    .csb-bubble { font-size: 14px; }
}
