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

body {
    font-family: 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', 'Kohinoor Devanagari', 'Devanagari Sangam MN', 'Aparajita', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    min-height: 100vh;
}
   
   /* Header Styles - Simple & Fast */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 35px;
    height: 35px;
    background: #2471a3;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.logo .logo-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.logo-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: -3px;
}
   
   .nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.15);
}

.cta-button {
    background: #2471a3 !important;
    padding: 8px 16px !important;
    font-weight: 600;
    border-radius: 4px !important;
}

.cta-button:hover {
    background: #17588a !important;
}
   
   /* Main Container - Optimized */
.main-container {
    background: white;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: calc(100vh - 160px);
}

.content-wrapper {
    padding: 20px;
}
   
   /* Footer Styles - Simple */
.footer {
    background: #2c3e50;
    color: white;
    padding: 30px 0 15px;
    margin-top: 40px;
}
   
   .footer-container {
       max-width: 1200px;
       margin: 0 auto;
       padding: 0 20px;
   }
   
   .footer-content {
       display: grid;
       grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
       gap: 30px;
       margin-bottom: 30px;
   }
   
   .footer-section h3 {
       color: #2471a3;
       margin-bottom: 15px;
       font-size: 1.2rem;
   }
   
   .footer-section p, .footer-section li {
       margin-bottom: 8px;
       opacity: 0.9;
   }
   
   .footer-section ul {
       list-style: none;
   }
   
   .footer-section a {
       color: #ecf0f1;
       text-decoration: none;
       transition: color 0.3s ease;
   }
   
   .footer-section a:hover {
       color: #2471a3;
   }
   
   .social-links {
       display: flex;
       gap: 15px;
       margin-top: 15px;
   }
   
   .social-link {
       width: 40px;
       height: 40px;
       background: #2471a3;
       border-radius: 50%;
       display: flex;
       align-items: center;
       justify-content: center;
       transition: all 0.3s ease;
       font-weight: bold;
   }
   
   .social-link:hover {
       background: #17588a;
       transform: translateY(-3px);
   }
   
   .footer-bottom {
       border-top: 1px solid rgba(255,255,255,0.1);
       padding-top: 20px;
       text-align: center;
       opacity: 0.8;
   }
   
   /* Hamburger Menu Styles */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
    background: transparent;
    border: none;
    outline: none;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Converter Styles */
.mobile-converter {
    display: none;
}

.converter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #2471a3;
}

.converter-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-align: center;
}

.converter-section textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
}

.converter-buttons {
    text-align: center;
    padding: 15px 0;
}

.converter-buttons input[type="button"] {
    margin: 5px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    background: #2471a3;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.converter-buttons input[type="button"]:hover {
    background: #17588a;
}

