/* Blog details: AI analyze + text-to-speech tools */
.bd-ai-tools {
    margin: 28px 0 32px;
    padding: 24px;
    border: 1px solid rgba(138, 15, 251, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbf7ff 100%);
    box-shadow: 0 10px 30px rgba(138, 15, 251, 0.06);
}

.bd-ai-tools__head { margin-bottom: 20px; }
.bd-ai-tools__title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.bd-ai-tools__subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

.bd-ai-tools__section + .bd-ai-tools__section {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px dashed rgba(138, 15, 251, 0.2);
}
.bd-ai-tools__label {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7c3aed;
}

/* AI buttons */
.bd-ai-tools__ai-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.bd-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.bd-ai-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(138, 15, 251, 0.35);
    box-shadow: 0 6px 16px rgba(138, 15, 251, 0.1);
}
.bd-ai-btn:active { transform: translateY(0); }
.bd-ai-btn:focus-visible,
.bd-tts-btn:focus-visible,
.bd-tts-preview:focus-visible,
.bd-tts-reset:focus-visible,
.bd-tts-settings__close:focus-visible {
    outline: 2px solid #8a0ffb;
    outline-offset: 2px;
}
.bd-ai-btn__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}
.bd-ai-btn__logo svg { width: 22px; height: 22px; display: block; }

.bd-ai-btn--chatgpt .bd-ai-btn__logo { color: #10a37f; }
.bd-ai-btn--gemini .bd-ai-btn__logo { color: #4f46e5; }
.bd-ai-btn--grok .bd-ai-btn__logo { color: #111827; }
.bd-ai-btn--perplexity .bd-ai-btn__logo { color: #20b8cd; }

/* TTS bar */
.bd-tts-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.bd-tts-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.bd-tts-btn:hover:not(:disabled) {
    border-color: #8a0ffb;
    color: #6d28d9;
    background: #faf5ff;
}
.bd-tts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.bd-tts-btn--primary {
    background: linear-gradient(135deg, #8a0ffb, #9333ea);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(138, 15, 251, 0.25);
}
.bd-tts-btn--primary:hover:not(:disabled) {
    color: #6d28d9;
    filter: brightness(1.03);
    box-shadow: 0 10px 24px rgba(138, 15, 251, 0.32);
}
.bd-tts-btn--stop:hover:not(:disabled) {
    border-color: #ef4444;
    color: #dc2626;
    background: #fef2f2;
}

.bd-tts-status {
    margin-left: auto;
    font-size: 0.84rem;
    color: #64748b;
    padding: 6px 0;
    min-height: 32px;
    display: flex;
    align-items: center;
}
.bd-tts-status[data-state="playing"] { color: #7c3aed; font-weight: 600; }
.bd-tts-status[data-state="paused"] { color: #b45309; font-weight: 600; }
.bd-tts-status[data-state="error"] { color: #dc2626; }

/* Settings panel */
.bd-tts-settings {
    margin-top: 14px;
    border: 1px solid #e9ddf8;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}
.bd-tts-settings[hidden] { display: none !important; }
.bd-tts-settings__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #faf5ff;
    border-bottom: 1px solid #efe4fb;
}
.bd-tts-settings__header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}
.bd-tts-settings__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.bd-tts-settings__close:hover { background: #ede9fe; color: #6d28d9; }
.bd-tts-settings__body { padding: 18px; }

.bd-tts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.bd-tts-field { min-width: 0; }
.bd-tts-field--full { grid-column: 1 / -1; }
.bd-tts-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
}
.bd-tts-field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #0f172a;
    font-size: 0.9rem;
}
.bd-tts-field select:focus,
.bd-tts-field input[type="range"]:focus-visible {
    outline: 2px solid rgba(138, 15, 251, 0.3);
    outline-offset: 1px;
    border-color: #8a0ffb;
}
.bd-tts-slider-row { display: flex; align-items: center; gap: 12px; }
.bd-tts-field input[type="range"] {
    width: 100%;
    accent-color: #8a0ffb;
    cursor: pointer;
}
.bd-tts-slider-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: #7c3aed;
    min-width: 48px;
    text-align: right;
}
.bd-tts-hint {
    margin-top: 14px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #64748b;
}
.bd-tts-hint.is-warning { color: #b45309; }
.bd-tts-hint.is-error { color: #dc2626; }

.bd-tts-settings__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1e8fb;
}
.bd-tts-preview,
.bd-tts-reset {
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #334155;
}
.bd-tts-preview { color: #6d28d9; border-color: #d8b4fe; background: #faf5ff; }
.bd-tts-preview:hover { background: #f3e8ff; }
.bd-tts-reset:hover { background: #f8fafc; }

@media (max-width: 767.98px) {
    .bd-ai-tools { padding: 18px; border-radius: 14px; }
    .bd-tts-status { margin-left: 0; width: 100%; }
    .bd-tts-grid { grid-template-columns: 1fr; }
    .bd-ai-btn, .bd-tts-btn { flex: 1 1 auto; justify-content: center; }
}
