/* assets/css/tamil_keyboard.css — Complete Tamil Virtual Keyboard for SecureGold */

/* Beside-Field Keyboard Trigger Icon in Form Labels */
.tamil-label-kb-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: #2563eb !important;
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    transition: all 0.15s ease;
    margin-left: 6px;
}

.tamil-label-kb-btn:hover {
    background: #2563eb;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.tamil-label-kb-btn i {
    font-size: 0.85rem;
}

/* Keyboard Main Drawer — Dark Theme matching reference */
.tamil-kb-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 660px;
    margin: 0 auto;
    background: #111827;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-top: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.65);
    z-index: 1099;
    transform: translateY(105%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Noto Sans Tamil', 'Mukta Malar', 'Inter', -apple-system, sans-serif;
    padding: 8px 10px 14px 10px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    color: #f8fafc;
}

.tamil-kb-drawer.show {
    transform: translateY(0);
}

/* Header & Control Bar */
.tamil-kb-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.tamil-kb-field-pill {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Search Bar inside Keyboard */
.tamil-kb-search-box {
    flex: 1;
    position: relative;
    max-width: 220px;
}

.tamil-kb-search-inp {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.82rem;
    padding: 3px 26px 3px 10px;
    border-radius: 50px;
    outline: none;
}

.tamil-kb-search-inp:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.tamil-kb-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

/* Pages / Category Tabs */
.tamil-kb-tabs-bar {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 5px;
    scrollbar-width: none;
}

.tamil-kb-tab-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}

.tamil-kb-tab-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.tamil-kb-tab-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* Modifiers Strip (Top of Keys) */
.tamil-kb-modifiers-strip {
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
}

.tamil-kb-mod-key {
    flex: 1;
    height: 38px;
    min-width: 32px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 7px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fef08a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s ease, transform 0.05s ease;
}

.tamil-kb-mod-key:active {
    background: #f59e0b;
    color: #0f172a;
    transform: scale(0.95);
}

/* Grid of Keys (9 keys per row matching reference screenshot) */
.tamil-kb-grid-row {
    display: flex;
    gap: 4px;
    margin-bottom: 5px;
    justify-content: space-between;
}

.tamil-kb-key {
    flex: 1;
    height: 48px;
    min-width: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.1s ease, transform 0.05s ease;
    padding: 0;
}

.tamil-kb-key:hover {
    background: #334155;
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}

.tamil-kb-key:active {
    background: #f59e0b;
    color: #0f172a;
    transform: scale(0.95);
}

/* Backspace Key */
.tamil-kb-key.backspace-key {
    background: #334155;
    color: #f87171;
    font-size: 1.2rem;
}

/* Uyirmei 216 Combinations Panel */
.tamil-kb-uyirmei-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    padding: 2px;
}

.tamil-kb-consonant-scroller {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: thin;
}

.tamil-kb-consonant-btn {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}

.tamil-kb-consonant-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #0f172a;
}

.tamil-kb-combo-matrix {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 4px;
}

/* Search results grid */
.tamil-kb-search-results-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    max-height: 230px;
    overflow-y: auto;
    padding: 2px;
}

/* Bottom Row (Space, Enter, Close) */
.tamil-kb-bottom-row {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-top: 4px;
}

.tamil-kb-bottom-btn {
    height: 44px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 12px;
    transition: background 0.1s ease;
}

.tamil-kb-bottom-btn:hover {
    background: #334155;
    color: #ffffff;
}

.tamil-kb-spacebar {
    flex: 1;
    height: 44px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tamil-kb-spacebar:hover {
    background: #334155;
    color: #ffffff;
}

.tamil-kb-enter-btn {
    height: 44px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 7px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.tamil-kb-enter-btn:hover {
    background: #1d4ed8;
}

/* Floating Launch Button (bottom right) */
.tamil-kb-float-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    border: none;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1040;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tamil-kb-float-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.65);
}

/* Active Input Field Highlight when typing with Tamil Virtual Keyboard */
.tamil-kb-active-input {
    outline: 2px solid #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
    border-color: #d97706 !important;
}

/* Tablet View Optimization (576px to 991px) — Compact, sleek sizing */
@media (min-width: 576.02px) and (max-width: 991.98px) {
    .tamil-kb-drawer {
        max-width: 580px;
        padding: 6px 8px 10px 8px;
    }
    .tamil-kb-key {
        height: 40px;
        font-size: 1.12rem;
        margin: 1px;
    }
    .tamil-kb-mod-key {
        height: 32px;
        min-width: 30px;
        font-size: 1.1rem;
    }
    .tamil-kb-tab-btn {
        padding: 3px 8px;
        font-size: 0.74rem;
    }
    .tamil-kb-bottom-btn,
    .tamil-kb-spacebar,
    .tamil-kb-enter-btn {
        height: 38px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .tamil-kb-drawer {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 6px 6px 10px 6px;
    }
    .tamil-kb-key {
        height: 44px;
        font-size: 1.15rem;
    }
    .tamil-kb-mod-key {
        height: 34px;
        font-size: 1.15rem;
    }
    .tamil-kb-search-box {
        max-width: 130px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DESH TAMIL KEYBOARD (https://www.deshkeyboard.com/tamil-typing/)
   Interactive Embed Modal, Live Suggestions, and Voice Typing
════════════════════════════════════════════════════════════════ */
.desh-kb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    z-index: 10999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.desh-kb-modal.show {
    display: flex;
}

.desh-kb-modal-dialog {
    width: 100%;
    max-width: 980px;
    height: 90vh;
    max-height: 740px;
    display: flex;
    flex-direction: column;
}

.desh-kb-modal-content {
    background: #0f172a;
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.desh-kb-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.desh-logo-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    font-weight: 900;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.6px;
}

.desh-kb-body {
    flex: 1;
    position: relative;
    background: #ffffff;
}

.desh-kb-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.desh-kb-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.desh-kb-footer {
    background: #1e293b;
    padding: 10px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Floating Live Suggestions Bar for Desh Tanglish Input */
.desh-suggestions-bar {
    position: absolute;
    background: #0f172a;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    padding: 4px;
    display: none;
    z-index: 10800;
    gap: 4px;
    max-width: 420px;
    overflow-x: auto;
    scrollbar-width: none;
}

.desh-suggestions-bar.show {
    display: flex;
}

.desh-sugg-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.12s ease;
}

.desh-sugg-btn:hover,
.desh-sugg-btn.active {
    background: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
    transform: translateY(-1px);
}

/* Voice Typing Pulsing Mic Indicator */
.desh-voice-pulse {
    animation: deshPulse 1.2s infinite;
    color: #ef4444 !important;
}

@keyframes deshPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); }
}
