/* ========================
   Global Styles & Reset
   ======================== */

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

:root {
    /* Color Palette - Google News Inspired Clean White */
    --primary-gradient: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    --secondary-gradient: linear-gradient(135deg, #1a73e8 0%, #5e97f6 100%);
    --success-gradient: linear-gradient(135deg, #1e8e3e 0%, #34a853 100%);
    --bg-gradient: #ffffff;

    /* Colors - Google News Style */
    --primary-color: #1a73e8;
    --secondary-color: #4285f4;
    --accent-color: #1a73e8;
    --success-color: #1e8e3e;
    --text-dark: #202124;
    --text-light: #202124;
    --text-muted: #5f6368;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #dadce0;
    --shadow-color: rgba(60, 64, 67, 0.15);

    /* Card/Glass - Clean solid backgrounds */
    --glass-bg: #ffffff;
    --glass-border: #dadce0;
    --glass-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.15), 0 4px 8px 3px rgba(60, 64, 67, 0.1);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Fonts */
    --font-bengali: 'Noto Sans Bengali', sans-serif;
    --font-english: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Screen Reader Only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    font-family: var(--font-bengali), var(--font-english);
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    background: var(--bg-primary);
}

/* ========================
   Background Animation
   ======================== */

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-primary);
    background-size: 100% 100%;
    animation: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animated Background Shapes - Disabled in light mode for clean look */
.background-animation::before,
.background-animation::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: none;
}

.background-animation::before {
    top: -200px;
    left: -200px;
    background: transparent;
    animation-delay: 0s;
}

.background-animation::after {
    bottom: -200px;
    right: -200px;
    background: transparent;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(100px, -100px) scale(1.1);
    }

    66% {
        transform: translate(-100px, 100px) scale(0.9);
    }
}

/* ========================
   Container
   ======================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
    margin-top: 80px;
    /* Default margin for desktop */
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================
   Navbar
   ======================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.1);
    transition: all var(--transition-normal);
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.5rem var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Nav Left: Logo */
.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-area img {
    height: 50px !important;
    width: auto !important;
    display: block !important;
    max-height: 50px;
    object-fit: contain;
}

.logo-icon {
    font-size: 2rem;
    animation: rotate 20s linear infinite;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

/* Calendar Widget - Hide on mobile */
.bangla-calendar-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none !important;
    padding: 6px 10px;
    border-radius: 0 !important;
    border: none !important;
    color: var(--primary-color) !important;
    font-family: var(--font-bengali);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: none !important;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bangla-calendar-widget:hover {
    opacity: 0.85;
}

.calendar-icon {
    font-size: 1.1rem;
}

/* Mobile Header Layout */
@media (max-width: 1100px) {
    .nav-container {
        display: flex;
        justify-content: space-between;
        padding: 0.7rem 1rem;
        min-height: 60px;
    }

    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex !important;
        order: -1;
    }

    .nav-left {
        justify-content: center;
        flex: 1;
    }

    .bangla-calendar-widget {
        display: none !important;
    }
}

/* Nav Right: Menu & Controls */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-xs);
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    position: relative;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.08);
}

/* Dropdown Container */
.nav-item.dropdown {
    position: relative;
}

