/* Base Reset & Variables */
:root {
    --primary-color: #6366f1; /* Indigo/Purple */
    --primary-hover: #4f46e5;
    --secondary-color: #10b981; /* Emerald/Green */
    --secondary-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-system);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Typing Section */
.typing-section {
    padding: 30px 20px;
}

.typing-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.typing-card:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.typing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

textarea {
    width: 100%;
    min-height: 250px;
    padding: 16px;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: var(--font-system);
    transition: border-color 0.2s;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea[readonly] {
    background-color: #f9fafb;
    cursor: default;
}

.typing-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stats strong {
    color: var(--text-main);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover { background-color: var(--secondary-hover); }

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover { background-color: var(--danger-hover); }

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-whatsapp:hover {
    background-color: #20bd5a;
}

.btn-whatsapp svg {
    flex-shrink: 0;
    vertical-align: middle;
}

/* Bottom Social Media Share Card */
.social-share-card {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.share-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.share-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.15s ease, opacity 0.15s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.share-pill-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.share-pill-btn:active {
    transform: scale(0.96);
}

.share-pill-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

.share-wa { background-color: #25D366; }
.share-fb { background-color: #1877F2; }
.share-x { background-color: #0f1419; }
.share-tg { background-color: #229ED9; }
.share-copy {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.share-copy:hover {
    background-color: #e2e8f0;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #d1fae5;
    color: #065f46;
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
    transition: opacity 0.3s ease;
}

.alert.hidden {
    display: none;
    opacity: 0;
}

/* Content Sections */
.content-section {
    padding: 60px 20px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.content-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

.content-card h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.content-card p, .content-card li {
    margin-bottom: 12px;
    color: #4b5563;
}

.content-card ul, .content-card ol {
    padding-left: 20px;
}

/* Examples Table */
.examples-table {
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.example-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.example-row:last-child {
    border-bottom: none;
}

.example-row.header {
    background-color: #f3f4f6;
    font-weight: 600;
    color: var(--text-main);
}

/* FAQ Section */
.faq-section {
    margin-top: 50px;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-main);
    font-size: 2rem;
}

.faq-item {
    background: var(--bg-card);
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.faq-item h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.faq-item p {
    color: #4b5563;
}

/* Footer */
.main-footer {
    background-color: #111827;
    color: #9ca3af;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

/* Desktop visibility for mobile elements */
.mobile-menu-btn, .mobile-nav {
    display: none;
}

/* Media Queries for Desktop */
@media (min-width: 768px) {
    .typing-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .typing-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .content-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .desktop-nav {
        display: none;
    }
    .header-container {
        justify-content: space-between;
    }
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 102;
    }
    .mobile-menu-btn span {
        width: 100%;
        height: 3px;
        background-color: var(--primary-color);
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    .mobile-nav {
        display: none;
        background-color: var(--bg-card);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        z-index: 101;
    }
    .mobile-nav.open {
        display: block;
    }
    .mobile-nav-links {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    .mobile-nav-links li {
        border-bottom: 1px solid var(--border-color);
    }
    .mobile-nav-links li:last-child {
        border-bottom: none;
    }
    .mobile-nav-links a {
        display: block;
        padding: 16px 20px;
        text-decoration: none;
        color: var(--text-main);
        font-weight: 500;
        font-size: 1.05rem;
        transition: background-color 0.2s, color 0.2s;
    }
    .mobile-nav-links a:hover,
    .mobile-nav-links a.active {
        color: var(--primary-color);
        background-color: #f8fafc;
    }
    
    .typing-section {
        padding: 15px 10px;
    }
    .container {
        padding: 0 10px;
    }
    .hero {
        padding: 35px 15px 25px;
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .hero-description {
        font-size: 1rem;
    }
    .rich-editor {
        min-height: 280px;
        padding: 16px 14px;
        font-size: 1.1rem;
    }
    .editor-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }
    .editor-footer > div {
        width: 100%;
    }
    .lang-switch {
        width: 100%;
        display: flex;
    }
    .radio-label {
        flex: 1;
        text-align: center;
    }
    .radio-label span {
        display: block;
        text-align: center;
        width: 100%;
        padding: 8px 10px;
    }
    .stats {
        display: flex;
        justify-content: space-between;
        width: 100%;
        font-size: 0.88rem;
    }
    .action-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }
    .social-share-card {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }
    .share-title {
        justify-content: center;
    }
    .social-share-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .share-pill-btn {
        justify-content: center;
        padding: 8px 10px;
    }
    .btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.92rem;
    }
}

/* --- Editor Styles --- */
.editor-toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.editor-toolbar::-webkit-scrollbar {
    display: none;
}

.tool-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tool-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: #cbd5e1;
}

.tool-btn:active {
    background: #e2e8f0;
    transform: scale(0.95);
}

.tool-select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    outline: none;
    transition: all 0.15s ease;
}

.tool-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.tool-color {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    flex-shrink: 0;
    box-sizing: border-box;
}

.tool-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.tool-color::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 2px;
    flex-shrink: 0;
}

.rich-editor {
    width: 100%;
    min-height: 320px;
    padding: 20px 24px;
    font-size: 1.15rem;
    border: none;
    background: #ffffff;
    font-family: 'Anek Odia', 'Noto Sans Oriya', var(--font-system);
    line-height: 1.75;
    overflow-y: auto;
    color: #1e293b;
    outline: none;
}

.rich-editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.editor-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    gap: 12px;
}

.lang-switch {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 3px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label span {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.radio-label input[type="radio"]:checked + span {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Formatting helpers for toolbar buttons */
.font-weight-bold { font-weight: bold; }
.font-style-italic { font-style: italic; }
.text-decoration-underline { text-decoration: underline; }

/* List Styles inside Editor */
.rich-editor ol,
.rich-editor ul {
    padding-left: 2.4em;
    margin: 0.5em 0;
}

.rich-editor li {
    margin: 0.25em 0;
    line-height: 1.6;
}

.rich-editor li::marker {
    font-size: 1em;
}

/* Page Setup for Printing / PDF */
@page {
    size: auto;
    margin: 15mm 20mm;
}

/* Print Styles */
@media print {
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Completely hide all website UI, navigation, header, sections, toolbar, and social share */
    .main-header,
    .breadcrumb-container,
    .hero,
    .editor-toolbar,
    .editor-footer,
    .social-share-card,
    .keyboard-reference,
    .content-section,
    .main-footer,
    #copyAlert,
    .mobile-nav,
    .mobile-menu-btn {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    /* Reset container wrappers so they don't produce blank pages or phantom overflows */
    main,
    .typing-section,
    .container,
    .typing-card {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        min-height: 0 !important;
        height: auto !important;
    }

    #odiaEditor {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        color: #000000 !important;
        word-break: break-word;
        page-break-inside: auto;
    }

    #odiaEditor ol,
    #odiaEditor ul {
        padding-left: 2.4em !important;
        margin: 0.5em 0 !important;
    }

    #odiaEditor li {
        margin: 0.25em 0 !important;
        line-height: 1.6 !important;
    }

    #odiaEditor li::marker {
        font-size: 1em !important;
    }

    #odiaEditor table {
        border-collapse: collapse !important;
        width: 100% !important;
        page-break-inside: auto;
    }

    #odiaEditor tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    #odiaEditor img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    #odiaEditor h1,
    #odiaEditor h2,
    #odiaEditor h3,
    #odiaEditor h4,
    #odiaEditor h5,
    #odiaEditor h6 {
        page-break-after: avoid;
    }
}
/* Keyboard Reference Section */
.keyboard-reference {
    padding: 60px 0;
    background-color: #fafbfc;
}
.keyboard-header {
    text-align: center;
    margin-bottom: 40px;
}
.keyboard-header h2 {
    font-size: 2.2rem;
    color: #111827;
    margin-bottom: 15px;
    font-weight: 800;
}
.keyboard-header p {
    font-size: 1.05rem;
    color: #4b5563;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}
.keyboard-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}
.keyboard-group h3 {
    font-size: 1.3rem;
    color: #374151;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}
.keys {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.key-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 65px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.1s;
}
.key-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}
.odia-char {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}
kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    font-family: monospace;
    color: #475569;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
