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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, 'Noto Serif Bengali', 'Baloo 2', serif;
    background-color: #f0f2f8;
    background-image:
        radial-gradient(ellipse at 15% 40%, rgba(102, 126, 234, 0.10) 0px, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(118, 75, 162, 0.08) 0px, transparent 50%),
        radial-gradient(ellipse at 60% 85%, rgba(102, 126, 234, 0.06) 0px, transparent 45%);
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    border-bottom: none;
    box-shadow: 0 1px 0 rgba(102, 126, 234, 0.12), 0 4px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: headerAccent 6s ease-in-out infinite;
}

@keyframes headerAccent {

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

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

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

main {
    max-height: calc(100vh - 96px);
    height: calc(100vh - 96px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-top: 0;
}

.content-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 15px 15px 0px 15px;
    min-height: 0;
}

.logo {
    font-weight: 700;
    font-size: 32px;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 24px;
    letter-spacing: -3px;
    line-height: 40px;
}

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

.mobile-menu-toggle {
    display: none;
    background: #ff8500;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.mobile-menu-toggle .menu-text {
    display: inline;
}

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

.menu-item {
    position: relative;
}

.menu-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    background: white;
    color: #3d4852;
    border: 1px solid #dde2ea;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.menu-btn:hover {
    background: #f4f6ff;
    border-color: #a5b0e0;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.menu-btn.primary {
    background: #ff8500;
    color: white;
    border-color: #ff8500;
}

.menu-btn.primary:hover {
    background: #e67700;
    border-color: #e67700;
}

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 10px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
    border: 1px solid rgba(102, 126, 234, 0.12);
}

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

.dropdown-item {
    padding: 12px 20px;
    color: #3d4852;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    font-size: 14px;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: #f7f9fc;
    color: #ff8500;
}

/* 3RD LEVEL SUBMENU CONTAINER */
.dropdown-item.has-submenu {
    position: relative;
    cursor: pointer;
    padding: 0;
    /* RESET PADDING ON THE CONTAINER */
}

.dropdown-item.has-submenu>span {
    display: block;
    padding: 12px 20px;
    /* APPLY THE SAME PADDING AS REGULAR DROPDOWN-ITEM */
}

.dropdown-item.has-submenu>span::after {
    content: '\25B6';
    float: right;
    margin-left: 10px;
    font-size: 0.8em;
}

/* SUBMENU STYLING */
.submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.submenu-item {
    display: block;
    padding: 10px 15px;
    color: #3d4852;
    text-decoration: none;
    transition: background 0.2s;
}

.submenu-item:hover {
    background: #f4f6ff;
    color: #667eea;
}

/* SHOW SUBMENU ON HOVER */
.dropdown-item.has-submenu:hover>.submenu {
    display: block;
}

/* CONTROLS WRAPPER - NEW */
.controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.10);
}