/* Dropdown Arrow animation */
.dropdown-arrow {
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.nav-item.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu Styling */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0px;
    padding-top: 10px;
    /* Bridge the gap */
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    width: max-content;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.15);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.nav-item.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin-bottom: 2px;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Dark Mode Dropdown Overrides */
body.dark-mode .dropdown-menu {
    background: #292a2d;
    border-color: var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .dropdown-menu a {
    color: var(--text-dark);
}

body.dark-mode .dropdown-menu a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.control-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-btn:hover {
    background: rgba(26, 115, 232, 0.08);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.lang-text {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    margin-top: -3px;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 3px;
    transition: all var(--transition-normal);
    display: block;
}

/* Share Dropdown in Navbar */
.share-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 999;
}

.share-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.share-dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.share-dropdown-item svg {
    flex-shrink: 0;
}

/* Dark Mode Share Dropdown */
body.dark-mode .share-dropdown {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .share-dropdown-item {
    color: #f1f5f9;
}

body.dark-mode .share-dropdown-item:hover {
    background: var(--primary-color);
    color: white;
}

/* Mobile specific controls */
@media (max-width: 767px) {
    .nav-controls {
        gap: 0.6rem;
        display: flex;
        align-items: center;
    }

    .control-btn {
        width: 38px;
        height: 38px;
        background: transparent;
        border: 1px solid var(--border-color);
    }

    .control-btn svg {
        width: 18px;
        height: 18px;
    }

    .lang-text {
        font-size: 0.8rem;
        font-weight: 700;
    }
}

/* Mobile Menu Dropdown - Full Height Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a73e8 0%, #1557b0 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 0;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    left: 0;
}

/* Overlay for closing menu - Using ::after for better click handling */
.mobile-menu::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

.mobile-menu.active::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-links {
    list-style: none;
    padding: 60px 15px 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mobile-nav-links a {
    text-decoration: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 18px;
    display: block;
    border-radius: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.mobile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 10px 15px;
}

/* Dark Mode Styles */
body.dark-mode {
    --text-dark: #e8eaed;
    --text-light: #e8eaed;
    --text-muted: #9aa0a6;
    --bg-primary: #1f1f1f;
    --bg-secondary: #292a2d;
    --bg-card: #292a2d;
    --border-color: #3c4043;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glass-bg: #292a2d;
    --glass-border: #3c4043;
    --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2);
    --primary-color: #8ab4f8;
    --secondary-color: #669df6;
    --accent-color: #8ab4f8;
    --success-color: #81c995;
}

body.dark-mode .text-area {
    background: #303134;
    color: #e8eaed;
    border-color: #3c4043;
}

body.dark-mode .bijoy-output {
    background: #303134;
    color: #e8eaed;
}

/* ========================
   Responsive Breakpoints - Enhanced for All Devices
   ======================== */

/* QHD Desktop (2560x1440) */
@media (min-width: 2560px) {

    /* Show desktop menu on ultra-wide screens */
    .desktop-menu {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .bangla-calendar-widget {
        display: flex !important;
    }

    .container {
        max-width: 1800px;
    }

    .nav-container {
        max-width: 100%;
    }
}

/* Ultra-wide Screen Header Limit (4K, 5K) */
@media (min-width: 2500px) {
    .nav-container {
        max-width: 2350px !important;
        margin: 0 auto !important;
    }
}

/* Header constraint for iMac Retina 4k 21.5" (2048-2239px) */
@media (min-width: 2048px) and (max-width: 2239px) {
    .nav-container {
        max-width: 1750px;
        margin: 0 auto;
    }

    .container {
        max-width: 1650px;
    }
}

/* Header constraint for iMac Retina 4.5k 24" (2240-2559px) */
@media (min-width: 2240px) and (max-width: 2499px) {
    .nav-container {
        max-width: 1900px;
        margin: 0 auto;
    }

    .container {
        max-width: 1800px;
    }
}

/* Full HD Desktop (1920x1080) */
@media (min-width: 1920px) and (max-width: 2559px) {

    /* Show desktop menu on large screens */
    .desktop-menu {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .bangla-calendar-widget {
        display: flex !important;
    }

    .container {
        max-width: 1400px;
    }
}

/* Small Laptop (1280x800) - Desktop Menu */
@media (min-width: 1280px) and (max-width: 1365px) {

    /* Show desktop menu on small laptops */
    .desktop-menu {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .bangla-calendar-widget {
        display: flex !important;
    }

    .nav-container {
        padding: 0.8rem 1.5rem;
    }

    .nav-menu {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 7px 10px;
    }

    .container {
        max-width: 1200px;
        padding: var(--spacing-md);
    }
}

/* Standard Laptop (1366x768) */
@media (min-width: 1366px) and (max-width: 1919px) {

    /* Show desktop menu on larger screens */
    .desktop-menu {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .bangla-calendar-widget {
        display: flex !important;
    }

    .container {
        max-width: 1300px;
        padding: var(--spacing-md);
    }
}

/* iPad Landscape (1024x768) */
@media (min-width: 1024px) and (max-width: 1279px) {

    /* Force mobile menu on smaller tablets */
    .desktop-menu {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .nav-container {
        padding: 0.8rem 1.5rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .mobile-menu-toggle span {
        display: block !important;
        width: 100%;
        height: 3px;
        background-color: var(--text-dark);
    }

    .nav-left {
        flex: 1;
        justify-content: center;
    }

    .logo-icon {
        font-size: 2rem;
    }

    .logo-main {
        font-size: 1.4rem;
    }

    .bangla-calendar-widget {
        display: none !important;
    }

    .nav-right {
        display: flex;
        gap: 1rem;
    }

    .control-btn {
        width: 42px;
        height: 42px;
    }

    .container {
        max-width: 980px;
        padding: var(--spacing-md);
    }
}

/* iPad Portrait (768x1024) */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Force mobile menu on tablets */
    .desktop-menu {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .nav-container {
        padding: 0.7rem 1rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .mobile-menu-toggle span {
        display: block !important;
        width: 100%;
        height: 2.5px;
        background-color: var(--text-dark);
    }

    .nav-left {
        flex: 1;
        justify-content: center;
    }

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

    .logo-icon {
        font-size: 1.8rem;
    }

    .logo-main {
        font-size: 1.3rem;
    }

    .bangla-calendar-widget {
        display: none !important;
    }

    .nav-right {
        display: flex;
        gap: 0.8rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .container {
        padding: var(--spacing-md);
    }

    .text-area {
        height: 250px;
        font-size: 1rem;
    }

    .info-header {
        flex-direction: column;
        align-items: center;
    }

    .share-widget {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Landscape & Small Tablets (428px - 767px) */
@media (min-width: 428px) and (max-width: 767px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: var(--spacing-sm);
        margin-top: 70px;
    }

    .logo-main {
        font-size: 1.25rem;
    }

    /* Converter boxes - Full width with small margins */
    .converter-box {
        padding: 0.8rem;
        margin-bottom: var(--spacing-md);
    }

    /* Box header - Compact */
    .box-header {
        margin-bottom: 0.6rem;
    }

    .box-header h2 {
        font-size: 1.1rem;
    }

    .box-actions {
        gap: 0.4rem;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    /* Textarea - Full width */
    .text-area {
        width: 100%;
        height: 200px;
        font-size: 0.95rem;
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }

    /* Input mode section */
    .input-mode-section {
        padding: 0.5rem 0.8rem;
        margin-bottom: 0;
    }

    .input-mode-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .radio-option {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Center controls - Compact buttons */
    .center-controls {
        gap: var(--spacing-sm);
    }

    .swap-icon {
        padding: 0.5rem;
    }

    .swap-icon svg {
        width: 28px;
        height: 28px;
    }

    .conversion-buttons {
        gap: 0.5rem;
    }

    .convert-action-btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .convert-action-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Info section - Modern centered design */
    .info-section {
        padding: 1rem 0.8rem;
        margin-bottom: var(--spacing-lg);
    }

    .info-header {
        gap: 1rem;
    }

    .title-group .main-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .title-group .subtitle {
        font-size: 0.9rem;
    }

    .share-widget {
        padding: 0.9rem 1.2rem;
        max-width: 100%;
    }

    .share-label {
        font-size: 0.9rem;
    }

    .share-btn {
        width: 38px;
        height: 38px;
    }

    .toggle-info-btn {
        padding: 0.3rem 0.7rem;
        font-size: 0.7rem;
    }
}

/* iPhone 12/13 Pro Max (428x926) */
@media (min-width: 414px) and (max-width: 428px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: var(--spacing-sm);
    }

    .logo-main {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.6rem;
    }

    /* Converter boxes - Full width */
    .converter-box {
        padding: 0.7rem;
    }

    .box-header h2 {
        font-size: 1.05rem;
    }

    .box-actions {
        gap: 0.4rem;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Textarea - Full width */
    .text-area {
        width: 100%;
        height: 180px;
        font-size: 0.9rem;
        padding: 0.7rem;
        margin-bottom: 0.7rem;
    }

    /* Input modes */
    .input-mode-section {
        padding: 0.5rem 0.7rem;
        margin-bottom: 0;
    }

    .input-mode-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.4rem;
    }

    .radio-option {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    /* Compact buttons */
    .convert-action-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .convert-action-btn svg {
        width: 15px;
        height: 15px;
    }

    .swap-icon svg {
        width: 26px;
        height: 26px;
    }
}

/* iPhone 11 Pro Max / XR (414x896) */
@media (min-width: 390px) and (max-width: 414px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 0.8rem;
    }

    .logo-main {
        font-size: 1.15rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    /* Info section */
    .info-section {
        padding: 0.8rem 0.6rem;
    }

    .title-group .main-title {
        font-size: 1.3rem;
    }

    .share-widget {
        padding: 0.6rem 0.9rem;
    }

    .share-btn {
        width: 32px;
        height: 32px;
    }

    /* Converter */
    .converter-box {
        padding: var(--spacing-sm);
    }

    .text-area {
        height: 170px;
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    /* Input modes - Grid layout */
    .input-mode-section {
        padding: 0.5rem var(--spacing-sm);
        margin-bottom: 0;
    }

    .input-mode-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .radio-option {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
        width: 100%;
    }

    .radio-option input[type="radio"] {
        width: 16px;
        height: 16px;
    }

    .convert-action-btn {
        width: 105px;
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .box-header h2 {
        font-size: 1rem;
    }
}

/* iPhone 12/13 (390x844) */
@media (min-width: 375px) and (max-width: 390px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 0.7rem;
    }

    .logo-main {
        font-size: 1.1rem;
    }

    .logo-icon {
        font-size: 1.45rem;
    }

    .text-area {
        height: 160px;
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    .convert-action-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .box-header h2 {
        font-size: 0.95rem;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .copy-btn span {
        display: none;
    }

    .input-mode-options {
        gap: 0.3rem;
    }

    .radio-option {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* iPhone SE / 6/7/8 (375x667) */
@media (min-width: 360px) and (max-width: 375px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 0.6rem;
        margin-top: 65px;
    }

    .logo-icon {
        font-size: 1.4rem;
    }

    .logo-main {
        font-size: 1.05rem;
    }

    .info-section {
        padding: 0.8rem 0.6rem;
        margin-bottom: var(--spacing-md);
    }

    .info-header {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
        box-sizing: border-box;
    }

    .title-group .main-title {
        font-size: 1.2rem;
        line-height: 1.3;
        text-align: center;
    }

    .title-group .subtitle {
        font-size: 0.75rem;
        text-align: center;
    }

    .info-section {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .info-content {
        width: 100%;
        box-sizing: border-box;
    }

    .share-widget {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 0.8rem;
    }

    .share-label {
        font-size: 0.75rem;
    }

    .share-btn {
        width: 30px;
        height: 30px;
    }

    .share-btn svg {
        width: 14px;
        height: 14px;
    }

    .toggle-info-btn {
        padding: 0.25rem 0.6rem;
        font-size: 0.65rem;
    }

    .info-content.expanded {
        max-height: 2500px;
    }

    .info-text-wrapper p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .feature-list li {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .text-area {
        height: 150px;
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .convert-action-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .box-header {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .box-header h2 {
        font-size: 0.9rem;
        flex: 1;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }

    .copy-btn span {
        display: none;
    }

    .input-mode-section {
        padding: 0.3rem var(--spacing-xs);
        margin-bottom: 0;
    }

    .input-mode-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
        gap: 0.25rem;
    }

    .radio-option {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .radio-option input[type="radio"] {
        width: 14px;
        height: 14px;
    }

    .swap-icon {
        padding: 0.3rem;
    }

    .swap-icon svg {
        width: 24px;
        height: 24px;
    }

    .center-controls {
        gap: var(--spacing-sm);
    }

    .conversion-buttons {
        gap: var(--spacing-xs);
    }

    .instructions-section h2,
    .comments-section h2 {
        font-size: 1.3rem;
    }

    .instruction-box h3 {
        font-size: 1rem;
    }

    .step-list li {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .footer p {
        font-size: 0.8rem;
    }

    .copyright {
        font-size: 0.7rem;
    }

    .toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* Smallest Android (360x640 - Galaxy S5) */
@media (max-width: 360px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .logo-icon {
        font-size: 1.3rem;
    }

    .logo-main {
        font-size: 1rem;
    }

    .control-btn {
        width: 32px;
        height: 32px;
    }

    .control-btn svg {
        width: 16px;
        height: 16px;
    }

    .lang-text {
        font-size: 0.7rem;
    }

    /* Converter - Full width with minimal padding */
    .converter-box {
        padding: 0.6rem;
        margin-bottom: var(--spacing-md);
        width: 100%;
        box-sizing: border-box;
    }

    .box-header {
        flex-wrap: nowrap;
        gap: 0.3rem;
        margin-bottom: 0.5rem;
    }

    .box-header h2 {
        font-size: 0.9rem;
        width: auto;
        flex: 1;
    }

    .box-actions {
        width: auto;
        gap: 0.3rem;
        flex-shrink: 0;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }

    .copy-btn span {
        display: none;
    }

    /* Textarea - Full width */
    .text-area {
        width: 100%;
        height: 140px;
        font-size: 0.8rem;
        padding: 0.5rem;
        margin-bottom: 0.6rem;
        box-sizing: border-box;
    }

    /* Input modes - 2 column grid */
    .input-mode-section {
        padding: 0.3rem 0.5rem;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .input-mode-title {
        display: none;
        /* Hide title */
    }

    .input-mode-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.3rem;
    }

    .radio-option {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        width: 100%;
    }

    .radio-option input[type="radio"] {
        width: 14px;
        height: 14px;
    }

    .input-mode-hint {
        font-size: 0.7rem;
        padding: 0.4rem;
    }

    /* Compact buttons */
    .swap-icon {
        padding: 0.3rem;
    }

    .swap-icon svg {
        width: 24px;
        height: 24px;
    }

    .convert-action-btn {
        padding: 5px 8px;
        font-size: 0.65rem;
    }

    .convert-action-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Info section */
    .info-section {
        padding: 0.6rem 0.4rem;
        margin-bottom: var(--spacing-md);
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .info-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .title-group {
        width: 100%;
        box-sizing: border-box;
    }

    .title-group .main-title {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 5px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    .title-group .subtitle {
        font-size: 0.7rem;
        text-align: center;
    }

    .share-widget {
        width: 100%;
        justify-content: center;
        padding: 0.4rem 0.6rem;
    }

    .share-label {
        font-size: 0.7rem;
    }

    .share-btn {
        width: 28px;
        height: 28px;
    }

    .share-btn svg {
        width: 13px;
        height: 13px;
    }

    .toggle-info-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.6rem;
    }

    .info-content {
        width: 100%;
        box-sizing: border-box;
    }

    .info-text-wrapper {
        width: 100%;
        box-sizing: border-box;
    }

    .info-text-wrapper p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .center-controls {
        gap: var(--spacing-sm);
    }

    .conversion-buttons {
        gap: var(--spacing-xs);
    }

    .instructions-section h2,
    .comments-section h2 {
        font-size: 1.3rem;
    }

    .instruction-box h3 {
        font-size: 1rem;
    }

    .step-list li {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .footer p {
        font-size: 0.8rem;
    }

    .copyright {
        font-size: 0.7rem;
    }

    .toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* Galaxy Fold & Extra Small Devices (280px - 320px) */
@media (max-width: 320px) {
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Ultra compact navbar */
    .nav-container {
        padding: 0.4rem 0.3rem;
        min-height: 50px;
    }

    .mobile-menu-toggle {
        width: 18px;
        height: 14px;
        left: 0.3rem;
    }

    .mobile-menu-toggle span {
        height: 2px;
    }

    .nav-left {
        gap: 2px;
    }

    .logo-main {
        font-size: 0.8rem;
    }

    .logo-icon {
        font-size: 1rem;
    }

    .nav-right {
        gap: 0.2rem;
    }

    .control-btn {
        width: 28px;
        height: 28px;
    }

    .control-btn svg {
        width: 12px;
        height: 12px;
    }

    .lang-text {
        font-size: 0.55rem;
    }

    /* Container adjustments */
    .container {
        padding: 0.25rem;
        margin-top: 55px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Info section - fully contained */
    .info-section {
        padding: 0.5rem 0.3rem;
        margin-bottom: 0.5rem;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .info-header {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .title-group {
        width: 100%;
        box-sizing: border-box;
        padding: 0 0.2rem;
    }

    .title-group .main-title {
        font-size: 0.95rem;
        line-height: 1.3;
        word-break: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    .title-group .subtitle {
        font-size: 0.6rem;
        text-align: center;
    }

    .share-widget {
        padding: 0.3rem 0.4rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .share-label {
        font-size: 0.6rem;
        width: 100%;
        text-align: center;
    }

    .share-icons {
        width: 100%;
        justify-content: center;
        gap: 0.4rem;
    }

    .share-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .share-btn svg {
        width: 12px;
        height: 12px;
    }

    .toggle-info-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
    }

    .info-content {
        width: 100%;
        box-sizing: border-box;
    }

    .info-text-wrapper {
        width: 100%;
        box-sizing: border-box;
        padding: 0 0.2rem;
    }

    .info-text-wrapper p {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .feature-list li {
        font-size: 0.75rem;
    }

    .edu-content ul li {
        font-size: 0.75rem;
    }

    /* Converter boxes */
    .converter-box {
        padding: 0.4rem;
        margin-bottom: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .box-header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.3rem;
        margin-bottom: 0.4rem;
    }

    .box-header h2 {
        font-size: 0.8rem;
        width: auto;
        flex: 1;
    }

    .box-actions {
        width: auto;
        justify-content: flex-end;
        gap: 0.3rem;
        flex-shrink: 0;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.6rem;
        min-width: auto;
    }

    .copy-btn span {
        display: none;
    }

    .text-area {
        height: 130px;
        font-size: 0.75rem;
        padding: 0.4rem;
        margin-bottom: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Input modes - 2 column grid even smaller */
    .input-mode-section {
        padding: 0.2rem 0.3rem;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .input-mode-title {
        display: none;
    }

    .input-mode-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
        width: 100%;
    }

    .radio-option {
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
        width: 100%;
        gap: 0.3rem;
    }

    .radio-option input[type="radio"] {
        width: 14px;
        height: 14px;
    }

    .radio-option span {
        font-size: 0.65rem;
    }

    .input-mode-hint {
        font-size: 0.6rem;
        padding: 0.3rem;
    }

    /* Center controls */
    .swap-icon {
        padding: 0.2rem;
    }

    .swap-icon svg {
        width: 20px;
        height: 20px;
    }

    .convert-action-btn {
        width: 85px;
        padding: 5px;
        font-size: 0.6rem;
    }

    .convert-action-btn svg {
        width: 13px;
        height: 13px;
    }

    /* Footer */
    .footer {
        padding: 0.5rem;
    }

    .footer p {
        font-size: 0.65rem;
    }

    .copyright {
        font-size: 0.55rem;
    }

    /* Toast */
    .toast {
        left: 5px;
        right: 5px;
        bottom: 5px;
        padding: 0.5rem 0.7rem;
        font-size: 0.7rem;
    }
}

/* Prevent horizontal scroll on all devices */
html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.container {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Force all direct children of container to stay within bounds */
.container>* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure images and media are responsive */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Fix for very long words */
.text-area,
p,
li,
span,
h1,
h2,
h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Common Responsive Containers */
.single-converter-container {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(0.5rem, 4vw, 1.5rem);
}

.action-divider {
    margin: clamp(1rem, 5vh, 2rem) 0;
    text-align: center;
}

/* ========================
   Description Section
   ======================== */

/* ========================
   General Glass Effect Utility
   ======================== */
.glass-effect {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
}

.description,
.info-section {
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--glass-shadow);
    color: var(--text-dark);
    animation: fadeInUp 0.8s ease 0.2s both;
}

.description p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.05rem;
}

.description p:last-child {
    margin-bottom: 0;
}

.description strong {
    font-weight: 600;
    color: var(--primary-color);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================
   Converter Section
   ======================== */

.converter-section {
    margin-bottom: var(--spacing-sm);
    animation: fadeInUp 0.8s ease 0.4s both;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    align-items: start;
}

/* Desktop: Side by side with buttons below */
@media (min-width: 1024px) {
    .converter-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto;
        gap: var(--spacing-md);
        align-items: start;
    }

    /* Explicit grid placement - force with !important */
    #unicode-box {
        grid-row: 1 !important;
        grid-column: 1 !important;
        min-width: 0;
        overflow: hidden;
    }

    #bijoy-box {
        grid-row: 1 !important;
        grid-column: 2 !important;
        margin-top: 0;
        min-width: 0;
        overflow: hidden;
    }

    /* Left box: Compact header */
    #unicode-box .box-header {
        margin-bottom: 0.5rem;
    }

    #bijoy-box .box-header {
        margin-bottom: 0.5rem;
    }

    /* Hide bijoy hint on desktop */
    .bijoy-note {
        display: none !important;
    }

    /* Compact input mode section for desktop */
    .input-mode-section {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }

    .input-mode-options {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.25rem;
        justify-content: center;
    }

    .radio-option {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
        min-height: auto;
    }

    /* Fixed textarea height so both boxes have same size white area */
    .textarea-wrapper .text-area {
        height: 350px;
        max-height: none;
        min-height: 350px;
        margin-bottom: 0;
    }

    /* Center controls: Full-width row below boxes, horizontal layout */
    .center-controls {
        grid-row: 2 !important;
        grid-column: 1 / 3 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 1rem 0 0;
    }

    .conversion-buttons {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: center;
    }

    /* Swap button between conversion buttons */
    .swap-icon {
        order: 0;
        transform: rotate(90deg);
    }

    .convert-action-btn:first-child {
        order: -1;
    }

    .convert-action-btn:last-child {
        order: 1;
    }
}

/* Mobile: Stack vertically */
@media (max-width: 1023px) {
    .converter-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        width: 100%;
    }
}

/* ========================
   Converter Box
   ======================== */

.converter-box {
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    box-shadow: var(--glass-shadow);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.converter-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.2), 0 8px 24px rgba(60, 64, 67, 0.15);
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: nowrap;
    gap: 1rem;
}

.box-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

.box-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-shrink: 0;
}

/* Copy and Clear Buttons */
.copy-btn,
.clear-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-family: var(--font-bengali);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

/* Hide copy button text on all devices - show icon only */
.copy-btn span {
    display: none;
}

.copy-btn:hover,
.clear-btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
}

.copy-btn svg,
.clear-btn svg {
    stroke: currentColor;
    width: 16px;
    height: 16px;
}

.clear-btn {
    color: #d93025;
    background: rgba(217, 48, 37, 0.08);
    border-color: rgba(217, 48, 37, 0.3);
}

.clear-btn:hover {
    background: rgba(217, 48, 37, 0.15);
    border-color: rgba(217, 48, 37, 0.5);
}

.text-area {
    width: 100%;
    height: 300px;
    max-height: 500px;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-bengali);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    resize: vertical;
    overflow-y: auto;
    transition: all var(--transition-normal);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.text-area:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.text-area::placeholder {
    color: var(--text-muted);
}

/* Textarea wrapper fills remaining space */
.textarea-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.textarea-wrapper .text-area {
    flex: 1;
}

/* Wrapper for textarea to position fullscreen button */
.converter-box {
    position: relative;
}

/* ========================
   Input Mode Section
   ======================== */

.input-mode-section {
    margin-bottom: 0;
    padding: 0.25rem 0;
    background: transparent;
    border: none;
}

.input-mode-title {
    display: none;
    /* Hide "Input Mode:" text */
}

.input-mode-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    margin-bottom: var(--spacing-sm);
    justify-content: center;
}

.radio-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    background: transparent;
    border: none;
    transition: all var(--transition-fast);
    user-select: none;
    min-height: auto;
    white-space: nowrap;
    font-size: 0.85rem;
}

.radio-option:hover {
    transform: scale(1.05);
}

.radio-option:active {
    transform: scale(0.98);
}

.radio-option input[type="radio"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--success-color);
    flex-shrink: 0;
}

.radio-option span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
}

.radio-option input[type="radio"]:checked {
    transform: scale(1.15);
}

.radio-option:has(input[type="radio"]:checked) span {
    color: var(--success-color);
    font-weight: 600;
}

.input-mode-hint {
    display: none;
}

/* Spacer to align boxes on desktop */
.desktop-spacer {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-spacer {
        display: block !important;
    }

    /* Ensure uniform height for the section above textareas to align them */
    .input-mode-section {
        min-height: 55px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}


/* ========================
   Custom Fonts
   ======================== */

@font-face {
    font-family: 'SutonnyMJ';
    src: url('../fonts/SutonnyMJ.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* বিজয় টেক্সটএরিয়ার জন্য বিশেষ স্টাইল */
.text-area.bijoy-output {
    font-family: 'SutonnyMJ', 'Courier New', monospace;
    font-size: 1.25rem;
    letter-spacing: 0px;
    background: var(--bg-primary);
    color: var(--text-dark);
    line-height: 1.5;
}

/* প্লেসহোল্ডারের জন্য ফিক্স: যাতে রিডেবল ফন্ট দেখায় */
.text-area.bijoy-output::placeholder {
    font-family: var(--font-bengali), var(--font-english);
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.bijoy-note {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: calc(-1 * var(--spacing-md));
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    /* Hidden by default, shown via JS for 5 seconds */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.bijoy-note.visible {
    opacity: 1;
    visibility: visible;
}

.bijoy-note svg {
    flex-shrink: 0;
    stroke: var(--text-muted);
}

.bijoy-note span {
    line-height: 1.4;
}

.convert-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 1rem 2rem;
    background-color: #2f4f2f;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-bengali);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(47, 79, 47, 0.4);
}

.convert-btn:hover {
    background-color: #10df2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 79, 47, 0.6);
}

.convert-btn:active {
    background-color: #0bde27;
    transform: translateY(0);
}

.convert-btn svg {
    stroke: currentColor;
}

/* ========================
   Fullscreen Button
   ======================== */

.textarea-wrapper {
    position: relative;
    margin-bottom: var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Fullscreen Button Styles handled in .rectangular-btn and header actions */
.box-footer-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    /* Center items vertically */
    padding: 0 0.6rem;
    margin-top: -0.6rem;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
    /* Gap between button and stats */
}

.fullscreen-btn.rectangular-btn {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 1;
    width: auto;
    height: auto;
}

.fullscreen-btn.rectangular-btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.fullscreen-btn.rectangular-btn svg {
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* ========================
   Fullscreen Mode
   ======================== */

.converter-box {
    position: relative;
}

.fullscreen-mode {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100vh !important;
    z-index: 9999;
    background: var(--bg-gradient);
    padding: var(--spacing-xl);
    margin: 0 !important;
    max-width: none !important;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.fullscreen-mode>* {
    width: 100%;
    max-width: none;
}

.fullscreen-mode .box-header {
    margin-bottom: var(--spacing-md);
}

.fullscreen-mode .text-area {
    height: calc(100vh - 400px) !important;
    max-height: none !important;
    min-height: 300px;
}

@media (max-width: 768px) {
    .fullscreen-mode {
        padding: var(--spacing-md);
    }

    .fullscreen-mode .text-area {
        height: calc(100vh - 350px) !important;
    }
}

@media (max-width: 480px) {
    .fullscreen-mode {
        padding: var(--spacing-sm);
    }

    .fullscreen-mode .text-area {
        height: calc(100vh - 320px) !important;
    }
}

.fullscreen-mode .fullscreen-btn svg {
    transform: rotate(45deg);
}

/* Hide other elements when fullscreen is active */
body.has-fullscreen .header,
body.has-fullscreen .footer,
body.has-fullscreen .swap-icon,
body.has-fullscreen .instructions,
body.has-fullscreen .description,
body.has-fullscreen .tool-header,
body.has-fullscreen .tool-actions,
body.has-fullscreen .smart-features-bar,
body.has-fullscreen .text-stats,
body.has-fullscreen .connection-status {
    display: none !important;
}

body.has-fullscreen .converter-grid {
    grid-template-columns: 1fr !important;
}

body.has-fullscreen .converter-box:not(.fullscreen-mode) {
    display: none !important;
}

body.has-fullscreen {
    overflow: hidden;
}


/* ========================
   Center Controls
   ======================== */

.center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
}

/* Mobile: Vertical layout with swap between buttons */
@media (max-width: 1023px) {
    .center-controls {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-sm) 0;
        gap: var(--spacing-sm);
        width: 100%;
        box-sizing: border-box;
    }
}

.swap-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-normal);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.swap-icon:hover {
    color: var(--primary-color);
    transform: rotate(180deg);
    background: rgba(26, 115, 232, 0.08);
    border-color: var(--primary-color);
}

/* Mobile: Keep vertical orientation */
@media (max-width: 1023px) {
    .swap-icon {
        transform: none;
    }

    .swap-icon:hover {
        transform: rotate(180deg);
    }
}

.conversion-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    align-items: center;
}

/* Mobile: Vertical buttons */
@media (max-width: 1023px) {
    .conversion-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
        width: 100%;
    }
}

.convert-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #1e8e3e;
    color: white;
    border: 1px solid #1e8e3e;
    padding: 10px 18px;
    border-radius: 50px;
    font-family: var(--font-bengali);
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.convert-action-btn:hover {
    background-color: #28b328;
    /* Slightly lighter dark green */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.convert-action-btn:active {
    background-color: #268d26;
    /* Darker green */
    transform: translateY(0);
}

.convert-action-btn svg {
    stroke: currentColor;
}

/* Secondary action buttons (Sample, Swap) */
.convert-action-btn.secondary-action {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 8px 14px;
    font-size: 0.85rem;
    backdrop-filter: none;
}

.convert-action-btn.secondary-action:hover {
    background-color: var(--border-color);
    border-color: var(--border-color);
}

/* Swap button animation */
@keyframes swapRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(180deg);
    }
}

.convert-action-btn.swap-animate svg {
    animation: swapRotate 0.4s ease;
}

.swap-icon svg {
    stroke: var(--text-muted);
    filter: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ========================
   Instructions Section
   ======================== */

.bangla-calendar-widget,
.live-clock-widget {
    background: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none !important;
    padding: 6px 10px;
    border-radius: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none !important;
    white-space: nowrap;
}

.live-clock-widget {
    cursor: default;
    background: transparent;
}

.calendar-icon,
.clock-icon {
    font-size: 1.1rem;
}

#bengaliDateDisplay,
#currentTimeDisplay {
    font-weight: 600;
    color: var(--primary-color) !important;
    font-size: 0.95rem;
}

.instructions {
    background: var(--bg-card);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.8s ease 0.6s both;
}

.instructions h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    text-shadow: none;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.instruction-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.instruction-box:hover {
    background: var(--bg-secondary);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
}

.instruction-box h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
    text-shadow: none;
}

.instruction-box ol {
    padding-left: var(--spacing-lg);
    color: var(--text-muted);
}

.instruction-box li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.instruction-box li:last-child {
    margin-bottom: 0;
}

/* ========================
   Toast Notification
   ======================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success-gradient);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    font-size: 1rem;
    opacity: 0;
    transform: translateY(100px);
    transition: all var(--transition-normal);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================
   Footer
   ======================== */

.footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    animation: fadeInUp 0.8s ease 0.8s both;
    text-shadow: none;
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

.footer p {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 4px;
    margin-bottom: var(--spacing-md);
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.footer-links a {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    text-shadow: none;
}

.footer-links a:hover {
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.08);
    text-decoration: underline;
    text-underline-offset: 3px;
    transform: translateY(-1px);
}

.footer-separator {
    color: var(--text-muted);
    font-size: 0.7rem;
    user-select: none;
}

.copyright {
    font-family: var(--font-english);
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-sm);
    color: var(--text-muted);
}

/* ========================
   Responsive Design
   ======================== */

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
    .mobile-menu {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .mobile-nav-links {
        padding-bottom: var(--spacing-lg);
    }

    .container {
        margin-top: 70px;
    }

    .info-section {
        border-radius: var(--radius-md);
    }

    .converter-box {
        border-radius: var(--radius-md);
    }

    .fullscreen-mode {
        padding: var(--spacing-sm);
    }

    .fullscreen-mode .text-area {
        height: calc(100vh - 250px) !important;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .text-area {
        height: 120px !important;
    }

    .converter-box {
        padding: var(--spacing-xs);
    }

    .info-section {
        padding: 0.6rem 0.5rem;
    }

    .nav-container {
        padding: 0.3rem var(--spacing-sm);
    }

    .container {
        margin-top: 60px;
    }
}

/* Touch device optimizations - only for screens wider than 400px */
@media (hover: none) and (pointer: coarse) and (min-width: 400px) {

    .copy-btn,
    .clear-btn,
    .convert-action-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .radio-option {
        min-height: 44px;
        padding: 0.5rem 0.8rem;
    }

    .control-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .toggle-info-btn {
        min-height: 36px;
        padding: 0.3rem 0.7rem;
    }

    .share-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
        padding: 0.7rem 1rem;
    }
}

/* ========================
   Utility Classes
   ======================== */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* ========================
   Calendar Modal
   ======================== */

.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 1rem;
}

.calendar-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    max-height: 90vh;
    overflow-y: auto;
}

.calendar-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    background: var(--primary-gradient);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-family: var(--font-bengali);
}

.close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: var(--spacing-md);
    background: #f7fafc;
}

.current-date-large {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-family: var(--font-bengali);
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
    font-family: var(--font-bengali);
}

.calendar-day-name {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.calendar-date {
    background: #fff;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
    min-height: 55px;
    justify-content: center;
}

.calendar-date:hover {
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.calendar-date .bn-num {
    font-weight: 700;
    color: var(--text-dark);
}

.calendar-date .en-num {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
}

.calendar-date.today {
    background: var(--primary-color) !important;
    border-color: var(--primary-color);
}

.calendar-date.today .bn-num,
.calendar-date.today .en-num {
    color: #fff !important;
    opacity: 1;
}

.calendar-day-name.holiday {
    color: #e53e3e;
    font-weight: 700;
}

.calendar-date.holiday {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
}

.calendar-date.holiday .bn-num {
    color: #c53030;
}

/* Tooltip Styling */
.modal-body {
    position: relative;
    /* Essential for tooltip positioning */
}

.calendar-tooltip {
    position: absolute;
    bottom: auto;
    /* Ensure bottom doesn't conflict with top */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    /* Initial state */
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    /* Ensure it's above everything */
    width: max-content;
    max-width: 250px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #166534;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-tooltip.active {
    opacity: 1;
    transform: translateX(-50%) translateY(-115%);
    /* Shift above the top coordinate */
}

.calendar-tooltip .tt-bn {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    color: #166534;
}

.calendar-tooltip .tt-en {
    font-size: 0.85rem;
    display: block;
    color: #3f6212;
    opacity: 0.9;
}

/* Calendar Modal Responsive */
@media (max-width: 480px) {
    .calendar-modal {
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
        max-width: 100%;
    }

    .modal-header {
        padding: var(--spacing-sm);
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .close-modal {
        font-size: 1.3rem;
        min-width: 40px;
        min-height: 40px;
    }

    .modal-body {
        padding: var(--spacing-sm);
    }

    .current-date-large {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-sm);
    }

    .calendar-grid {
        gap: 6px;
    }

    .calendar-day-name {
        font-size: 0.75rem;
    }

    .calendar-date {
        padding: 4px 2px;
        min-height: 45px;
        font-size: 0.95rem;
    }

    .calendar-date .bn-num {
        font-size: 0.9rem;
    }

    .calendar-date .en-num {
        font-size: 0.65rem;
    }

    .calendar-tooltip {
        padding: 10px 14px;
        max-width: 200px;
    }

    .calendar-tooltip .tt-bn {
        font-size: 0.9rem;
    }

    .calendar-tooltip .tt-en {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .calendar-modal {
        padding: 0.3rem;
    }

    .modal-content {
        width: 98%;
    }

    .modal-header {
        padding: 0.6rem;
    }

    .modal-header h3 {
        font-size: 0.9rem;
    }

    .close-modal {
        font-size: 1.2rem;
        min-width: 36px;
        min-height: 36px;
    }

    .modal-body {
        padding: 0.6rem;
    }

    .current-date-large {
        font-size: 1rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day-name {
        font-size: 0.7rem;
    }

    .calendar-date {
        padding: 3px 1px;
        min-height: 40px;
        font-size: 0.85rem;
    }

    .calendar-date .bn-num {
        font-size: 0.8rem;
    }

    .calendar-date .en-num {
        font-size: 0.6rem;
    }

    .calendar-tooltip {
        padding: 8px 12px;
        max-width: 180px;
    }

    .calendar-tooltip .tt-bn {
        font-size: 0.8rem;
    }

    .calendar-tooltip .tt-en {
        font-size: 0.7rem;
    }
}

/* Dark Mode Modal Overrides */
body.dark-mode .calendar-day-name.holiday {
    color: #fc8181;
}

body.dark-mode .calendar-date.holiday {
    background-color: rgba(229, 62, 62, 0.2);
    color: #fc8181;
    border-color: rgba(229, 62, 62, 0.3);
}

body.dark-mode .modal-content {
    background: #1a202c;
    border: 1px solid var(--glass-border);
}

body.dark-mode .modal-body {
    background: #171923;
}

body.dark-mode .current-date-large {
    color: #38bdf8;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .calendar-date {
    background: #2d3748;
}

body.dark-mode #bengaliDateDisplay,
body.dark-mode #currentTimeDisplay {
    color: #00e676 !important;
}

body.dark-mode .calendar-date .en-num {
    color: #a0aec0;
}

body.dark-mode .calendar-date:hover {
    background: #364152;
}

body.dark-mode .calendar-date.today {
    background: var(--primary-color) !important;
}

body.dark-mode .calendar-date.today .bn-num,
body.dark-mode .calendar-date.today .en-num {
    color: #fff !important;
}

body.dark-mode .calendar-tooltip {
    background: #064e3b;
    border-color: #059669;
    color: #ecfdf5;
}

body.dark-mode .calendar-tooltip .tt-bn,
body.dark-mode .calendar-tooltip .tt-en {
    color: #ecfdf5;
}

/* Enhanced Global Dark Mode */
body.dark-mode {
    background-color: var(--bg-primary) !important;
    color: var(--text-dark);
}

body.dark-mode .background-animation {
    background: var(--bg-primary);
    background-image: none;
}

body.dark-mode .background-animation::before,
body.dark-mode .background-animation::after {
    opacity: 0.05;
    background: var(--primary-color);
}

body.dark-mode .navbar {
    background: #292a2d;
    border-bottom-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .mobile-menu-toggle span {
    background-color: var(--text-dark);
}

body.dark-mode .nav-link {
    color: var(--text-muted);
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    color: var(--primary-color);
    background: rgba(138, 180, 248, 0.08);
}

body.dark-mode .control-btn {
    color: var(--text-muted);
    border-color: var(--border-color);
}

body.dark-mode .control-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(138, 180, 248, 0.08);
}

body.dark-mode .description,
body.dark-mode .converter-box,
body.dark-mode .instruction-box {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .instructions {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .input-mode-section {
    background: transparent;
}

body.dark-mode .radio-option {
    background: transparent;
    border-color: var(--border-color);
}

body.dark-mode .radio-option:hover {
    background: rgba(138, 180, 248, 0.08);
}

body.dark-mode .input-mode-hint {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

body.dark-mode .footer {
    border-top-color: var(--border-color);
    color: var(--text-muted);
}

body.dark-mode .footer-links {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .footer-links a {
    color: var(--primary-color);
}

body.dark-mode .share-dropdown {
    background: #292a2d;
    border-color: var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .share-dropdown-item {
    color: var(--text-dark);
}

body.dark-mode .share-dropdown-item:hover {
    background: var(--primary-color);
    color: white;
}

body.dark-mode .copy-btn,
body.dark-mode .clear-btn {
    background: #303134;
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-mode .clear-btn {
    color: #f28b82;
    background: rgba(242, 139, 130, 0.1);
    border-color: rgba(242, 139, 130, 0.3);
}

body.dark-mode .fullscreen-btn.rectangular-btn {
    background: #303134;
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-mode .swap-icon {
    background: #303134;
    border-color: var(--border-color);
    color: var(--text-muted);
}

body.dark-mode .swap-icon svg {
    stroke: var(--text-muted);
}

body.dark-mode .swap-icon:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(138, 180, 248, 0.08);
}

body.dark-mode .toggle-info-btn {
    background: #303134;
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-mode .info-content::after {
    background: linear-gradient(to bottom, transparent, var(--bg-card));
}

body.dark-mode .mobile-menu {
    background: linear-gradient(180deg, #292a2d 0%, #1f1f1f 100%);
}

body.dark-mode .smart-features-bar {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .connection-status {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .convert-action-btn.secondary-action {
    background: #303134;
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-mode .bijoy-output {
    background: #303134;
    color: #e8eaed;
}

/* Comments Section - See end of file for enhanced version */

body.dark-mode .comments-container {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .comments-section h2 {
    color: var(--text-dark);
}

/* Info Section Specific Header */
.info-section .main-title {
    color: var(--text-dark) !important;
    text-shadow: none;
}

.info-section .subtitle {
    color: var(--text-muted) !important;
    text-shadow: none;
}

.info-section .feature-title {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    text-align: center;
}

.info-section .feature-list {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.info-section .feature-list li {
    width: 100%;
    /* Full width */
    text-align: left;
    /* Left align */
}

.edu-content {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    width: 100%;
}

.edu-content h2,
.edu-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    text-align: center;
    text-shadow: none;
    font-size: 1.3rem;
}

.edu-content p,
.edu-content ul {
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.edu-content ul {
    padding-left: 20px;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.internal-collapse {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* Info Section Styles */
.info-section {
    padding: 1.5rem 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.info-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.title-group {
    width: 100%;
    box-sizing: border-box;
}

.title-group .main-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.title-group .subtitle {
    font-size: 1rem;
    font-family: var(--font-english);
    display: block;
    margin-top: 0.3rem;
    opacity: 0.95;
}

/* Social Share */
.share-widget {
    display: none !important;
    /* Hidden - moved to navbar */
}

.share-label {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.share-icons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.share-btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.share-btn.fb {
    background: #3b5998;
}

.share-btn.tw {
    background: #1DA1F2;
}

.share-btn.li {
    background: #0077b5;
}

.share-btn.em {
    background: #7f7f7f;
}

/* Info Content & Toggle */
.info-content {
    max-height: 150px;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.4s ease;
    opacity: 1;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    text-align: center;
}

/* Fade effect at bottom when collapsed */
.info-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.info-content.expanded::after {
    opacity: 0;
    /* Hide fade when expanded */
}

.info-content.expanded {
    max-height: 2000px;
    opacity: 1;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.info-text-wrapper p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: center;
    width: 100%;
    /* Full width */
    padding: 0;
    /* Remove padding */
}

/* Hide internal collapse button */
.internal-collapse {
    display: none !important;
}

.info-controls {
    display: flex;
    justify-content: flex-end;
    /* Right align */
    margin-top: 0.8rem;
    padding-right: 0;
    /* Remove extra padding */
}

.toggle-info-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    backdrop-filter: none;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.1);
}

.secondary-toggle {
    border-color: var(--border-color);
    color: var(--text-dark);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    padding: 0.6rem 1.5rem;
}

.secondary-toggle:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.toggle-info-btn:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
}

.toggle-svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Removed rotation class as we are swapping icons now */

/* ========================
   Tool Page Custom Styles 
   ======================== */

.tool-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

.tool-section.tool-fullwidth {
    max-width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
}

/* Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    background: var(--bg-secondary);
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse-dot 1.5s infinite;
}

.connection-status.connected .status-dot {
    background: #22c55e;
    animation: none;
}

.connection-status.disconnected .status-dot {
    background: #ef4444;
    animation: none;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Text Stats Bar */
.text-stats {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-bengali);
    align-items: center;
}

.text-stats .stat-item strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Shortcut Hint */
.shortcut-hint {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-family: var(--font-primary);
}

/* Smart Features Info Bar */
.smart-features-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: var(--spacing-lg);
    padding: 0.8rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-bengali);
}

.feature-icon {
    font-size: 1rem;
}

.tool-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
}

.tool-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-family: var(--font-bengali);
}

.tool-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.tool-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.converter-box.single-box {
    width: 100%;
    margin-bottom: 0;
}

.tool-actions {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.primary-action {
    background: var(--success-gradient);
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.primary-action:hover {
    transform: translateY(-3px) scale(1.02);
}

.readonly-output {
    cursor: default;
}

body.dark-mode .readonly-output {
    cursor: default;
}

/* Tool Page Responsive */
@media (max-width: 768px) {

    .tool-section,
    .tool-section.tool-fullwidth {
        padding: var(--spacing-sm) 0;
    }

    .tool-header {
        padding: var(--spacing-md);
    }

    .tool-header h1 {
        font-size: 1.8rem;
    }

    .tool-subtitle {
        font-size: 0.95rem;
    }

    .primary-action {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.5rem;
    }

    .tool-subtitle {
        font-size: 0.85rem;
    }

    .primary-action {
        padding: 0.9rem;
        font-size: 1rem;
    }
}

@media (max-width: 360px) {

    .tool-section,
    .tool-section.tool-fullwidth {
        padding: 0;
    }

    .tool-header {
        padding: var(--spacing-sm);
    }

    .tool-header h1 {
        font-size: 1.3rem;
    }

    .tool-subtitle {
        font-size: 0.75rem;
    }

    .primary-action {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}


/* ========================
   Instructions Section
   ======================== */

.instructions-section {
    padding: var(--spacing-sm) var(--spacing-lg);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

.instructions-section h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-bengali);
    text-shadow: none;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.instruction-box {
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: left;
    transition: transform 0.3s ease;
    background: var(--bg-secondary);
}

.instruction-box:hover {
    transform: translateY(-5px);
}

.instruction-box h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    font-family: var(--font-bengali);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    text-shadow: none;
}

.step-list {
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.step-list li {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-family: var(--font-bengali);
}

.step-list li::marker {
    color: var(--secondary-color);
    font-weight: 700;
}

/* Instructions Responsive */
@media (max-width: 768px) {
    .instructions-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .instructions-section h2 {
        font-size: 1.8rem;
    }

    .instructions-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .instruction-box {
        padding: var(--spacing-md);
    }

    .instruction-box h3 {
        font-size: 1.1rem;
    }

    .step-list li {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
}

@media (max-width: 480px) {
    .instructions-section {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .instructions-section h2 {
        font-size: 1.5rem;
    }

    .instruction-box {
        padding: var(--spacing-sm);
    }

    .instruction-box h3 {
        font-size: 1rem;
    }

    .step-list {
        padding-left: 1rem;
    }

    .step-list li {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }
}

@media (max-width: 360px) {
    .instructions-section {
        padding: var(--spacing-sm) 0.5rem;
    }

    .instructions-section h2 {
        font-size: 1.3rem;
        margin-bottom: var(--spacing-md);
    }

    .instruction-box {
        padding: 0.6rem;
    }

    .instruction-box h3 {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .step-list {
        padding-left: 0.8rem;
    }

    .step-list li {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
}

/* ========================
   Comments Section
   ======================== */

.comments-section {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.comments-section h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-family: var(--font-bengali);
    text-shadow: none;
}

.comments-section .section-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-family: var(--font-bengali);
    text-shadow: none;
}

.comments-container {
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
}

.comments-container:hover {
    transform: translateY(-5px);
}

/* Skeleton Loader Styles */
.comments-skeleton {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: pulse 1.5s infinite ease-in-out;
    background: transparent;
    z-index: 5;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 50%;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.long {
    width: 90%;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Hide skeleton when FB is loaded */
.fb-comments[fb-xfbml-state="rendered"]+#fb-skeleton {
    display: none !important;
}

/* ===== Custom Comment System ===== */
.comment-form-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.comment-form-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.comment-form-header .form-icon {
    font-size: 1.8rem;
}

.comment-form-header h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-family: var(--font-bengali);
    margin: 0;
}

.form-group {
    margin-bottom: 0.8rem;
    position: relative;
}

.comment-input,
.comment-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-dark);
    font-size: 1rem;
    font-family: var(--font-bengali);
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.comment-input:focus,
.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.comment-input::placeholder,
.comment-textarea::placeholder {
    color: var(--text-muted);
    font-family: var(--font-bengali);
}

.comment-textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-bengali);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.comment-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.comment-status {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-bengali);
    font-size: 0.95rem;
    animation: fadeIn 0.3s;
}

.comment-status.success {
    background: rgba(72, 199, 142, 0.2);
    color: #48c78e;
    border: 1px solid rgba(72, 199, 142, 0.3);
}

.comment-status.error {
    background: rgba(241, 70, 104, 0.2);
    color: #f14668;
    border: 1px solid rgba(241, 70, 104, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comments List */
.comments-list-wrapper {
    text-align: left;
}

.comments-list-header h3 {
    color: var(--text-light);
    font-family: var(--font-bengali);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 800px;
    overflow-y: auto;
    padding-right: 4px;
}

.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: transform 0.2s;
    animation: fadeIn 0.4s;
}

.comment-item:hover {
    transform: translateY(-2px);
}

.comment-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comment-author {
    color: var(--text-dark);
    font-size: 1rem;
    font-family: var(--font-bengali);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: var(--font-bengali);
    margin: 0;
    word-wrap: break-word;
}

/* Empty state */
.empty-comments {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-family: var(--font-bengali);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* Loading spinner */
.comments-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-family: var(--font-bengali);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Light mode overrides */
body:not(.dark-mode) .comment-input,
body:not(.dark-mode) .comment-textarea {
    background: var(--bg-secondary);
    color: var(--text-dark);
}

/* Dark Mode Overrides for Comments */
body.dark-mode .comments-section .section-desc {
    color: var(--text-muted);
}

body.dark-mode .fb-comments {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Force FB Iframe to be 100% width and visible */
.fb-comments,
.fb-comments span,
.fb-comments iframe[style] {
    width: 100% !important;
}

body.dark-mode .skeleton-avatar,
body.dark-mode .skeleton-line {
    background: rgba(255, 255, 255, 0.1);
}

/* Text visibility in Light mode - clean dark text on white */
body:not(.dark-mode) .comments-section h2,
body:not(.dark-mode) .tool-header h1 {
    color: var(--text-dark);
    text-shadow: none;
}

body:not(.dark-mode) .comments-section .section-desc,
body:not(.dark-mode) .tool-subtitle {
    color: var(--text-muted);
    text-shadow: none;
}

/* Comments Responsive */
@media (max-width: 768px) {
    .comments-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .comments-section h2 {
        font-size: 1.8rem;
    }

    .comments-section .section-desc {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-lg);
    }

    .comments-container {
        padding: 1.5rem;
    }

    .comments-skeleton {
        top: 1.5rem;
        left: 1.5rem;
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .comments-section {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .comments-section h2 {
        font-size: 1.5rem;
    }

    .comments-section .section-desc {
        font-size: 0.85rem;
    }

    .comments-container {
        padding: 1rem;
    }

    .comments-skeleton {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        gap: 10px;
    }

    .skeleton-avatar {
        width: 32px;
        height: 32px;
    }

    .skeleton-line {
        height: 10px;
    }
}

@media (max-width: 360px) {
    .comments-section {
        padding: var(--spacing-sm) 0.5rem;
    }

    .comments-section h2 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .comments-section .section-desc {
        font-size: 0.75rem;
        margin-bottom: var(--spacing-md);
    }

    .comments-container {
        padding: 0.8rem;
    }

    .comments-skeleton {
        top: 0.8rem;
        left: 0.8rem;
        right: 0.8rem;
        bottom: 0.8rem;
        gap: 8px;
    }

    .skeleton-avatar {
        width: 28px;
        height: 28px;
    }

    .skeleton-line {
        height: 8px;
    }
}


/* ========================
   ENHANCED RESPONSIVE FIXES FOR ALL DEVICES
   ======================== */

/* Galaxy Fold & Ultra Small Devices (280px - 344px) */
@media (max-width: 344px) {
    * {
        box-sizing: border-box;
    }

    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0.4rem !important;
        margin-top: 58px !important;
        width: 100%;
        max-width: 100%;
    }

    .nav-container {
        padding: 0.6rem 0.8rem !important;
        min-height: 56px !important;
    }

    .logo-icon {
        font-size: 1.2rem !important;
    }

    .logo-main {
        font-size: 0.95rem !important;
    }

    .control-btn {
        width: 30px !important;
        height: 30px !important;
    }

    .control-btn svg {
        width: 15px !important;
        height: 15px !important;
    }

    .lang-text {
        font-size: 0.65rem !important;
    }

    /* Info Section */
    .info-section {
        padding: 0.5rem 0.4rem !important;
        margin-bottom: 0.8rem !important;
        width: 100%;
    }

    .info-header {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .title-group .main-title {
        font-size: 1rem !important;
        line-height: 1.25 !important;
    }

    .title-group .subtitle {
        font-size: 0.65rem !important;
    }

    .share-widget {
        padding: 0.35rem 0.5rem !important;
        width: 100%;
        justify-content: center;
    }

    .share-label {
        font-size: 0.65rem !important;
    }

    .share-icons {
        gap: 0.3rem !important;
    }

    .share-btn {
        width: 26px !important;
        height: 26px !important;
    }

    .share-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    .toggle-info-btn {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.6rem !important;
    }

    /* Converter boxes */
    .converter-grid {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    .converter-box {
        padding: 0.4rem !important;
        margin-bottom: 0.8rem !important;
        width: 100%;
    }

    .box-header {
        gap: 0.25rem !important;
        margin-bottom: 0.35rem !important;
        flex-wrap: nowrap;
    }

    .box-header h2 {
        font-size: 0.8rem !important;
        flex: 1;
    }

    .box-actions {
        gap: 0.25rem !important;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.2rem 0.3rem !important;
        font-size: 0.6rem !important;
    }

    .copy-btn span {
        display: none !important;
    }

    .copy-btn svg,
    .clear-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Textarea */
    .textarea-wrapper {
        width: 100%;
    }

    .text-area {
        height: 120px !important;
        font-size: 0.7rem !important;
        padding: 0.35rem !important;
        margin-bottom: 0.4rem !important;
        width: 100%;
    }

    /* Input modes - 2 columns */
    .input-mode-section {
        padding: 0.25rem 0.35rem !important;
        margin-bottom: 0.4rem !important;
        width: 100%;
    }

    .input-mode-title {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
    }

    .input-mode-options {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.2rem !important;
        width: 100%;
    }

    .radio-option {
        padding: 0.25rem 0.35rem !important;
        font-size: 0.6rem !important;
        width: 100%;
    }

    .radio-option input[type="radio"] {
        width: 11px !important;
        height: 11px !important;
    }

    .input-mode-hint {
        font-size: 0.6rem !important;
        margin-top: 0.25rem !important;
        line-height: 1.3 !important;
    }

    /* Center controls */
    .center-controls {
        gap: 0.3rem !important;
        margin: 0.4rem 0 !important;
        flex-direction: column;
        align-items: center;
    }

    .swap-icon {
        padding: 0.2rem !important;
    }

    .swap-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .conversion-buttons {
        gap: 0.25rem !important;
        flex-direction: column !important;
        width: 100%;
        align-items: center;
    }

    .convert-action-btn {
        padding: 4px 10px !important;
        font-size: 0.65rem !important;
        white-space: nowrap !important;
    }

    .convert-action-btn svg {
        width: 13px !important;
        height: 13px !important;
    }

    /* Instructions */
    .instructions-grid {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .instructions-section {
        padding: 0.8rem 0.4rem !important;
    }

    .instructions-section h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.6rem !important;
    }

    .instruction-box {
        padding: 0.6rem !important;
        margin-bottom: 0.6rem !important;
    }

    .instruction-box h3 {
        font-size: 0.85rem !important;
        margin-bottom: 0.4rem !important;
    }

    .step-list {
        padding-left: 1.2rem;
    }

    .step-list li {
        font-size: 0.7rem !important;
        margin-bottom: 0.35rem !important;
        line-height: 1.4 !important;
    }

    /* Footer */
    .footer {
        padding: 0.8rem 0.4rem !important;
    }

    .footer p {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
    }

    .copyright {
        font-size: 0.6rem !important;
    }

    /* Toast */
    .toast {
        left: 6px !important;
        right: 6px !important;
        bottom: 6px !important;
        padding: 0.5rem 0.6rem !important;
        font-size: 0.75rem !important;
    }

    /* Fullscreen button */
    .fullscreen-btn {
        width: 28px !important;
        height: 28px !important;
    }

    .fullscreen-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Comments section */
    .comments-section {
        padding: 0.6rem 0.3rem !important;
    }

    .comments-section h2 {
        font-size: 1rem !important;
    }

    .section-desc {
        font-size: 0.65rem !important;
    }

    .comments-container {
        width: 100%;
    }
}

/* Galaxy Fold Specific (280px width) */
@media (max-width: 280px) {
    .container {
        padding: 0.3rem !important;
        margin-top: 56px !important;
    }

    .nav-container {
        padding: 0.5rem 0.6rem !important;
        min-height: 54px !important;
    }

    .logo-icon {
        font-size: 1.1rem !important;
    }

    .logo-main {
        font-size: 0.9rem !important;
    }

    .control-btn {
        width: 28px !important;
        height: 28px !important;
    }

    .control-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .nav-controls {
        gap: 0.4rem !important;
    }

    /* Info section - Ultra compact */
    .info-section {
        padding: 0.4rem 0.3rem !important;
        margin-bottom: 0.6rem !important;
    }

    .title-group .main-title {
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
    }

    .title-group .subtitle {
        font-size: 0.6rem !important;
    }

    .share-widget {
        padding: 0.3rem 0.4rem !important;
    }

    .share-label {
        font-size: 0.6rem !important;
    }

    .share-btn {
        width: 24px !important;
        height: 24px !important;
    }

    .share-btn svg {
        width: 11px !important;
        height: 11px !important;
    }

    /* Converter */
    .converter-box {
        padding: 0.35rem !important;
        margin-bottom: 0.6rem !important;
    }

    .box-header {
        gap: 0.2rem !important;
        margin-bottom: 0.3rem !important;
    }

    .box-header h2 {
        font-size: 0.75rem !important;
    }

    .copy-btn,
    .clear-btn {
        padding: 0.18rem 0.25rem !important;
        font-size: 0.55rem !important;
    }

    .copy-btn svg,
    .clear-btn svg {
        width: 13px !important;
        height: 13px !important;
    }

    /* Textarea */
    .text-area {
        height: 110px !important;
        font-size: 0.65rem !important;
        padding: 0.3rem !important;
        margin-bottom: 0.35rem !important;
    }

    /* Input modes */
    .input-mode-section {
        padding: 0.2rem 0.3rem !important;
        margin-bottom: 0.35rem !important;
    }

    .input-mode-title {
        font-size: 0.6rem !important;
        margin-bottom: 0.2rem !important;
    }

    .input-mode-options {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.18rem !important;
    }

    .radio-option {
        padding: 0.2rem 0.3rem !important;
        font-size: 0.55rem !important;
    }

    .radio-option input[type="radio"] {
        width: 10px !important;
        height: 10px !important;
    }

    .input-mode-hint {
        font-size: 0.55rem !important;
        margin-top: 0.2rem !important;
        line-height: 1.25 !important;
    }

    /* Center controls */
    .center-controls {
        gap: 0.25rem !important;
        margin: 0.35rem 0 !important;
    }

    .swap-icon {
        padding: 0.18rem !important;
    }

    .swap-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .conversion-buttons {
        gap: 0.2rem !important;
        flex-direction: column !important;
    }

    .convert-action-btn {
        font-size: 0.75rem !important;
        padding: 0.45rem 1rem !important;
        white-space: nowrap !important;
        border-radius: 50px !important;
        gap: 4px !important;
        flex: 0 1 auto !important;
        /* Don't stretch */
        max-width: none !important;
    }

    .convert-action-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* Instructions */
    .instructions-section {
        padding: 0.6rem 0.3rem !important;
    }

    .instructions-section h2 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .instruction-box {
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .instruction-box h3 {
        font-size: 0.8rem !important;
        margin-bottom: 0.35rem !important;
    }

    .step-list {
        padding-left: 1.2rem;
    }

    .step-list li {
        font-size: 0.65rem !important;
        margin-bottom: 0.3rem !important;
        line-height: 1.35 !important;
    }

    /* Footer */
    .footer {
        padding: 0.6rem 0.3rem !important;
    }

    .footer p {
        font-size: 0.65rem !important;
        line-height: 1.35 !important;
    }

    .copyright {
        font-size: 0.55rem !important;
    }

    /* Toast */
    .toast {
        left: 5px !important;
        right: 5px !important;
        bottom: 5px !important;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    /* Fullscreen button */
    .fullscreen-btn {
        width: 26px !important;
        height: 26px !important;
    }

    .fullscreen-btn svg {
        width: 13px !important;
        height: 13px !important;
    }
}

/* Pixel 4 & Similar (353px - 360px) */
@media (min-width: 345px) and (max-width: 360px) {
    .container {
        padding: 0.5rem !important;
        margin-top: 60px !important;
    }

    .converter-box {
        padding: 0.5rem !important;
    }

    .text-area {
        height: 130px !important;
        font-size: 0.75rem !important;
    }

    .input-mode-options {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.25rem !important;
    }

    .radio-option {
        font-size: 0.65rem !important;
        padding: 0.3rem 0.4rem !important;
    }

    .convert-action-btn {
        max-width: 135px !important;
        font-size: 0.7rem !important;
    }
}

/* Galaxy S9+ & Similar (320px - 344px) */
@media (min-width: 321px) and (max-width: 344px) {
    .input-mode-options {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.2rem !important;
    }

    .radio-option {
        font-size: 0.6rem !important;
        padding: 0.25rem 0.35rem !important;
    }

    .text-area {
        height: 120px !important;
        font-size: 0.7rem !important;
    }
}

/* Ensure proper box-sizing for all elements */
@media (max-width: 767px) {

    *,
    *::before,
    *::after {
        box-sizing: border-box !important;
    }

    body {
        overflow-x: hidden !important;
    }

    .container,
    .main-content,
    .converter-section,
    .converter-grid,
    .converter-box,
    .box-header,
    .box-actions,
    .textarea-wrapper,
    .text-area,
    .input-mode-section,
    .input-mode-options,
    .radio-option,
    .info-section,
    .info-header,
    .info-content,
    .info-text-wrapper,
    .title-group,
    .info-controls,
    .instructions-section,
    .instructions-grid,
    .instruction-box,
    .comments-section,
    .comments-container,
    .center-controls,
    .conversion-buttons {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Prevent horizontal overflow */
    .converter-grid,
    .info-section,
    .instructions-section,
    .comments-section,
    .converter-box {
        overflow-x: hidden !important;
    }

    /* Reset touch target sizes for small screens */
    .copy-btn,
    .clear-btn,
    .convert-action-btn,
    .radio-option,
    .control-btn,
    .toggle-info-btn,
    .share-btn {
        min-height: unset !important;
        min-width: unset !important;
    }

    /* Box header must wrap buttons if needed */
    .box-header {
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }

    .box-header h2 {
        flex-shrink: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .box-actions {
        flex-shrink: 0 !important;
        width: auto !important;
    }

    /* Center controls - don't force full width */
    .center-controls {
        overflow: visible !important;
    }

    .conversion-buttons {
        overflow: visible !important;
    }

    .convert-action-btn {
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }
}

/* ========================
   Tool Page Styles
   ======================== */

.tool-section {
    padding: var(--spacing-lg) 0;
}

.tool-fullwidth {
    max-width: 100%;
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
}

.tool-header {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}


/* Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse-dot 1.5s infinite;
}

.connection-status.connected .status-dot {
    background: #34d399;
    animation: none;
}

.connection-status.disconnected .status-dot {
    background: #f87171;
    animation: none;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Tool Container - vertical layout */
.tool-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.tool-container .converter-box.single-box {
    width: 100%;
    max-width: 100%;
}

/* Tool Actions Bar */
.tool-actions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.convert-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.8rem 1.5rem;
    background-color: #2f4f2f;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-bengali);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(47, 79, 47, 0.4);
}

.convert-action-btn:hover {
    background-color: #3b633b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 79, 47, 0.6);
}

.convert-action-btn:active {
    background-color: #243c24;
    transform: translateY(0);
}

.convert-action-btn svg {
    stroke: currentColor;
}

/* Text Stats */
.text-stats {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stat-item strong {
    color: var(--text-dark);
}

/* Real-time Toggle */
.realtime-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}

.realtime-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2); /* Darker for light mode visibility */
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
}

body.dark-mode .toggle-slider {
    background: rgba(255, 255, 255, 0.2); /* Lighter for dark mode visibility */
    border: 1px solid rgba(255,255,255,0.1);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.realtime-toggle input:checked+.toggle-slider {
    background: #34d399;
}

.realtime-toggle input:checked+.toggle-slider::after {
    transform: translateX(14px);
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-bengali);
}

/* Smart Features Bar */
.smart-features-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-sm);
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.feature-icon {
    font-size: 0.85rem;
}

/* Fullscreen button in header (tool page) */
.tool-fullscreen-btn {
    position: static;
    opacity: 0.8;
    width: auto;
    height: auto;
    padding: 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
}

.tool-fullscreen-btn:hover {
    background: var(--border-color);
    opacity: 1;
}

/* Converter Info Section */
.converter-info {
    margin-top: var(--spacing-md);
}

.converter-info-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-bengali);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.converter-info-toggle:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
}

.info-toggle-icon {
    display: flex;
    align-items: center;
}

.info-toggle-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.info-toggle-arrow.open {
    transform: rotate(180deg);
}

.converter-info-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.converter-info-content.open {
    max-height: 2000px;
    opacity: 1;
    margin-top: var(--spacing-md);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    text-align: left;
}

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: all var(--transition-fast);
}

.info-card:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
}

.info-card-icon {
    font-size: 1.6rem;
    margin-bottom: var(--spacing-xs);
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-bengali);
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-family: var(--font-bengali);
    margin: 0;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card ul li {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-family: var(--font-bengali);
    padding-left: 1rem;
    position: relative;
}

.info-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
}

.info-card ul li strong {
    color: var(--text-dark);
}

/* Hide tool-specific elements in fullscreen */
body.has-fullscreen .converter-info,
body.has-fullscreen .tool-actions-bar,
body.has-fullscreen .smart-features-bar {
    display: none !important;
}

/* Tool page responsive */
@media (max-width: 768px) {
    .tool-fullwidth {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .realtime-toggle .toggle-label {
        display: none;
    }

    .convert-action-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Long Form SEO Article Styling */
.seo-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    color: var(--text-dark);
    font-family: var(--font-bengali);
}

.seo-article h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.seo-article h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.seo-article p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.seo-article ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin-bottom: var(--spacing-lg);
}

.seo-article li {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.seo-article .faq-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid var(--primary-color);
}

.seo-article .faq-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
}

.seo-article .faq-item p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .seo-article {
        padding: var(--spacing-md);
    }

    .seo-article h2 {
        font-size: 1.5rem;
    }

    .seo-article h3 {
        font-size: 1.2rem;
    }
}

/* ========================
   Mobile Performance Optimizations
   Only affects mobile - desktop remains unchanged
   ======================== */

/* Reduce background animation complexity on mobile */
@media (max-width: 768px) {

    .background-animation::before,
    .background-animation::after {
        animation: none !important;
        filter: blur(60px);
        width: 300px;
        height: 300px;
    }

    .background-animation {
        background-size: 200% 200%;
        animation: gradientShift 30s ease infinite;
    }

    /* Reduce transition durations on mobile */
    .converter-box,
    .instruction-box,
    .share-btn,
    .seo-card,
    .info-card {
        transition-duration: 0.15s !important;
    }

    /* Disable hover transforms on mobile (no hover on touch) */
    .instruction-box:hover,
    .seo-card:hover,
    .info-card:hover {
        transform: none !important;
    }
}

/* Further reduce on very small screens */
@media (max-width: 480px) {

    .background-animation::before,
    .background-animation::after {
        display: none !important;
    }

    .background-animation {
        animation-duration: 45s;
    }
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .background-animation,
    .background-animation::before,
    .background-animation::after {
        animation: none !important;
        transition: none !important;
    }

    .background-animation::before,
    .background-animation::after {
        display: none !important;
    }

    .converter-box,
    .instruction-box,
    .share-btn,
    .seo-card,
    .info-card,
    .navbar,
    .nav-links a,
    .btn,
    .primary-action {
        transition: none !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}


/* ========================
   PWA Install Banner (Desktop Only)
   ======================== */

.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.3);
    display: none;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.pwa-install-banner.show {
    opacity: 1;
    transform: translateY(0);
}

.pwa-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.pwa-banner-content {
    flex: 1;
}

.pwa-banner-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    font-family: var(--font-bengali);
}

.pwa-banner-text {
    font-size: 0.9rem;
    opacity: 0.95;
    font-family: var(--font-bengali);
}

.pwa-banner-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pwa-install-btn {
    background: white;
    color: #0ea5e9;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: var(--font-bengali);
}

.pwa-install-btn:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pwa-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hide on mobile and tablet */
@media (max-width: 1023px) {
    .pwa-install-banner {
        display: none !important;
    }
}

/* Responsive adjustments for smaller desktops */
@media (max-width: 1280px) {
    .pwa-install-banner {
        max-width: 350px;
        padding: 1rem 1.2rem;
    }

    .pwa-banner-title {
        font-size: 1rem;
    }

    .pwa-banner-text {
        font-size: 0.85rem;
    }

    .pwa-install-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========================
   HOMEPAGE CLARITY & DESIGN IMPROVEMENTS
   ======================== */

/* 1. Make Title/Header text clearer and more distinct */
.title-group .main-title {
    font-weight: 800;
    text-shadow: 0 2px 4px var(--shadow-color);
    letter-spacing: 0.2px;
}
.title-group .subtitle {
    font-weight: 600;
    opacity: 0.95;
}
.box-header h2 {
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--text-dark);
}
.seo-section-title, .instructions-section h2, .comments-section h2 {
    font-weight: 800;
    text-shadow: 0 1px 3px var(--shadow-color);
    letter-spacing: 0.2px;
}

/* 2. Improve Buttons - Pure Green Background & White Text */
.convert-action-btn, .convert-btn {
    background: #10b981 !important; /* Pure clear green */
    border: none !important;
    font-weight: 700 !important; /* Bolder button text */
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    color: #ffffff !important;
}
.convert-action-btn:hover, .convert-btn:hover {
    background: #059669 !important; /* Slightly darker pure green on hover */
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
    transform: translateY(-2px);
}
.convert-action-btn.secondary-action {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-dark) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px var(--shadow-color) !important;
}
.convert-action-btn.secondary-action:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: var(--bg-card) !important;
}

/* 3. Text Areas */
.text-area {
    font-weight: 500; /* slightly heavier for clear reading */
    border: 2px solid var(--border-color) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.text-area:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.15) !important;
}

/* 4. Improve Cards/Containers */
.converter-box {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}
.seo-card, .instruction-box, .comment-form-wrapper {
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.06);
}

/* Dark mode compensations */
body.dark-mode .converter-box, 
body.dark-mode .seo-card, 
body.dark-mode .instruction-box,
body.dark-mode .comment-form-wrapper {
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border-color: var(--border-color);
}
body.dark-mode .text-area {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* 5. Instruction specific */
.instruction-box h3, .seo-card h3 {
    font-weight: 800;
}
.instruction-box .step-list li {
    font-weight: 500;
    color: var(--text-dark);
}
.seo-card p, .seo-card ul {
    font-weight: 500;
}

/* 6. Fix Notifications/Toasts text to always be white */
.toast {
    color: #ffffff !important;
}
.toast-success {
    color: #ffffff !important;
}

/* 7. Improve Small Buttons (Copy, Clear, Fullscreen) */
.copy-btn, .clear-btn, .fullscreen-btn {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04) !important;
    transition: all 0.2s ease !important;
}
.copy-btn:hover, .clear-btn:hover, .fullscreen-btn:hover {
    background: var(--bg-secondary) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08) !important;
    transform: translateY(-1px);
}
body.dark-mode .copy-btn, body.dark-mode .clear-btn, body.dark-mode .fullscreen-btn {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* 8. Make Smart Feature Tags clearer */
.feature-tag {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
    font-weight: 600 !important;
}
body.dark-mode .feature-tag {
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
}

/* 9. Make Logo distinct in Light Mode */
.logo-area img {
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.12)) drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.25));
}
body.dark-mode .logo-area img {
    filter: none;
}
