/* ── Theme ─────────────────────────────────────────────── */

:root {
    --bs-primary-rgb: 79, 70, 229;          /* indigo-600 */
    --bs-primary: #4f46e5;
    --bs-primary-bg-subtle: #eef2ff;
    --bs-link-color: #4f46e5;
    --bs-link-hover-color: #3730a3;
    --bs-body-font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    --bs-body-font-weight: 300;
    --bs-body-color: #1e293b;
    --bs-body-bg: #f8fafc;
    --bs-border-radius: 0.5rem;
    --bs-border-radius-lg: 0.75rem;
    --app-navbar-bg: #0f172a;
    --app-navbar-height: 3.5rem;
    --app-max-width: 1200px;
}

/* ── Base ──────────────────────────────────────────────── */

body {
    background-color: var(--bs-body-bg);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    color: #0f172a;
    font-weight: 600;
}

h1:focus {
    outline: none;
}

/* ── Validation ────────────────────────────────────────── */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #22c55e;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.darker-border-checkbox.form-check-input {
    border-color: #94a3b8;
}

/* ── Form floating label placeholders ─────────────────── */

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Buttons ───────────────────────────────────────────── */

button {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #3730a3;
    --bs-btn-hover-border-color: #3730a3;
    --bs-btn-active-bg: #312e81;
    --bs-btn-focus-shadow-rgb: 79, 70, 229;
}

/* ── Cards ─────────────────────────────────────────────── */

.card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* ── Navbar ─────────────────────────────────────────────── */

.app-navbar {
    --bs-navbar-bg: var(--app-navbar-bg);
    background-color: var(--app-navbar-bg) !important;
    height: var(--app-navbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-navbar-inner {
    height: 100%;
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
    padding-left: 1rem;
    padding-right: 1rem;
}

.app-navbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 0;
}

.app-navbar-user {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.app-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--bs-primary);
    color: white;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    line-height: 1;
}

.app-brand-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.app-brand:hover .app-brand-name {
    color: rgba(255, 255, 255, 0.85);
}

.app-nav-user {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.app-btn-ghost {
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    font-size: 0.875rem;
    padding: 0.3rem 0.875rem;
    border-radius: 0.375rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.app-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

/* ── Account Section ────────────────────────────────────── */

.app-account-section {
    flex: 1;
    display: flex;
    align-items: start;
    justify-content: center;
    margin: 2rem;
}

.app-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-around;
    width: 80%;
}

.app-account-btn {
    min-width: 9rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #cbd5e1;
    border-radius: var(--bs-border-radius-lg);
    background: white;
    color: #1e293b;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    flex-grow: 1;
}

.app-account-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

/* ── Main / Footer ─────────────────────────────────────── */

.app-main {
    flex: 1;
}

.app-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
    color: #94a3b8;
    font-size: 0.8125rem;
}

/* ── Blazor error boundary ─────────────────────────────── */

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTI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jY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--bs-border-radius);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Settings voice-type rows (used inside SettingsDrawer) ── */

.settings-voice-type-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-voice-type-list.settings-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.settings-voice-type-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--bs-border-radius);
}

.settings-voice-type-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9375rem;
}

.settings-voice-type-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.settings-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}

.settings-toggle-track {
    position: relative;
    width: 52px;
    height: 30px;
    background: #cbd5e1;
    border-radius: 15px;
    transition: background 0.2s ease;
}

.settings-toggle input:checked + .settings-toggle-track {
    background: #16a34a;
}

.settings-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.settings-toggle input:checked + .settings-toggle-track .settings-toggle-thumb {
    transform: translateX(22px);
}

.settings-offset-input {
    width: 5rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-align: right;
}

.settings-offset-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.settings-offset-label {
    font-size: 0.8125rem;
    color: #64748b;
}

/* ── Speech bubble layout ───────────────────────────────── */

.bubble-outer {
    display: flex;
}

.bubble-outer--left { justify-content: flex-start; }
.bubble-outer--right { justify-content: flex-end; }
.bubble-outer--center { justify-content: center; }

.bubble-clickable {
    cursor: pointer;
    user-select: none;
}