.toggle-label {
    font-weight: 600;
    font-size: 15px;
    color: #3d4852;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd2d9;
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: #667eea;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

/* -- NEXT SECTION -- */
.welcome-section {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.welcome-section.hidden {
    opacity: 0;
    transform: translateY(-50px);
    pointer-events: none;
    margin: 0;
}

.welcome-section {
    background: linear-gradient(135deg, #00a3ff 0%, #0066cc 100%);
    padding: 60px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    pointer-events: none;
}

.welcome-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.welcome-content h1 {
    font-size: 44px;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.welcome-content p {
    font-size: 20px;
    opacity: 0.95;
    line-height: 1.6;
    margin-bottom: 12px;
}

.gradient-text {
    font-family: 'Noto Serif Bengali', 'Baloo 2', serif;
    font-size: 42px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 16px 0;
}

.speaker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    backdrop-filter: blur(10px);
}

.speaker-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #3d4852;
    margin-bottom: 30px;
    text-align: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: white;
    padding: 32px;
    border-radius: 14px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(102, 126, 234, 0.10);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: rgba(102, 126, 234, 0.25);
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.feature-card:nth-child(1) .feature-icon {
    color: #ff6b9d;
}

.feature-card:nth-child(2) .feature-icon {
    color: #00a3ff;
}

.feature-card:nth-child(3) .feature-icon {
    color: #00c853;
}

.feature-card:nth-child(4) .feature-icon {
    color: #ffa726;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #3d4852;
    font-weight: 700;
}

.feature-card p {
    font-size: 15px;
    color: #6b7785;
    line-height: 1.5;
}

/* SPECIFIC TO ASSAMESE WRITING - KEYMAP SECTION */
.keymap-section {
    text-align: center;
    font-family: "Noto Serif Bengali", serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    padding: 15px;
    background: white;
    margin: 15px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10), 0 1px 4px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.keymap-section #div-slide {
    padding: 15px;
    border-radius: 12px;
    background: #f7f9fc;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 2px solid #e5e9f0;
}

.keymap-section table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.keymap-section table td {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #e5e9f0;
    background: white;
}

.keymap-section table tr:nth-child(odd) td {
    background: #f0f4ff;
    color: #667eea;
    font-weight: 700;
    font-size: 16px;
}

.keymap-section table tr:nth-child(even) td {
    background: white;
    color: #6b7785;
    font-family: monospace;
}

.keymap-section #div-slide.slide-closed {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    border-width: 0;
}

.keymap-section #div-slide.slide-open {
    max-height: 500px;
    opacity: 1;
}

/* TEXTAREA AND CONTAINER STYLES - DYNAMIC RESIZING */
.content-section .container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif, "Noto Serif Bengali";
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

textarea {
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 100%;
    border: 3px solid #667eea;
    box-sizing: border-box;
    resize: none;
    padding: 15px;
    font-size: 24px;
    color: #001440;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    flex: 1;
}

textarea:focus {
    outline: none;
    border-color: #764ba2;
}

.assamese,
#txtAssamese,
#txtEnglish {
    font-family: "Noto Serif Bengali", serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    font-size: 24px;
    color: #555;
}

/* BUTTON CONTAINER - SINGLE ROW */
.button-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* BUTTON STYLES - COMMONIZED */
button[type="button"],
.slate-action-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif, "Noto Serif Bengali";
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

button[type="button"]:hover,
.slate-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

button[type="button"]:active,
.slate-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

button i {
    font-size: 1rem;
}

#clear,
#copy,
#read,
#transliterate,
#translate,
#checkSpelling,
#clearBtn,
#downloadBtn,
#resetBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

#save,
.slate-action-btn.save-btn {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    box-shadow: 0 4px 12px rgba(48, 207, 208, 0.35);
}

/* CASE DECLENSION SPECIFIC STYLES (SB.HTML) */
.case-input-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10), 0 1px 4px rgba(0, 0, 0, 0.04);
    margin: 15px;
}

.case-input-group {
    margin-bottom: 20px;
}

.case-input-group label {
    display: block;
    color: #3d4852;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    font-family: 'Noto Serif Bengali', serif;
}

.case-input-group input[type="text"],
.case-input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e9f0;
    border-radius: 10px;
    font-size: 18px;
    font-family: 'Noto Serif Bengali', serif;
    transition: all 0.3s ease;
    background: white;
    color: #3d4852;
    height: 50px;
}

.case-input-group input[type="text"]:focus,
.case-input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.case-generate-btn {
    width: 100%;
    padding: 14px 24px;
    height: 50px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Noto Serif Bengali', serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.case-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

.case-results-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10), 0 1px 4px rgba(0, 0, 0, 0.04);
    margin: 15px;
}

.case-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Noto Serif Bengali', serif;
}

.case-results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.case-results-table thead td {
    color: white;
    font-weight: 700;
    padding: 14px 12px;
    font-size: 15px;
    text-align: left;
}

.case-results-table thead td:first-child {
    border-top-left-radius: 12px;
}

.case-results-table thead td:last-child {
    border-top-right-radius: 12px;
}

.case-results-table tbody tr {
    transition: all 0.2s ease;
}

.case-results-table tbody tr:hover {
    background: #f7f9fc;
}

