@font-face {
    font-family: 'Asliya';
    src: url('/fonts/ALKATIPAsliye.woff2') format('woff2'),
         url('/fonts/ALKATIPAsliye.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --page-bg: radial-gradient(circle at top, #eef4fb 0%, #dde8f2 45%, #cfdce8 100%);
    --panel-bg: rgba(255, 255, 255, 0.96);
    --panel-border: rgba(110, 125, 145, 0.16);
    --shadow: 0 18px 38px rgba(31, 41, 55, 0.1);
    --text-main: #233142;
    --text-muted: #97a3b2;
    --record-idle: #ef5350;
    --record-active: #10b26c;
    --dock-bg: rgba(255, 255, 255, 0.66);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Asliya', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text-main);
}

.kazakh-traditional-text {
    font-family: 'Asliya', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

button {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px 150px;
}

.transcript-box {
    width: min(960px, 100%);
    min-height: min(62vh, 680px);
    padding: clamp(26px, 4vw, 44px);
    border-radius: 26px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    font-size: clamp(18px, 2.3vw, 24px);
    line-height: 1.28;
    letter-spacing: 0.01em;
    word-break: break-word;
    white-space: pre-wrap;
    resize: none;
    outline: none;
    overflow-y: auto;
    caret-color: var(--text-main);
    color: var(--text-main);
}

.transcript-box::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.transcript-box.recording-locked {
    background: rgba(241, 247, 252, 0.98);
    border-color: rgba(16, 178, 108, 0.28);
    box-shadow: 0 22px 42px rgba(16, 178, 108, 0.12);
    caret-color: transparent;
}

.transcript-box.recording-locked::selection {
    background: rgba(16, 178, 108, 0.12);
}

.bottom-dock {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 28px;
    background: var(--dock-bg);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 38px rgba(31, 41, 55, 0.14);
}

.dock-action-row {
    width: 100%;
    display: flex;
    gap: 10px;
}

.dock-action-button {
    flex: 1;
    min-height: 42px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-main);
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.08);
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.dock-action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(31, 41, 55, 0.12);
}

.dock-action-button:disabled,
.dock-action-button[aria-disabled='true'] {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.record-button {
    width: 96px;
    height: 96px;
    border: none;
    border-radius: 50%;
    background: var(--record-idle);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 18px 30px rgba(239, 83, 80, 0.28);
}

.record-button:hover {
    transform: translateY(-2px) scale(1.01);
}

.record-button:disabled {
    opacity: 0.78;
    cursor: not-allowed;
    transform: none;
}

.record-button.recording {
    background: var(--record-active);
    box-shadow: 0 0 0 0 rgba(16, 178, 108, 0.38);
    animation: pulse 1.25s infinite;
}

.record-button-core {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    display: block;
}

.record-button.recording .record-button-core {
    width: 30px;
    height: 30px;
    border-radius: 12px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 140px;
    transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.94);
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 16px;
    z-index: 1000;
    text-align: center;
}

.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.38);
    z-index: 1100;
}

.confirm-dialog {
    width: min(360px, 100%);
    padding: 22px 20px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 40px rgba(31, 41, 55, 0.18);
}

.confirm-dialog-message {
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
}

.confirm-dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.confirm-dialog-button {
    flex: 1;
    min-height: 42px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.confirm-dialog-button:hover {
    transform: translateY(-1px);
}

.confirm-dialog-button-secondary {
    background: rgba(241, 245, 249, 1);
    color: var(--text-main);
}

.confirm-dialog-button-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 178, 108, 0.38);
    }
    70% {
        box-shadow: 0 0 0 24px rgba(16, 178, 108, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 178, 108, 0);
    }
}

@media (max-width: 768px) {
    .app-shell {
        padding: 16px 12px 132px;
    }

    .transcript-box {
        min-height: calc(100vh - 170px);
        border-radius: 22px;
        font-size: clamp(17px, 4.2vw, 21px);
        line-height: 1.26;
    }

    .bottom-dock {
        width: calc(100vw - 18px);
        gap: 10px;
        padding: 12px;
    }

    .dock-action-row {
        gap: 8px;
    }

    .dock-action-button {
        min-height: 40px;
        font-size: 14px;
    }

    .record-button {
        width: 82px;
        height: 82px;
    }

    .toast {
        bottom: 120px;
        width: calc(100vw - 36px);
    }
}
