:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-focus: #3b82f6;
    --success: #10b981;
    --success-dark: #059669;
}

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

body {
    font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
}

/* Top Navbar */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.navbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 18px;
}

.navbar .brand i {
    color: var(--primary);
    font-size: 22px;
}

.navbar .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.navbar .nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar .nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.navbar .nav-link.active {
    color: #ffffff;
    background: var(--primary);
}

/* Hero Header */
header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    text-align: center;
    padding: 28px 20px 22px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.main-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Live Notice Banner */
.live-sync-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
}

.live-sync-banner i {
    color: var(--primary);
    font-size: 16px;
}

/* Single Typing Editor (index.php) */
.editor-container {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.editor-header {
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.editor-header .hint {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.symbols-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.symbol-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.symbol-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.textarea-wrapper {
    position: relative;
    padding: 15px;
}

#data {
    width: 100%;
    height: 320px;
    padding: 15px;
    font-size: 18px;
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    resize: vertical;
    outline: none;
    line-height: 1.7;
    color: #0f172a;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#data:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Floating Transliteration Suggestion Popup */
#suggestions-box {
    position: absolute;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    min-width: 180px;
    overflow: hidden;
}

.suggestion-item {
    padding: 8px 14px;
    font-size: 16px;
    font-family: 'Noto Sans Devanagari', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.suggestion-item .num-key {
    font-size: 11px;
    color: #94a3b8;
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1px 5px;
    border-radius: 4px;
}

.editor-footer {
    background: #f8fafc;
    border-top: 1px solid var(--border);
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stats-counter {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stats-counter span strong {
    color: var(--text-main);
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary-custom {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: #ffffff;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-danger-outline {
    background: #ffffff;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

/* Dual Editor Grid (krutidev & unicode converters) */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: stretch;
}

@media (max-width: 900px) {
    .converter-grid {
        grid-template-columns: 1fr;
    }
}

.editor-box {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.editor-box-header {
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-title .badge {
    font-size: 11px;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 12px;
}

.editor-textarea {
    width: 100%;
    height: 360px;
    padding: 16px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-main);
    border: none;
    outline: none;
    resize: vertical;
    background: #ffffff;
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

.editor-textarea::placeholder {
    color: #94a3b8;
    font-size: 15px;
}

.editor-box-footer {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.box-stats {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.box-stats strong {
    color: var(--text-main);
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Middle Actions Column */
.converter-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

@media (max-width: 900px) {
    .converter-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

.btn-action-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-action-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-action-swap {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(37,99,235,0.1);
}

.btn-action-swap:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.02);
}

.btn-mini {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-mini:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-mini.btn-copy {
    background: var(--primary-light);
    border-color: #bfdbfe;
    color: var(--primary);
    font-weight: 600;
}

.btn-mini.btn-copy:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-mini.btn-clear {
    color: #dc2626;
    border-color: #fecaca;
}

.btn-mini.btn-clear:hover {
    background: #fee2e2;
}

/* Ads Container */
.adsense-box {
    margin: 20px 0;
    text-align: center;
    min-height: 90px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* SEO Article Card */
.content-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 30px;
    margin-top: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.content-card h2 {
    font-size: 20px;
    color: #0f172a;
    margin-top: 25px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.content-card h2:first-of-type {
    margin-top: 0;
}

.content-card p {
    margin-bottom: 14px;
    color: #334155;
    font-size: 15px;
}

.content-card strong {
    color: #0f172a;
}

.faq-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.faq-item h3 {
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 6px;
    font-weight: 600;
}

.faq-item p {
    margin-bottom: 0;
    color: #475569;
    font-size: 14px;
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    display: none;
    z-index: 2000;
}

footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 40px;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Voice Typing Mic Button & Pulse */
.btn-mic {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-mic:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-mic.recording {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Secondary Editor Tools Bar */
.editor-tools-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-tools-left, .editor-tools-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-pill-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.tool-pill-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #bfdbfe;
}

.tool-pill-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-dark);
}

.font-zoom-ctrls {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.font-zoom-btn {
    border: none;
    background: transparent;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.font-zoom-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.font-zoom-label {
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: #f8fafc;
    min-width: 42px;
    text-align: center;
}

/* Find & Replace Drawer */
.find-replace-panel {
    display: none;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.find-replace-grid {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.find-input-group {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 180px;
}

.find-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
}

.find-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.match-count-badge {
    position: absolute;
    right: 8px;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

/* Virtual On-Screen Hindi Keyboard */
.virtual-keyboard-panel {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    animation: slideDown 0.2s ease-out;
}

.vk-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.vk-tab {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
}

.vk-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-dark);
}

.vk-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.vk-key {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.vk-key:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37,99,235,0.15);
}

.vk-key:active {
    background: #dbeafe;
    transform: translateY(1px);
}

.vk-key.vk-wide {
    min-width: 60px;
    font-size: 12px;
}

.vk-key.vk-space {
    flex: 1;
    min-width: 120px;
    font-size: 13px;
    color: #64748b;
}

/* WhatsApp & Social Action Buttons */
.btn-whatsapp {
    background: #25d366 !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
}

.btn-whatsapp:hover {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

/* Fullscreen Mode */
.editor-container.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

.editor-container.is-fullscreen .textarea-wrapper {
    flex: 1;
    display: flex;
}

.editor-container.is-fullscreen #data {
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
}

@media (max-width: 768px) {
    header h1 { font-size: 22px; }
    #data { height: 260px; font-size: 16px; }
    .editor-footer { flex-direction: column; align-items: stretch; }
    .action-buttons { justify-content: stretch; }
    .action-buttons .action-btn { flex: 1; justify-content: center; }
    .editor-tools-subbar { justify-content: center; }
    .find-replace-grid { flex-direction: column; align-items: stretch; }
}