.case-results-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e5e9f0;
    color: #3d4852;
    font-size: 16px;
}

.case-results-table tbody td:first-child {
    font-weight: 700;
    color: #667eea;
}

.case-results-table tbody td input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    color: #3d4852;
    font-size: 16px;
    font-family: 'Noto Serif Bengali', serif;
    padding: 4px;
}

.case-results-table tbody td input[type="text"]:focus {
    outline: none;
    background: #f0f4ff;
    border-radius: 4px;
}

/* PREFIX TABLE SPECIFIC STYLES */
.prefix-section {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.prefix-header {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10), 0 1px 4px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.prefix-header h1 {
    font-size: clamp(24px, 4vw, 36px);
    color: #667eea;
    margin-bottom: 12px;
    font-weight: 700;
}

.prefix-header p {
    font-size: clamp(14px, 2vw, 18px);
    color: #6b7785;
    line-height: 1.6;
}

.table-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10), 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.prefix-table {
    table-layout: fixed;
    width: 100%;
    font-family: 'Noto Serif Bengali', serif;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    border: 1px solid #764ba2;
    overflow: hidden;
}

.prefix-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.prefix-table thead th {
    color: white;
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    font-size: clamp(14px, 1.5vw, 18px);
    border-bottom: 3px solid #764ba2;
}

.prefix-table thead th {
    width: 33.33%;
}

.prefix-table tbody td {
    width: 33.33%;
}

.prefix-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e9f0;
}

.prefix-table tbody tr:hover {
    background: #f7f9fc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.prefix-table tbody tr:last-child {
    border-bottom: none;
}

.prefix-table tbody td {
    padding: 14px 12px;
    font-size: clamp(13px, 1.3vw, 16px);
    color: #3d4852;
    line-height: 1.6;
}

.prefix-table tbody td:nth-child(1),
.prefix-table tbody td:nth-child(2) {
    font-weight: 700;
    color: #667eea;
}

.prefix-table tbody td:nth-child(5),
.prefix-table tbody td:nth-child(6) {
    font-style: italic;
    color: #6b7785;
}

/* Column Widths */
.col-prefix {
    width: 10%;
}

.col-transliteration {
    width: 10%;
}

.col-meaning {
    width: 25%;
}

.col-translation {
    width: 20%;
}

.col-example {
    width: 20%;
}

.col-example-trans {
    width: 15%;
}

/* Search and Filter Section */
.filter-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.10), 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 80px 12px 15px;
    border: 2px solid #e5e9f0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Noto Serif Bengali', serif;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-box i.fa-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7785;
    pointer-events: none;
}

#clearSearch {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e9f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#clearSearch:hover {
    background: #cbd2d9;
}

#clearSearch i {
    font-size: 12px;
    color: #3d4852;
}

.info-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* No Results Message */
#noResults td {
    text-align: center;
    padding: 40px 20px;
    color: #6b7785;
    font-style: italic;
    font-size: 16px;
}

#noResults i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

/* WHITEBOARD - WIDER SIDEBAR WITH EQUAL CANVAS & VIDEO */
.slate-container {
    flex: 1;
    display: flex;
    gap: 15px;
    overflow: hidden;
    width: 100%;
}

.slate-sidebar {
    flex-shrink: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 24px rgba(102, 126, 234, 0.12), 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    overflow-x: hidden;
}

.slate-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.slate-canvas-wrapper {
    background: white;
    border-radius: 16px;
    padding: 15px;
    flex-shrink: 0;
}

.slate-canvas-container {
    position: relative;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
    height: 350px;
}

#drawingCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.video-container {
    background: white;
    border-radius: 16px;
    padding: 15px;
    flex-shrink: 0;
}

#youtubeVideo {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    border: 3px solid #667eea;
}

.slate-control-group {
    margin-bottom: 20px;
}

.slate-control-group:last-child {
    margin-bottom: 0;
}

