/* ── Animated gradient background ────────────────────────────────────────── */

@keyframes gradientShift {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

html, body {
    min-height: 100vh;
}

body {
    background: linear-gradient(-45deg,
        #0a0a0a,
        #180608,
        #1c1c1c,
        #250c0c,
        #0e0e0e,
        #1a0707,
        #141414
    );
    background-size: 400% 400%;
    animation: gradientShift 40s ease infinite;
    color: #e8ddd8;
}

/* ── Page shell ──────────────────────────────────────────────────────────── */

.page-shell {
    position: relative;
    min-height: 100vh;
}

/* ── Language switcher ───────────────────────────────────────────────────── */

.lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    z-index: 10;
}

.lang-switcher a {
    color: #a08080;
    text-decoration: none;
    transition: color 0.2s;
}

.lang-switcher a:hover {
    color: #e0b0b0;
}

.lang-switcher a.active {
    color: #e0c0c0;
    font-weight: 600;
}

.lang-switcher .separator {
    color: #503030;
    margin: 0 0.3rem;
}

/* ── Glass card (main content panel) ────────────────────────────────────── */

.glass-card {
    background: rgba(12, 4, 4, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(110, 25, 25, 0.22);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    margin-top: 2rem;
}

/* ── App title — gradient shimmer ────────────────────────────────────────── */

.app-title {
    background: linear-gradient(120deg, #e8cccc 0%, #c04040 45%, #e8cccc 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 10s linear infinite;
    font-weight: 700;
}

@keyframes titleShimmer {
    0%   { background-position: 200% center; }
    100% { background-position:   0% center; }
}

/* ── Textarea ────────────────────────────────────────────────────────────── */

.chat-input {
    background: rgba(15, 5, 5, 0.65) !important;
    border-color: rgba(100, 28, 28, 0.5) !important;
    color: #f0e8e8 !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
    background: rgba(20, 7, 7, 0.75) !important;
    border-color: rgba(160, 40, 40, 0.8) !important;
    box-shadow: 0 0 0 0.2rem rgba(130, 30, 30, 0.3) !important;
    color: #f8f0f0 !important;
}

.chat-input::placeholder {
    color: #806060 !important;
}

/* ── Word highlight spans ────────────────────────────────────────────────── */

.word-filtered {
    background-color: rgba(220, 53, 69, 0.22);
    color: #ff7f7f !important;        /* !important overrides parent color-tag inline style */
    border-radius: 2px;
    padding: 0 2px;
    cursor: help;
    text-decoration: underline dotted rgba(220, 53, 69, 0.6);
}

.word-autofixed {
    background-color: rgba(255, 193, 7, 0.18);
    color: #ffd966 !important;        /* !important overrides parent color-tag inline style */
    border-radius: 2px;
    padding: 0 2px;
    cursor: help;
    text-decoration: underline dotted rgba(255, 193, 7, 0.5);
}

/* ── Color tag syntax delimiters (dim, selectable) ───────────────────────── */

.color-tag-syntax {
    opacity: 0.38;
    font-size: 0.82em;
    user-select: text;
}

/* ── Char counter badge ──────────────────────────────────────────────────── */

.char-counter {
    min-width: 4rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
}

.char-counter.ok {
    background-color: #1a6b3a;
    color: #c8f0d8;
}

.char-counter.warn {
    background-color: #7b1a1a;
    color: #ffd0d0;
}

/* ── Line content area ───────────────────────────────────────────────────── */

.chat-line-content {
    background: rgba(18, 6, 6, 0.55) !important;
    border-color: rgba(80, 18, 18, 0.35) !important;
    color: #f0e4e4 !important;
    line-height: 1.6;
    min-height: 2rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── Mode buttons — wine-red active accent ───────────────────────────────── */

.btn-check:checked + .btn-outline-danger {
    background-color: #6b1515;
    border-color:     #6b1515;
    color:            #ffd0d0;
}

/* ── Code tags in leet legend ────────────────────────────────────────────── */

code {
    background: rgba(120, 30, 30, 0.25);
    color: #ffb0b0;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 0.82em;
}

/* ── Copy button ─────────────────────────────────────────────────────────── */

.btn-copy {
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── Color tag buttons ───────────────────────────────────────────────────── */

.btn-color-tag {
    color: var(--tc);
    border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent);
    font-size: 0.72rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: color-mix(in srgb, var(--tc) 10%, transparent);
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
    line-height: 1.4;
}

.btn-color-tag:hover {
    background: color-mix(in srgb, var(--tc) 25%, transparent);
    border-color: var(--tc);
}