.bubble-wrap {
    width: 90%;
    position: relative;
    margin-top: 10px;
}

.bubble-wrap--center { width: 92%; }

.bubble-bridge {
    position: absolute;
    top: -1px;
    left: 8px;
    width: 20px;
    height: 3px;
    z-index: 4;
}

.bubble-icon-circle {
    position: absolute;
    top: -7px;
    left: 5px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    z-index: 5;
}

.bubble-body {
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid;
    z-index: 1;
}

.bubble-glow-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    pointer-events: none;
    z-index: 2;
}

.bubble-glow-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    pointer-events: none;
    z-index: 2;
}

.bubble-grad-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    pointer-events: none;
    z-index: 6;
    -webkit-mask-image: linear-gradient(to bottom, white, transparent);
    mask-image: linear-gradient(to bottom, white, transparent);
}

.bubble-grad-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    pointer-events: none;
    z-index: 6;
    -webkit-mask-image: linear-gradient(to top, white, transparent);
    mask-image: linear-gradient(to top, white, transparent);
}

.bubble-text {
    padding: 10px 14px 11px;
    font-size: 14.5px;
    line-height: 1.55;
    color: #b0b4bc;
    position: relative;
    z-index: 1;
}

.bubble-float-spacer {
    float: left;
    width: 21px;
    height: 8px;
    margin-right: 5px;
}

/* Palette: Left (gray) */
.bubble-palette-left .bubble-bridge { background: #1c1f28; }
.bubble-palette-left .bubble-icon-circle {
    background: #1c1f28;
    border-color: #3a4260;
    box-shadow: 0 0 16px rgba(139,149,176,0.44), 0 0 7px rgba(139,149,176,0.32);
}
.bubble-palette-left .bubble-body { background: #1c1f28; border-color: #3a4260; }
.bubble-palette-left .bubble-glow-left { background: linear-gradient(to right, rgba(160,175,230,0.38), transparent); }

/* Palette: Right (green) */
.bubble-palette-right .bubble-bridge { background: #18301f; }
.bubble-palette-right .bubble-icon-circle {
    background: #18301f;
    border-color: #2a4c3a;
    box-shadow: 0 0 14px rgba(74,222,128,0.33), 0 0 5px rgba(74,222,128,0.21);
}
.bubble-palette-right .bubble-body { background: #18301f; border-color: #2a4c3a; }
.bubble-palette-right .bubble-glow-right { background: linear-gradient(to left, rgba(90,240,140,0.40), transparent); }

/* Palette: Center (blue) */
.bubble-palette-center .bubble-bridge { background: #152442; }
.bubble-palette-center .bubble-icon-circle {
    background: #152442;
    border-color: #2a4570;
    box-shadow: 0 0 14px rgba(123,166,226,0.33), 0 0 5px rgba(123,166,226,0.21);
}
.bubble-palette-center .bubble-body { background: #152442; border-color: #2a4570; }
.bubble-palette-center .bubble-glow-left { background: linear-gradient(to right, rgba(120,170,255,0.40), transparent); }
.bubble-palette-center .bubble-glow-right { background: linear-gradient(to left, rgba(120,170,255,0.40), transparent); }

/* ── Bubble interior elements ───────────────────────────── */

.session-transcript-sender {
    font-weight: 600;
    color: #d0d4dc;
    margin-right: 0.2rem;
}

.audio-parts-list {
    margin-top: 0.35rem;
    padding-left: 0;
}

.audio-parts-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.4rem;
    font-size: 0.8125rem;
    color: #8b95b0;
    line-height: 1.5;
}

.audio-parts-name {
    font-weight: 600;
    color: #b0b4bc;
}

.audio-parts-detail {
    color: #64748b;
}

.audio-parts-offset {
    color: #6b7280;
    font-size: 0.75rem;
}

.audio-parts-toggle {
    color: #8b95b0;
    font-size: 0.75rem;
}

.audio-simultaneous-indicator {
    display: block;
    font-size: 0.75rem;
    color: #8b95b0;
    margin-top: 0.15rem;
}