.slate-control-group label {
    display: block;
    color: #555;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.slate-control-group select,
.slate-control-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Noto Serif Bengali', serif;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.slate-control-group select:hover,
.slate-control-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.slate-section-title {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.slate-section-title i {
    font-size: 1rem;
}

.slate-alphabet-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
    margin-top: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 2px;
}

.slate-alphabet-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 4px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-family: 'Noto Serif Bengali', serif;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slate-alphabet-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.slate-alphabet-btn:active {
    transform: scale(0.95);
}

.slate-button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.color-picker-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.slate-color-option {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.slate-color-option:hover {
    transform: scale(1.15);
    border-color: #667eea;
}

.slate-color-option.active {
    border-color: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.5);
}

.slate-color-option.active::after {
    content: '\2714';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pen-size-container {
    display: flex;
    gap: 8px;
}

.slate-pen-option {
    flex: 1;
    padding: 12px 5px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: white;
}

.slate-pen-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.slate-pen-option.active {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.floating-emoji {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    animation: float 3s ease-in-out;
    z-index: 1000;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* TRANSLITERATOR SPECIFIC STYLES */
#frmMain {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.trans-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding: 0px 15px;
}

.trans-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.trans-panel {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    min-height: 0;
}

.trans-panel .container {
    flex: 1;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 15px;
}

.trans-panel textarea {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 100%;
    resize: none;
    border: 3px solid #667eea;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

.trans-panel textarea:focus {
    outline: none;
    border-color: #764ba2;
}

.panel-header {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
    padding: 15px 20px;
    flex-shrink: 0;
}

.panel-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.panel-title i {
    font-size: 1.1rem;
}

/* SPELL CHECKER SPECIFIC STYLES */
#result {
    width: 100%;
    height: 100%;
    padding: 15px;
    font-size: 24px;
    background-color: #fff;
    color: #001440;
    overflow-y: auto;
    line-height: 1.8;
    border: 3px solid #667eea;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

#result:focus {
    outline: none;
    border-color: #764ba2;
}

#result span.tooltip {
    color: red;
    position: relative;
    display: inline-block;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: wavy;
    pointer-events: auto;
}

#result span.tooltip::after {
    content: attr(title);
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    left: 200%;
    transform: translateX(-50%);
    white-space: nowrap;
    display: none;
    z-index: 1000;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#result span.tooltip::before {
    content: '';
    position: absolute;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #333 transparent transparent;
    display: none;
    z-index: 1001;
}

#result span.tooltip:hover::after,
#result span.tooltip:hover::before {
    display: block;
}

/* LOADING INDICATOR */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* VOWEL SIGNS SPECIFIC STYLES*/
.alphabet-learning-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
    margin: 15px;
}