/* Desktop table button hover effects */
.desktop-converter input[type="button"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.desktop-converter input[value*="KrutiDev से Unicode"]:hover {
    background: #229954 !important;
}

.desktop-converter input[value*="Unicode से KrutiDev"]:hover {
    background: #c0392b !important;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* Mobile Header Container */
    .header {
        padding: 10px 15px;
        min-height: 65px;
    }
    
    .header-container {
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        position: relative;
        max-width: 100%;
        padding: 0;
        height: auto;
        min-height: 45px;
    }
    
    /* Mobile Logo Section */
    .logo {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0; /* Allow shrinking */
    }
    
    .logo-icon {
        width: 35px !important;
        height: 35px !important;
        font-size: 18px !important;
        flex-shrink: 0;
    }
    
    .logo .logo-name {
        font-size: 16px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .logo-subtitle {
        font-size: 11px !important;
        line-height: 1.2 !important;
        margin-top: 2px !important;
        opacity: 0.9;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Mobile Hamburger Menu */
    .hamburger {
        display: flex !important;
        z-index: 1001;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: background 0.2s ease;
        margin-left: 5px;
    }
    
    .hamburger:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .hamburger span {
        width: 24px !important;
        height: 3px !important;
        background: white !important;
        margin: 3px 0 !important;
        border-radius: 2px;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: #2c3e50;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding-top: 80px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-menu.active {
        right: 0;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        margin: 20px 0;
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.3s ease;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Close Menu Button Styles */
    .close-menu-item {
        position: absolute !important;
        top: 20px;
        right: 20px;
        margin: 0 !important;
        z-index: 1002;
    }
    
    .close-menu-btn {
        background: #c0392b;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .close-menu-btn:hover {
        background: #c0392b;
        transform: scale(1.1);
        box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    }
    
    .close-text {
        display: none;
    }
    
    .close-icon {
        font-weight: bold;
        font-size: 18px;
    }
    
    /* Staggered animation for menu items */
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.5s; }
    .nav-menu.active li:nth-child(6) { transition-delay: 0.6s; }
    
    .nav-menu a {
        font-size: 20px;
        padding: 15px 30px;
        border-radius: 8px;
        transition: all 0.3s ease;
        display: block;
        text-align: center;
        min-width: 200px;
    }
    
    .nav-menu a:hover {
        background: rgba(255,255,255,0.2);
        transform: translateY(-2px);
    }
    
    /* Hide desktop navigation items on mobile */
    .nav-menu {
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
         /* Hide desktop table, show mobile converter */
     .desktop-converter {
         display: none !important;
     }
     
     .mobile-converter {
         display: block;
     }
    
    .main-container {
        margin: 10px;
        border-radius: 6px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Mobile optimizations */
    .page-title {
        font-size: 1.2rem;
        padding: 12px;
    }
    
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }
    
    div[style*="grid-template-columns: 1fr 1fr"] > div {
        margin-bottom: 15px;
    }
    
    div[style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
        display: block !important;
    }
    
    div[style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"] {
        display: block !important;
    }
    
    h2 {
        font-size: 1.2rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
}

/* Mobile Small Screens - Better Spacing */
@media (max-width: 480px) {
    /* Proper spacing for small mobiles */
    .header {
        padding: 8px 12px;
        min-height: 60px;
    }
    
    .logo {
        gap: 10px;
        padding-right: 8px;
    }
    
    .logo .logo-name {
        font-size: 15px !important;
        margin: 0 0 2px 0 !important;
    }
    
    .logo-subtitle {
        font-size: 10.5px !important;
    }
    
    .logo-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 16px !important;
    }
    
    .hamburger {
        width: 38px;
        height: 38px;
        padding: 6px;
        margin-left: 3px;
    }
    
    .hamburger span {
        width: 20px !important;
        height: 2.5px !important;
        margin: 2.5px 0 !important;
    }
    
    .content-wrapper {
        padding: 10px;
    }
    
    .page-title {
        font-size: 1.1rem;
        padding: 10px;
    }
}

/* Ultra Small Screens - Perfect Spacing */
@media (max-width: 360px) {
    .header {
        padding: 6px 10px;
        min-height: 58px;
    }
    
    .logo {
        gap: 8px;
        padding-right: 6px;
    }
    
    .logo .logo-name {
        font-size: 14px !important;
    }
    
    .logo-subtitle {
        font-size: 10px !important;
    }
    
    .logo-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 15px !important;
    }
    
    .hamburger {
        width: 36px;
        height: 36px;
        padding: 5px;
        margin-left: 2px;
    }
    
    .hamburger span {
        width: 18px !important;
        height: 2px !important;
        margin: 2px 0 !important;
    }
    
    .converter-section textarea {
        min-height: 100px;
        font-size: 14px;
    }
    
         .converter-buttons input[type="button"] {
         font-size: 14px;
         padding: 10px 15px;
         width: 95%;
         max-width: 280px;
     }
     
     /* Mobile hover effects */
     .mobile-converter input[value*="KrutiDev से Unicode"]:hover,
     .mobile-converter input[value*="KrutiDev से Unicode"]:active {
         background: #229954 !important;
     }
     
     .mobile-converter input[value*="Unicode से KrutiDev"]:hover,
     .mobile-converter input[value*="Unicode से KrutiDev"]:active {
         background: #c0392b !important;
     }
    
    .nav-menu {
        top: 60px;
        padding-top: 30px;
    }
    
    .nav-menu a {
        font-size: 16px;
    }
}

/* Desktop optimization and performance improvements */
@media (min-width: 769px) {
    .mobile-converter {
        display: none !important;
    }
    
    .desktop-converter {
        display: table !important;
    }
    
    /* Hide close button on desktop */
    .close-menu-item {
        display: none !important;
    }
    
    /* Enhanced table styling for better UX */
    table td:first-child {
        font-weight: 600;
        width: 200px;
        text-align: center;
        vertical-align: middle;
    }
    
    table td:last-child {
        width: calc(100% - 200px);
    }
    
    textarea {
        width: 100%;
        resize: vertical;
        transition: border-color 0.2s ease;
    }
    
    textarea:focus {
        border-color: #2471a3;
        outline: none;
        box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    }
    
    /* Performance: GPU acceleration for smooth animations */
    .nav-menu a, input[type="button"] {
        transform: translateZ(0);
        will-change: transform;
    }
}
   
   /* Content Styling - Optimized */
.page-title {
    background: #2471a3;
    color: white;
    text-align: center;
    padding: 15px;
    margin: -20px -20px 20px -20px;
    font-size: 1.4rem;
    font-weight: 600;
}
   
   table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

table td {
    padding: 12px;
    border: 1px solid #ddd;
}

textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    width: 100%;
}

textarea:focus {
    border-color: #2471a3;
    outline: none;
}

input[type="button"] {
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: #2c3e50;
    color: white;
}

input[type="button"]:hover {
    background: #34495e;
}

/* KrutiDev font for the legacy text boxes (uses the installed font first) */
@font-face {
    font-family: 'Kruti Dev 010';
    src: local('Kruti Dev 010'), url('/fonts/kruti-dev-010.woff2') format('woff2');
    font-display: swap;
}

/* Placeholders are Unicode Hindi, so they must not use the KrutiDev font */
textarea::placeholder {
    font-family: 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', 'Kohinoor Devanagari', 'Devanagari Sangam MN', sans-serif;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.tool-btn {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #ccd5dc;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.tool-btn:hover {
    background: #dfe6eb;
}

/* ===== Tool / reference pages (unicode-to-krutidev, keyboard chart) ===== */
.pg-section { margin: 30px 0; }
.pg-section h2 { color: #2c3e50; margin-bottom: 18px; font-size: 1.4rem; border-bottom: 2px solid #2471a3; padding-bottom: 8px; }
.pg-section h3 { color: #2c3e50; margin: 18px 0 8px; font-size: 1.1rem; }
.pg-section p, .pg-section li { color: #444; font-size: 16px; line-height: 1.7; }
.pg-section p { margin-bottom: 12px; }
.pg-section ul, .pg-section ol { margin: 8px 0 14px 22px; }
.breadcrumb-bar { text-align: center; padding: 10px; background: #ecf0f1; border-radius: 6px; margin: 15px 0 20px; }
.breadcrumb-bar a { color: #2471a3; text-decoration: none; }

.conv-box { margin: 20px 0; }
.conv-label { padding: 12px 16px; color: #fff; font-weight: 600; border-radius: 6px 6px 0 0; }
.conv-label-u { background: #1d7a46; }
.conv-label-k { background: #2471a3; }
.conv-box textarea { display: block; width: 100%; min-height: 170px; border-radius: 0 0 6px 6px; border-top: none; padding: 12px; font-size: 17px; resize: vertical; }
.conv-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0; }
.conv-btn { border: none; border-radius: 4px; color: #fff; font-size: 15px; font-weight: 600; padding: 12px 20px; cursor: pointer; font-family: inherit; }
.conv-btn-green { background: #1d7a46; }
.conv-btn-red { background: #c0392b; }
.conv-btn:hover { filter: brightness(0.92); }

.kfont { font-family: 'Kruti Dev 010'; font-size: 22px; }
.table-scroll { overflow-x: auto; margin: 12px 0 20px; }
.chart-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; box-shadow: none; margin: 0; }
.chart-table th { background: #2471a3; color: #fff; text-align: left; padding: 10px 12px; border: 1px solid #ddd; }
.chart-table td { padding: 9px 12px; border: 1px solid #e3e8ec; vertical-align: middle; }
.chart-table code { background: #f1f3f5; padding: 2px 7px; border-radius: 4px; font-size: 15px; }
.chart-table .u { font-size: 20px; }
.chart-table .note { color: #666; font-size: 14px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 20px; }
.chart-cell { background: #fff; border: 1px solid #e3e8ec; border-radius: 6px; padding: 10px; text-align: center; }
.chart-cell .k { font-family: 'Kruti Dev 010'; font-size: 28px; line-height: 1.3; }
.chart-cell .key { display: block; font-family: monospace; font-size: 14px; color: #555; margin-top: 2px; word-break: break-all; }
.chart-cell .u { display: block; font-size: 18px; margin-top: 4px; color: #2c3e50; }
.tip-box { background: #fff3cd; border-left: 4px solid #ffc107; color: #6b5300; padding: 14px 16px; border-radius: 6px; margin: 16px 0; }
.tip-box p { color: #6b5300; margin: 0; }
.link-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.link-card { background: #fff; border: 1px solid #e3e8ec; border-left: 4px solid #2471a3; border-radius: 6px; padding: 14px; }
.link-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.link-card p { font-size: 14px; margin-bottom: 8px; }
.link-card a { color: #2471a3; font-weight: 600; text-decoration: none; font-size: 14px; }
@media (max-width: 600px) {
    .conv-btn { width: 100%; }
    .chart-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ===== Guides / articles ===== */
.toc { background: #f8f9fa; border-left: 4px solid #2471a3; padding: 14px 18px; border-radius: 6px; margin: 18px 0; }
.toc ol { margin: 8px 0 0 22px; }
.toc li { font-size: 15px; line-height: 1.9; }
.toc a { color: #2471a3; text-decoration: none; display: inline-block; padding: 8px 0; }
.meta-line { color: #6b6b6b; font-size: 14px; margin: 4px 0 14px; }
.article .pg-section h3 { margin-top: 20px; }
.article code { background: #f1f3f5; padding: 2px 7px; border-radius: 4px; font-size: 15px; }
.article .tip-box a { color: #17588a; font-weight: 600; }
.pg-section[id] { scroll-margin-top: 90px; }

/* ===== Forms ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: #2c3e50; }
.form-row input, .form-row textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccd5dc; border-radius: 4px; font-size: 16px; font-family: inherit; }
.form-row input:focus, .form-row textarea:focus { border-color: #2471a3; outline: none; }