.learning-header {
    text-align: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.learning-header h1 {
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    margin-bottom: 15px;
}

.learning-header p {
    font-size: clamp(14px, 2vw, 18px);
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.auto-speak-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.auto-speak-label {
    font-size: clamp(14px, 2vw, 18px);
    color: #3d4852;
    user-select: none;
    white-space: nowrap;
    font-weight: 600;
}

.auto-toggle-switch {
    position: relative;
    width: 56px;
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.auto-toggle-switch.active {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.auto-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auto-toggle-switch.active .auto-toggle-slider {
    left: 30px;
}

.learning-container {
    flex: 1;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    overflow-y: auto;
    padding: 10px 0;
}

.learning-box {
    position: relative;
    width: clamp(140px, 28vw, 380px);
    height: clamp(105px, 21vw, 285px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.15);
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.learning-box:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42), 0 0 0 5px rgba(255, 255, 255, 0.22);
}

.letter-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.letter-card {
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: clamp(48px, 12vw, 148px);
    color: #fff;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 16px;
    font-family: 'Noto Serif Bengali', serif;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    position: relative;
}

.letter-card.active {
    display: flex;
}

.letter-card.vowel-bg {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
}

.letter-card.consonant-bg {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
}


.letter-card.result-bg {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    font-size: 20px;
    border-radius: 10px;
    color: #667eea;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slider-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.left {
    left: 10px;
}

.slider-arrow.right {
    right: 10px;
}

.box-label {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(12px, 2vw, 16px);
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.speaker-icon-box {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(16px, 2.5vw, 22px);
}

.operator-symbol {
    font-size: clamp(20px, 3vw, 32px);
    color: #3d4852;
    font-weight: bold;
}

/* RESPONSIVE DESIGN - TABLETS */
@media (max-width: 1024px) {
    .slate-sidebar {
        width: 280px;
    }

    .slate-alphabet-grid {
        grid-template-columns: repeat(5, 1fr);
        max-height: 280px;
    }

    .slate-canvas-container {
        height: 300px;
    }

    #youtubeVideo {
        height: 300px;
    }

    .controls-wrapper {
        gap: 10px;
    }

    .trans-container {
        grid-template-columns: 1fr;
    }

    .trans-panel textarea {
        min-height: 250px;
    }

    .prefix-table thead th,
    .prefix-table tbody td {
        padding: 12px 8px;
        font-size: clamp(12px, 1.2vw, 15px);
    }
}

/* RESPONSIVE DESIGN - MOBILE */
@media (max-width: 768px) {
    .header-container {
        padding: 12px 15px;
    }

    .logo {
        font-size: 24px;
    }

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

    .mobile-menu-toggle .menu-text {
        display: none;
    }

    .menu-items {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 16px;
    }

    .menu-items.active {
        display: flex;
    }

    .menu-item {
        width: 100%;
    }

    .menu-btn {
        width: 100%;
        text-align: left;
    }

    .dropdown {
        position: static;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
        transform: none;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        box-shadow: none;
        border: none;
        background: #f7f9fc;
    }

    .menu-item:hover .dropdown,
    .menu-item:active .dropdown {
        opacity: 1;
        max-height: 500px;
        margin-top: 8px;
    }

    .welcome-content h1 {
        font-size: 28px;
    }

    .welcome-content p {
        font-size: 16px;
    }

    .gradient-text {
        font-size: 24px;
    }

    .content-section {
        padding: 10px;
    }

    .section-title {
        font-size: 20px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    /* CONTROLS WRAPPER MOBILE */
    .controls-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .toggle-container {
        width: 100%;
        justify-content: space-between;
    }

    .button-row {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .btn-text {
        display: none;
    }

    button[type="button"] {
        padding: 10px 16px !important;
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    /* KEYMAP SECTION MOBILE */
    .keymap-section {
        margin: 10px;
        padding: 12px;
    }

    .keymap-section table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .keymap-section table tr:nth-child(odd) td {
        font-size: 13px;
    }

    /* CASE DECLENSION MOBILE */
    .case-input-section,
    .case-results-section {
        margin: 10px;
        padding: 16px;
    }

    .case-input-section>div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .case-results-table {
        font-size: 14px;
    }

    .case-results-table thead td,
    .case-results-table tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .case-results-table tbody td input[type="text"] {
        font-size: 14px;
    }

    /* PREFIX TABLE MOBILE */
    .prefix-section {
        padding: 10px;
    }

    .prefix-header {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .table-container {
        padding: 15px;
        border-radius: 12px;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .filter-section {
        padding: 15px;
        gap: 10px;
    }

    .search-box {
        min-width: 100%;
    }

    .info-badge {
        width: 100%;
        text-align: center;
    }

    .prefix-table {
        min-width: 800px;
    }

    .prefix-table thead th,
    .prefix-table tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* MOBILE WHITEBOARD LAYOUT */
    main {
        max-height: calc(100vh - 66px);
        height: calc(100vh - 66px);
    }

    .slate-container {
        flex-direction: column;
        gap: 12px;
    }

    .slate-sidebar {
        width: 100%;
        order: 2;
        max-height: 40vh;
        padding: 12px;
    }

    .slate-main-area {
        order: 1;
        gap: 12px;
    }

    .slate-canvas-wrapper,
    .video-container {
        padding: 12px;
    }

    .slate-canvas-container {
        height: 250px;
    }

    #youtubeVideo {
        height: 250px;
    }

    .slate-alphabet-grid {
        grid-template-columns: repeat(6, 1fr);
        max-height: 200px;
        gap: 5px;
    }

    .slate-alphabet-btn {
        font-size: 1rem;
        padding: 6px 2px;
    }

    .slate-action-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .slate-action-btn span {
        display: none;
    }

    .slate-action-btn i {
        margin-right: 0;
        font-size: 1.1rem;
    }

    .slate-section-title {
        font-size: 0.95rem;
    }

    .slate-control-group {
        margin-bottom: 12px;
    }

    .color-picker-container {
        gap: 6px;
    }

    .slate-color-option {
        width: 34px;
        height: 34px;
    }

    textarea {
        font-size: 20px;
        min-height: 150px;
    }

    /* TRANSLITERATOR MOBILE */
    .trans-section {
        padding: 10px;
    }

    .trans-panel textarea {
        min-height: 200px;
        font-size: 18px;
    }

    .panel-title {
        font-size: 1rem;
    }

    .panel-header {
        padding: 12px 15px;
    }

    /* VOWEL LEARNING MOBILE */
    .learning-container {
        flex-direction: column;
        gap: 15px;
    }

    .learning-box {
        width: clamp(120px, 85vw, 340px);
        height: clamp(90px, 20vh, 200px);
    }

    .operator-symbol {
        transform: rotate(90deg);
    }

    .learning-header p {
        display: none;
    }
}

/* RESPONSIVE DESIGN - SMALL MOBILE */
@media (max-width: 480px) {
    .content-section {
        padding: 8px;
    }

    .keymap-section {
        margin: 8px;
        padding: 10px;
    }

    .slate-sidebar {
        padding: 10px;
    }

    .slate-canvas-wrapper,
    .video-container {
        padding: 10px;
    }

    .slate-canvas-container {
        height: 220px;
    }

    #youtubeVideo {
        height: 220px;
    }

    .slate-alphabet-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .slate-alphabet-btn {
        font-size: 0.9rem;
    }

    .slate-button-container {
        gap: 8px;
    }

    .pen-size-container {
        gap: 4px;
    }

    textarea {
        font-size: 18px;
        padding: 12px;
        min-height: 120px;
    }

    button[type="button"] {
        padding: 8px 12px !important;
    }

    button i {
        font-size: 0.95rem;
    }

    .toggle-label {
        font-size: 13px;
    }

    .prefix-header h1 {
        font-size: 22px;
    }

    .prefix-header p {
        font-size: 14px;
    }

    .prefix-table {
        min-width: 700px;
    }

    .prefix-table thead th,
    .prefix-table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    #noResults td {
        padding: 30px 15px;
        font-size: 14px;
    }
}

/* VERB CONJUGATION TABLE SPECIFIC STYLES */
.special-td {
    border-radius: 0 !important;
}

.verb-table thead tr:first-child td {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding: 12px 8px;
    vertical-align: middle;
}

.verb-table thead tr:last-child td {
    font-size: 12px;
    text-align: center;
    padding: 8px 6px;
    background: rgba(102, 126, 234, 0.8);
}

.verb-table tbody .tense-label {
    min-width: 150px;
    text-align: left;
    font-weight: 700;
    background: #f0f4ff;
    padding: 12px;
}

.verb-table tbody .tense-label small {
    display: block;
    font-weight: 400;
    color: #6b7785;
    font-size: 11px;
    margin-top: 4px;
}

.verb-table tbody td input {
    text-align: center;
    width: 100%;
}

/* MOBILE RESPONSIVE ADJUSTMENTS */
@media (max-width: 1200px) {
    .verb-table {
        font-size: 13px;
    }

    .verb-table thead tr:first-child td {
        font-size: 12px;
        padding: 10px 6px;
    }

    .verb-table thead tr:last-child td {
        font-size: 11px;
        padding: 6px 4px;
    }

    .verb-table tbody td {
        padding: 8px 4px;
    }

    .verb-table tbody td input[type="text"] {
        font-size: 13px;
        padding: 6px;
    }

    .verb-table tbody .tense-label {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .verb-table {
        font-size: 11px;
    }

    .verb-table thead tr:first-child td {
        font-size: 10px;
        padding: 8px 4px;
    }

    .verb-table thead tr:last-child td {
        font-size: 9px;
        padding: 4px 2px;
    }

    .verb-table tbody td {
        padding: 6px 2px;
    }

    .verb-table tbody .tense-label {
        min-width: 100px;
        font-size: 10px;
        padding: 8px 4px;
    }

    .verb-table tbody .tense-label small {
        font-size: 8px;
    }

    .verb-table tbody td input[type="text"] {
        font-size: 11px;
        padding: 4px 2px;
    }
}

@media (max-width: 480px) {

    .verb-table thead tr:first-child td br,
    .verb-table thead tr:last-child td br {
        display: none;
    }

    .verb-table tbody .tense-label small {
        display: none;
    }

    .verb-table tbody .tense-label {
        min-width: 80px;
    }
}

/* TTS GRID SPECIFIC STYLES */
.items-wrapper {
    flex: 1;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    overflow-y: auto;
    padding: 20px;
}

.items-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    min-width: 100%;
}

.items-container .item-card {
    flex: 0 0 auto;
    min-width: 200px;
}

.item-card {
    background: white;
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 14px rgba(102, 126, 234, 0.10), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.08);
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(102, 126, 234, 0.20), 0 4px 10px rgba(0, 0, 0, 0.06);
    border-color: rgba(102, 126, 234, 0.20);
}

.item-card:active {
    transform: scale(0.95);
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.item-card:hover::before {
    opacity: 0.1;
}

.item-card>* {
    position: relative;
    z-index: 1;
}

.item-assamese {
    font-size: 3rem;
    font-family: 'Noto Serif Bengali', serif;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: 600;
}

.item-english {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 5px;
}

.item-pronunciation {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
}

.speaker-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #667eea;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.3s;
    z-index: 1;
}

.item-card:hover .speaker-icon {
    opacity: 1;
}

.speaking {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.05);
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }
}

.info-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 20px;
    opacity: 0.8;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .alphabet-learning-section {
        padding: 20px;
    }

    .learning-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .items-wrapper {
        padding: 15px;
        gap: 20px;
    }

    .items-container {
        gap: 15px;
    }

    .item-card {
        padding: 25px 15px;
        min-width: 160px;
    }

    .item-assamese {
        font-size: 2.5rem;
    }

    .item-english {
        font-size: 1rem;
    }

    .item-pronunciation {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 10px;
    }

    .alphabet-learning-section {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .learning-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }

    .auto-speak-toggle {
        width: 100%;
        justify-content: center;
    }

    .items-wrapper {
        padding: 10px;
        gap: 15px;
    }

    .items-container {
        gap: 10px;
    }

    .item-card {
        min-width: 140px;
        padding: 20px 15px;
    }

    .item-assamese {
        font-size: 2rem;
    }

    .item-english {
        font-size: 0.9rem;
    }

    .item-pronunciation {
        font-size: 0.8rem;
    }

    .speaker-icon {
        font-size: 1rem;
        bottom: 8px;
        right: 8px;
    }
}

@media (max-width: 360px) {
    .item-card {
        min-width: 120px;
        padding: 15px 10px;
    }

    .item-assamese {
        font-size: 1.8rem;
    }
}

.item-card:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.auto-toggle-switch:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .item-card {
        border: 2px solid #333;
    }

    .item-assamese {
        color: #4a3ba8;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====================================
   PRINT STYLES
   ==================================== */
@media print {
    body {
        background: white;
    }

    .learning-header {
        display: none;
    }

    .speaker-icon {
        display: none;
    }

    .item-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* ============================================================================================= */
/* TAB NAVIGATION STYLES */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 12px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif, "Noto Serif Bengali";
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =====================================================
   WHITEBOARD PAGE - MERGED STYLES
   ===================================================== */

/* MOBILE TOGGLE BUTTON */
.mobile-toggle-btn {
    display: none;
    position: fixed;
    top: 100px;
    right: 10px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.mobile-toggle-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.mobile-toggle-btn.active {
    background: #f56565;
}

.controls-wrapper {
    transition: all 0.3s ease;
}

select {
    padding: 10px 15px;
    border: 2px solid #e5e9f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #3d4852;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Serif Bengali', Arial, sans-serif;
    width: 150px;
    min-width: 150px;
}

select:hover {
    border-color: #cbd2d9;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    font-size: larger;
    color: #3d4852;
    white-space: nowrap;
}

.divider {
    width: 1px;
    height: 30px;
    background: #e5e9f0;
}

.split-panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    background: white;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 0px);
    box-sizing: border-box;
    position: relative;
    border-radius: 16px;
    padding: 10px;
}

.video-container {
    flex: 1;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: calc(100vh - 0px);
    box-sizing: border-box;
    position: relative;
    border-radius: 16px;
    padding: 10px;
}

.video-container iframe {
    flex: 1;
    width: 100%;
    border-radius: 12px;
    border: none;
    min-height: 0;
}

.video-info {
    padding: 15px;
    background: #f5f7fa;
    border-radius: 8px;
    text-align: center;
    flex-shrink: 0;
}

.video-info p {
    margin: 0;
    color: #3d4852;
    font-size: 14px;
}

.video-info .current-letter {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 32px;
    color: #667eea;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

#whiteboard {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.canvas-panel,
.videos-panel {
    background: white;
    border-radius: 16px;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100px;
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

input[type="color"]:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

input[type="color"]:active {
    transform: scale(0.97);
}

input[type="color"]:focus {
    outline: none;
    box-shadow: 0 0 10px 2px rgba(100, 150, 255, 0.6);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
}

input[type="range"]:hover {
    opacity: 1;
    transform: scaleY(1.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #4facfe);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #4facfe);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    cursor: grab;
}

input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.8);
}

canvas {
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media screen and (max-width: 768px) {
    .mobile-toggle-btn {
        display: block;
    }

    .keymap-section {
        position: relative;
    }

    .controls-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: white;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        max-height: 90vh;
        overflow-y: auto;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }

    .controls-wrapper.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .split-panels-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 60px;
    }

    .control-group {
        flex-wrap: wrap;
        gap: 8px;
    }

    .control-group label {
        font-size: medium;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    select {
        width: 120px;
        min-width: 120px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .divider {
        display: none;
    }

    .canvas-container,
    .video-container {
        height: auto;
        min-height: 400px;
        padding: 8px;
        border-radius: 12px;
    }

    .video-info {
        padding: 12px;
    }

    .video-info .current-letter {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .video-info p {
        font-size: 13px;
    }

    #whiteboard {
        border-radius: 12px;
    }

    .canvas-panel,
    .videos-panel {
        border-radius: 12px;
    }

    input[type="color"] {
        width: 80px;
        height: 44px;
        min-height: 44px;
    }

    input[type="range"] {
        height: 10px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 26px;
        height: 26px;
    }
}

@media screen and (max-width: 480px) {
    .control-group {
        gap: 5px;
    }

    .control-group label {
        font-size: small;
    }

    select {
        width: 100px;
        min-width: 100px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .canvas-container,
    .video-container {
        min-height: 250px;
        padding: 5px;
        border-radius: 8px;
    }

    .video-info {
        padding: 8px;
    }

    .video-info .current-letter {
        font-size: 20px;
    }

    .video-info p {
        font-size: 11px;
    }

    #whiteboard {
        border-radius: 8px;
    }

    .canvas-panel,
    .videos-panel {
        border-radius: 8px;
    }

    input[type="color"] {
        width: 60px;
        height: 44px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .control-group label {
        font-size: medium;
    }

    select {
        width: 130px;
        min-width: 130px;
    }
}

@media (hover: none) and (pointer: coarse) {

    select,
    input[type="color"],
    button {
        min-height: 44px;
        min-width: 44px;
    }

    select:active {
        transform: scale(0.98);
    }

    .control-group {
        gap: 10px;
    }

    select,
    input {
        font-size: 16px;
    }
}