@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anek+Devanagari:wdth,wght@75..125,100..800&display=swap');

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

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
}

body {
    font-family: "Anek Devanagari", serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fc;
    min-height: 100vh;
    color: #2d3748;
}

/* Non-auth pages get flex layout for footer positioning */
body:not(.auth-page) {
    display: flex;
    flex-direction: column;
}

/* Auth page specific body styling */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

/* Header Styles */
.app-header {
    background: #1e40af;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1rem;
    position: relative;
    min-height: 48px;
}

.main-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    flex: 1;
}

/* Navigation Bar - Second Layer */
.nav-bar {
    background: #1e3a8a;
    padding: 0;
    position: relative;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
}

/* Page Navigation Buttons - Tab Style */
.page-nav {
    display: flex;
    gap: 0;
    align-items: center;
    padding-left: 0.5rem;
}

.page-nav-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.85);
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: "Anek Devanagari", serif;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    margin: 0;
    height: 42px;
    display: flex;
    align-items: center;
}

.page-nav-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

.page-nav-button.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-bottom-color: white;
}

/* Account Section - Right Side */
.account-section {
    position: relative;
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
}

/* Account Dropdown - Fixed positioning */
.account-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
}

.nav-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.85);
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Anek Devanagari", serif;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    height: 42px;
    display: flex;
    align-items: center;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.account-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Anek Devanagari", serif;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0;
}

.account-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown-content hr {
    margin: 0;
    border: 0;
    height: 1px;
    background: #eee;
}

.user-info {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #666;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 10;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    backdrop-filter: blur(2px);
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    transform: scale(0.9) translateX(-50px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu.open .mobile-menu-content {
    transform: scale(1) translateX(0);
    opacity: 1;
}

.mobile-menu-overlay {
    display: none; /* Remove the black overlay */
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    height: auto;
    min-height: 48px;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.0rem;
    font-weight: 600;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-menu-items {
    padding: 0.5rem 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
    background: none;
    cursor: pointer;
}

.mobile-menu-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.mobile-menu-item.active {
    background-color: #e2e8f0;
    color: #1e40af;
    border-left: 4px solid #1e3a8a;
}

.mobile-menu-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 1rem;
}

.mobile-auth-section {
    border-top: 1px solid #eee;
    margin-top: 1rem;
    padding-top: 1rem;
}

.mobile-user-info {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
}

/* Main Application Container */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(248, 249, 252, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-family: "Anek Devanagari", serif;
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

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

/* Entry System */
.entry-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 500px;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.entry-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    position: relative;
    transition: all 0.3s ease;
    min-height: 80px;
}

/* Desktop ordering - English left, Yiddish right */
.input-group.yiddish-group {
    order: 2;
}

.input-group.english-group {
    order: 1;
}

/* Desktop button row styling */
.button-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    order: 3;
}

.button-row .action-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 70px;
    max-width: 90px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-row .note-btn {
    width: 35px;
    height: 35px;
    margin-left: 0;
    margin-right: 0;
}

.entry-row:hover {
    background-color: #f8f9fa;
}

.entry-row:last-child {
    border-bottom: none;
}

.row-number {
    font-weight: 600;
    color: #666;
    text-align: center;
    font-size: 0.9rem;
    width: 50px;
    margin-left: 1rem;
}

.input-group {
    position: relative;
    flex: 1;
    margin-right: 1.5rem;
    min-width: 300px;
}

.input-group::before {
    content: attr(data-label);
    position: absolute;
    top: -8px;
    left: 8px;
    background: #f8f9fc;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    border-radius: 4px;
    z-index: 1;
    transition: all 0.3s ease;
}

.input-group.yiddish-group::before {
    content: "Yiddish";
    right: 8px;
    left: auto;
    text-align: right;
    direction: rtl;
}

.input-group.english-group::before {
    content: "English";
}

.yiddish-input, .translation-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 50px;
}

.yiddish-input {
    font-family: "Frank Ruhl Libre", serif;
    direction: rtl;
    text-align: right;
    font-size: 1.1rem;
    border-color: #cbd5e0;
}

.translation-input {
    font-family: "Anek Devanagari", serif;
    direction: ltr;
    text-align: left;
    background: #f7fafc;
    border-color: #cbd5e0;
    cursor: default;
}

.translation-input:read-only {
    background: #f7fafc;
    color: #4a5568;
}

.yiddish-input:focus, .translation-input:focus {
    outline: none;
    border-color: #3182ce;
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Action Button (initially hidden) */
.action-btn {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-right: 1rem;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.action-btn.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.action-btn:hover {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    transform: translateY(-1px);
}

/* Note Button - positioned at the end of the row */
.note-btn {
    position: relative;
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    margin-left: 1rem;
    margin-right: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.note-btn:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-1px) scale(1.05);
}

.note-btn.active {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
}

.note-btn.has-note {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.note-btn.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Notes Container - matches input box styling */
.notes-container {
    position: absolute;
    right: -170px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 40px; /* Fixed height of 40px */
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    z-index: 15;
    transition: transform 0.3s ease;
    display: none;
    justify-content: center;
    padding: 0;
    overflow: hidden; /* Hide any overflow to prevent scrollbars */
}

.notes-container.show {
    display: flex;
    transform: translateY(-50%) translateX(-180px);
}

.notes-textarea {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-family: "Anek Devanagari", serif;
    font-size: 1rem;
    resize: none;
    background: #f8f9fa;
    outline: none;
    transition: all 0.3s ease;
}

.notes-textarea:focus {
    background: white;
    border: 2px solid #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dropdown Autocomplete */
.dropdown-container {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 2px;
}

/* Custom scrollbar for dropdown */
.dropdown-list::-webkit-scrollbar {
    width: 1px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 8px;
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dropdown-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: "Frank Ruhl Libre", serif;
    direction: rtl;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

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

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

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

/* Row Actions */
.row-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Standalone note buttons (not in button-row) */
.entry-row > .note-btn, .request-btn, .delete-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Note button states - keeping only the specific states */
.note-btn:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-1px);
}

.note-btn.active {
    background: #ffc107;
    color: #333;
}

.note-btn.has-note {
    background: #17a2b8;
}

.request-btn {
    background: #007bff;
    color: white;
}

.request-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Notes Panel */
.notes-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #e9ecef;
}

.notes-textarea {
    width: 100%;
    height: 100%; /* Use full height of container */
    padding: 0.5rem; /* Reduced padding to fit better */
    border: none;
    border-radius: 6px;
    font-family: "Anek Devanagari", serif;
    font-size: 0.9rem;
    resize: none; /* Prevent manual resizing */
    background: #f8f9fa;
    outline: none;
    transition: all 0.3s ease;
    overflow: hidden; /* Hide scrollbars */
    box-sizing: border-box; /* Include padding in height calculation */
}

.notes-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.save-note-btn, .cancel-note-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.save-note-btn {
    background: #28a745;
    color: white;
}

.save-note-btn:hover {
    background: #218838;
}

.cancel-note-btn {
    background: #6c757d;
    color: white;
}

.cancel-note-btn:hover {
    background: #5a6268;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    width: 100%;
}

.action-button {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(74, 85, 104, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-family: "Anek Devanagari", serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.action-button.primary {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border-color: #1e40af;
}

.action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
    background: linear-gradient(135deg, #1e3a8a 0%, #1a365d 100%);
}

.action-button.secondary {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border-color: #4a5568;
}

.action-button.secondary:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1a365d 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(113, 128, 150, 0.25);
}

.action-button:not(.primary):not(.secondary) {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border-color: #4a5568;
}

.action-button:not(.primary):not(.secondary):hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 85, 104, 0.25);
}

/* Download Dropdown */
.download-dropdown {
    position: relative;
}

.download-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    min-width: 120px;
}

.download-options.show {
    display: block;
}

.download-options a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

.download-options a:hover {
    background-color: #f8f9fa;
}

/* Progress Information */
.progress-info {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.save-status {
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-style: italic;
    color: #28a745;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

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

/* Add these styles at the end, before the final closing brace */

/* Modal Form Specific Styles */
.modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    padding: 0.4rem 1rem; /* Reduced to almost half size */
    display: flex;
    justify-content: center; /* Center the content */
    align-items: center;
    border-radius: 12px 12px 0 0;
    position: relative; /* For absolute positioning of close button */
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem; /* Smaller to match reduced header height */
    font-family: "Anek Devanagari", serif;
    color: #ffffff !important; /* Force white text */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Add text shadow for better visibility */
    font-weight: 700; /* Bolder text */
    text-align: center;
}

/* Position close button absolutely */
.modal-header .close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.modal-header .close:hover {
    opacity: 1;
}

/* Modal form content padding - more compact */
#addWordModal form,
#editWordModal form {
    padding: 1.5rem; /* Reduced from 2rem */
}

.form-group {
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-family: "Anek Devanagari", serif;
}

.modal-actions {
    display: flex;
    flex-direction: row; /* Force row layout */
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem; /* Reduced spacing */
    padding-top: 0.5rem; /* Reduced padding */
}

.modal-actions .btn {
    flex: 1; /* Equal width buttons */
    min-width: 100px;
    max-width: 120px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: "Anek Devanagari", serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Anek Devanagari", serif;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%); /* Match the new color scheme */
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Modal input styling - with corner tags */
.modal-input-group {
    position: relative;
    margin-bottom: 0;
}

.modal-input-group::before {
    content: attr(data-label);
    position: absolute;
    top: -8px;
    left: 12px;
    background: white;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    border-radius: 4px;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-input-group.yiddish-group::before {
    content: "Yiddish";
    right: 12px;
    left: auto;
    text-align: right;
    direction: rtl;
}

.modal-input-group.english-group::before {
    content: "English";
}

#addWordModal input,
#editWordModal input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 20px;
    
}

#addYiddishWord,
#editYiddishWord {
    font-family: "Frank Ruhl Libre", serif;
    direction: rtl;
    text-align: right;
}

#addTranslation,
#editTranslation {
    font-family: "Anek Devanagari", serif;
    direction: ltr;
    text-align: left;
}

#addWordModal input:focus,
#editWordModal input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-message {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: auto;
    max-width: 90vw;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    min-width: 320px;
    max-width: 480px;
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid #2c5282;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(44, 82, 130, 0.1);
    margin: 0 auto;
}

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

.toast-success {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast-error {
    border-left-color: #f56565;
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast-warning {
    border-left-color: #ed8936;
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast-info {
    border-left-color: #4299e1;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #374151;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #374151;
    background: rgba(0, 0, 0, 0.05);
}

/* Search Interface Styles */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.search-interface {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.search-input-group, .search-result-group {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input-group::before {
    content: "Yiddish";
    position: absolute;
    top: -8px;
    right: 12px;
    background: white;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    border-radius: 4px;
    z-index: 1;
}

.search-result-group::before {
    content: "English";
    position: absolute;
    top: -8px;
    left: 12px;
    background: white;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    border-radius: 4px;
    z-index: 1;
}

.search-input-group input, .search-result-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input-group input {
    font-family: "Frank Ruhl Libre", serif;
    direction: rtl;
    background: white;
    border-color: #cbd5e0;
}

.search-result-group input {
    font-family: "Anek Devanagari", serif;
    direction: ltr;
    background: #f7fafc;
    border-color: #cbd5e0;
}

.search-input-group input:focus {
    outline: none;
    border-color: #3182ce;
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.search-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Upload Modal Styles */
.upload-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-method {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.upload-method:has(input:checked) {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-method label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.upload-method input[type="radio"] {
    margin: 0;
    accent-color: #667eea;
}

.image-preview {
    text-align: center;
    margin-top: 1rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Camera Interface */
.camera-preview {
    text-align: center;
    margin-top: 1rem;
}

.camera-preview video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 0;
    }
    
    .header-nav {
        padding: 0.6rem 1rem;
        justify-content: flex-start;
        position: relative;
        min-height: 48px;
    }
    
    .main-title {
        font-size: 1.2rem;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 80px);
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    /* Hide the navigation bar on mobile */
    .nav-bar {
        display: none;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        position: relative;
        z-index: 10;
        margin-right: 0;
    }
    
    /* Hide desktop navigation on mobile */
    .page-nav {
        display: none;
    }
    
    .account-dropdown {
        display: none;
    }
    
    .app-container {
        padding: 1rem;
    }
    
    .entry-container {
        padding: 1rem;
    }
    
    .entry-row {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem 0;
        align-items: stretch;
        border-bottom: 2px solid #f0f0f0;
    }
    
    .row-number {
        display: none; /* Hide row numbers on mobile */
    }
    
    .input-group {
        margin-right: 0;
        margin-bottom: 0.75rem;
    }
    
    .input-group.yiddish-group {
        order: 1; /* Yiddish on top */
    }
    
    .input-group.english-group {
        order: 2; /* English below Yiddish */
    }
    
    .button-row {
        order: 3; /* Buttons after inputs */
        display: flex;
        gap: 0.75rem;
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .button-row .action-btn,
    .button-row .note-btn {
        flex: 1 !important; /* Equal width - override desktop styles */
        margin: 0 !important; /* Reset margins */
        padding: 0.75rem !important;
        border-radius: 8px;
        font-size: 0.9rem;
        font-weight: 600;
        width: auto !important; /* Override any fixed widths */
        height: auto !important;
        min-height: 44px; /* Ensure consistent height */
        max-width: none !important; /* Remove max-width constraints */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .button-row .action-btn {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        color: white;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .button-row .action-btn:hover {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        transform: translateY(-1px);
    }
    
    .button-row .note-btn {
        background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
        color: white;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .button-row .note-btn:hover {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        transform: translateY(-1px);
    }
    
    .button-row .note-btn.active {
        background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
        color: white;
    }
    
    .button-row .note-btn.has-note {
        background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    }
    
    .input-group:last-of-type {
        margin-bottom: 0;
    }
    
    .yiddish-input, .translation-input {
        padding: 1rem;
        font-size: 1.1rem;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .yiddish-input {
        background: white;
        border-color: #cbd5e0;
        font-size: 1.3rem;
        font-weight: 500;
        position: relative;
    }
    
    .translation-input {
        background: #f7fafc;
        border-color: #cbd5e0;
    }
    
    .input-group {
        position: relative;
        margin-bottom: 0.75rem;
    }
    
    .input-group::before {
        content: attr(data-label);
        position: absolute;
        top: -0.5rem;
        left: 0.75rem;
        font-size: 0.75rem;
        color: #4a5568;
        background: #f8f9fc;
        padding: 0 0.25rem;
        font-weight: 600;
        z-index: 1;
    }
    
    .input-group.yiddish-group::before {
        content: "Yiddish";
        right: 0.75rem;
        left: auto;
        color: #4a5568;
        background: #f8f9fc;
    }
    
    .input-group.english-group::before {
        content: "English";
        color: #4a5568;
        background: #f8f9fc;
    }
    
    .yiddish-input:focus {
        border-color: #3182ce;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    }
    
    .translation-input:focus {
        border-color: #3182ce;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    }
    
    .notes-container {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: 32px !important; /* Fixed height instead of auto */
        min-height: 32px !important; /* Exact 2rem in pixels */
        max-height: 32px !important; /* Prevent expansion */
        margin-top: 0.5rem;
        order: 4; /* Place after buttons */
        background: #f8f9fa;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        overflow: hidden !important; /* Force hide overflow */
        transition: all 0.3s ease;
    }
    
    .notes-container.show {
        transform: none;
        display: block;
        border-color: #1e40af;
        background: #fff;
    }
    
    .notes-container .notes-textarea {
        min-height: 32px !important;
        height: 32px !important; /* Fixed height */
        max-height: 32px !important; /* Prevent expansion */
        padding: 0.5rem !important; /* Reduced padding */
        resize: none !important; /* Disable resize */
        border: none;
        background: transparent !important;
        font-size: 0.9rem; /* Smaller font */
        line-height: 1.2; /* Tighter line height */
        overflow: hidden !important; /* Hide scrollbars */
        box-sizing: border-box !important;
    }
    
    .notes-textarea:focus {
        outline: none;
        background: transparent;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        position: sticky;
        bottom: 1rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 1rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin: 1rem auto; /* Center the container */
        width: 100%;
        max-width: 300px; /* Limit width */
        text-align: center; /* Center everything inside */
    }
    
    .action-button {
        width: 100%;
        max-width: 200px;
        min-width: 160px;
        padding: 0.75rem;
        font-size: 0.95rem;
        border-radius: 10px;
        font-weight: 600;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
        margin: 0 auto; /* Ensure centering */
    }
    
    .action-button.primary {
        background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
        transform: scale(1.02);
        border-color: #1e40af;
    }
    
    .action-button:hover, .action-button:active {
        transform: translateY(-1px) scale(1.02);
    }
    
    .action-button.primary:hover, .action-button.primary:active {
        transform: translateY(-1px) scale(1.07);
    }
    
    .download-dropdown {
        width: 100%;
        max-width: 300px;
    }
    
    .download-dropdown .action-button {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 75vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 0.25rem 1rem; /* Almost half of desktop size */
    }
    
    .modal-header h2 {
        font-size: 0.9rem; /* Very small for mobile */
    }
    
    .modal-body {
        padding: 0.75rem 1rem;
    }
    
    /* Mobile modal actions - force row layout */
    .modal-actions {
        flex-direction: row !important; /* Force row even on mobile */
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.25rem;
    }
    
    .modal-actions .btn {
        flex: 1;
        min-width: 80px;
        max-width: none;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Modal form content padding */
    #addWordModal form,
    #editWordModal form {
        padding: 0; /* Remove extra padding on mobile */
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    /* Modal input styling for mobile */
    #addWordModal input,
    #editWordModal input {
        padding: 0.6rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .modal-actions {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .toast-container {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: auto;
        max-width: calc(100vw - 20px);
    }
    
    .toast {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        margin: 0 auto;
    }
    
    /* Search page mobile styles */
    .search-container {
        padding: 1rem;
    }
    
    .search-interface {
        background: white;
        border-radius: 16px;
        padding: 1.5rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        margin-bottom: 1.5rem;
    }
    
    .search-input-group {
        margin-bottom: 1.5rem;
        position: relative;
    }
    
    .search-input-group::before {
        content: "Yiddish";
        position: absolute;
        top: -0.5rem;
        right: 0.75rem;
        font-size: 0.75rem;
        color: #4a5568;
        background: white;
        padding: 0 0.25rem;
        font-weight: 600;
        z-index: 1;
    }
    
    .yiddish-input {
        padding: 1.25rem;
        font-size: 1.3rem;
        border-radius: 12px;
        background: white;
        border: 2px solid #cbd5e0;
    }
    
    .yiddish-input:focus {
        border-color: #3182ce;
        background: white;
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    }
    
    .search-results {
        margin-top: 1.5rem;
    }
    
    .result-item {
        padding: 1.5rem;
        margin-bottom: 1rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        border-left: 4px solid #667eea;
    }
    
    .result-yiddish {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
        color: #667eea;
    }
    
    .result-english {
        font-size: 1.2rem;
        color: #333;
        line-height: 1.4;
    }
    
    .result-actions {
        margin-top: 1rem;
        display: flex;
        gap: 0.5rem;
    }
    
    .result-action-btn {
        padding: 0.5rem 1rem;
        border: none;
        border-radius: 8px;
        background: #667eea;
        color: white;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .result-action-btn:hover {
        background: #5a67d8;
        transform: translateY(-1px);
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.2rem;
    }
    
    .mobile-menu-content {
        width: 260px;
    }
    
    .mobile-menu-overlay {
        display: none; /* Remove overlay on mobile as well */
    }
    
    .dropdown-content {
        min-width: 150px;
    }
    
    .notes-panel {
        padding: 0.5rem;
    }
    
    .notes-textarea {
        min-height: 2rem !important;
        font-size: 1rem;
    }
    
    .app-container {
        padding: 0.75rem;
    }
    
    .entry-container {
        padding: 0.75rem;
    }
    
    .yiddish-input, .translation-input {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .yiddish-input {
        font-size: 1.2rem;
    }
    
    .action-button {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-width: auto;
        max-width: 120px;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem 1rem 0.5rem 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    /* Compact form styling for mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    #addWordModal input,
    #editWordModal input {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem;
        font-size: 1rem;
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .action-buttons,
    .row-actions,
    .modal,
    .toast-container,
    .loading-overlay {
        display: none !important;
    }
    
    .entry-row {
        border-bottom: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .yiddish-input,
    .translation-input {
        border: none;
        background: none;
        font-size: 12pt;
    }
    
    .notes-panel {
        background: none;
        border: 1px solid #ccc;
        margin-top: 0.5rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .entry-row:hover {
        background-color: #e9ecef;
    }
    
    .yiddish-input:focus,
    .translation-input:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    }
}




.delete-button:hover {
    background-color: #c82333;
}

/* Authentication container */
.auth-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 400px;
    text-align: center;
    margin: auto;
}

.auth-container h2 {
    margin-bottom: 30px;
    color: #333;
    font-weight: 800;
    font-size: 2rem;
}

.auth-container input {
    width: 90%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: "Anek Devanagari", serif;
    font-size: 16px;
}

.auth-container button {
    width: 90%;
    padding: 12px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-family: "Anek Devanagari", serif;
    font-size: 16px;
    font-weight: 800;
}

.auth-container button:hover {
    background-color: #0056b3;
}

/* Guest button */
.guest-btn {
    background-color: #6c757d !important;
}

.guest-btn:hover {
    background-color: #5a6268 !important;
}

.auth-container hr {
    margin: 20px 0;
}

.auth-container p {
    margin-top: 15px;
    color: #666;
}

.auth-container a {
    color: #007BFF;
    text-decoration: none;
}

.auth-container a:hover {
    text-decoration: underline;
}

/* Search container */
.search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.search-box {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: "Frank Ruhl Libre", serif;
}

.search-box button {
    padding: 12px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Anek Devanagari", serif;
    font-weight: 800;
}

/* Dropdown list for search page compatibility */

.dropdown-item {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: "Frank Ruhl Libre", serif;
    text-align: right;
    direction: rtl;
}

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

/* Search results */
.search-results {
    margin-top: 20px;
}

.search-result {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yiddish-word {
    font-family: "Frank Ruhl Libre", serif;
    font-size: 18px;
    font-weight: bold;
    direction: rtl;
    text-align: right;
    flex: 1;
}

.translation {
    font-family: "Anek Devanagari", serif;
    font-size: 16px;
    direction: ltr;
    text-align: left;
    flex: 1;
    color: #666;
}

/* Enhanced Search Results */
.result-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #1e40af;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left-color: #2563eb;
}

/* Pagination Controls */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination button {
    background: #1e40af;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.pagination button:hover {
    background: #1e3a8a;
}

.pagination button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.pagination span {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #ddd;
    width: 50%;
    max-width: 500px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #333;
    font-family: "Anek Devanagari", serif;
}

.modal-content input[type="text"],
.modal-content input[type="file"] {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: "Frank Ruhl Libre", serif;
}

.modal-content label {
    display: block;
    margin: 10px 0 5px 0;
    font-weight: bold;
    text-align: left;
    margin-left: 5%;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.form-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Anek Devanagari", serif;
    font-size: 14px;
    font-weight: 800;
}

.form-buttons button[type="submit"] {
    background-color: #0066cc;
    color: white;
}

.form-buttons button[type="button"] {
    background-color: #6c757d;
    color: white;
}

/* Replace the existing .close style (around line 850) with this: */

.close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    line-height: 1;
}

.close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007BFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-message {
    color: white;
    margin-top: 20px;
    font-family: "Anek Devanagari", serif;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

/* Small loading indicator */
.loading-small {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.loading-small span {
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 2px;
    background-color: #333;
    border-radius: 50%;
    animation: loading-small 1s infinite ease-in-out;
}

.loading-small span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-small span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading-small {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Notification */
.notification {
    min-width: 250px;
    max-width: 400px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
    font-family: "Anek Devanagari", serif;
    font-size: 16px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.notification.show {
    visibility: visible;
    opacity: 1;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.warning {
    background-color: #ffc107;
    color: #333;
}

.notification.info {
    background-color: #007bff;
}

/* Progress info */
.progress-info {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .auth-container {
        width: 90%;
        padding: 20px;
    }
    
    .search-container {
        padding: 10px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        margin-bottom: 10px;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    .entry {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-field {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls button {
        width: 80%;
        margin: 5px 0;
    }
}

/* Admin styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #007BFF;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

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

.action-buttons button {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { 
    margin-top: 20px; 
}

/* Sign-in page container styling - ADDED */
.sign-in-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* FORCE sign-in-container styling */
.sign-in-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: calc(100vh - 80px) !important;
    padding: 2rem !important;
}

/* Override auth-container when inside sign-in-container */
.sign-in-container .auth-container {
    margin: 0;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Enhanced auth form styling - ADDED */
.auth-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-header h2 {
    color: #333;
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 0.125rem;
    font-family: "Frank Ruhl Libre", serif;
}

.auth-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.auth-form {
    margin-bottom: 0.5rem;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    font-family: "Anek Devanagari", serif;
}

.btn-primary {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #ddd;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    color: #666;
    font-size: 14px;
}

.auth-links {
    text-align: center;
    margin-top: 2rem;
}

.auth-links p {
    margin: 0.5rem 0;
    color: #666;
}

.auth-links a {
    color: #007BFF;
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

.text-small {
    font-size: 14px;
}

/* Enhanced form group styling for auth pages - ADDED */
.auth-container .form-group {
    margin-bottom: 0.5rem;
    text-align: left;
}

.auth-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-family: "Anek Devanagari", serif;
}

.auth-container .form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: "Anek Devanagari", serif;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.auth-container .form-group input:focus {
    outline: none;
    border-color: #007BFF;
}

/* Mobile Touch Improvements */
@media (max-width: 768px) {
    /* Add touch-friendly interactions */
    * {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    }
    
    button, .mobile-menu-item, .action-button {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        touch-action: manipulation;
    }
    
    /* Improve scrolling on mobile */
    .app-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .entry-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Add subtle animations for better UX */
    .entry-row {
        transition: all 0.3s ease;
    }
    
    .entry-row:active {
        background-color: #f8f9fa;
        transform: scale(0.99);
    }
    
    .yiddish-input, .translation-input {
        transition: all 0.3s ease;
    }
    
    .yiddish-input:focus, .translation-input:focus {
        transform: translateY(-2px);
    }
    
    /* Improve button feedback */
    .action-button:active {
        transform: translateY(-1px) scale(0.98);
    }
    
    .mobile-menu-item:active {
        background-color: #e7f3ff;
    }
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 1rem 0;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.site-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-email {
    font-size: 0.9rem;
    margin: 0;
}

.footer-email a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-email a:hover {
    color: white;
    text-decoration: underline;
}

/* Ensure body takes full height for footer positioning */
.main-content {
    flex: 1;
}

/* Responsive footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 0.75rem 0;
    }
    
    .site-footer .footer-content {
        padding: 0 1rem;
    }
    
    .footer-email {
        font-size: 0.85rem;
    }
}

/* Instruction Modal Styles */
.instruction-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.instruction-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.instruction-modal-header {
    background: #f8f9fa;
    color: #333;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #e9ecef;
}

.instruction-modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.instruction-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    position: absolute;
    right: 1rem;
}

.instruction-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.instruction-modal-body {
    padding: 1.5rem;
    line-height: 1.6;
}

.instruction-step {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fc;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.instruction-step h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.instruction-step p {
    margin: 0.25rem 0;
    color: #4a5568;
}

.instruction-step ul {
    margin: 0.25rem 0;
    padding-left: 1.2rem;
}

.instruction-step li {
    margin: 0.15rem 0;
    color: #4a5568;
}

.instruction-button {
    position: relative;
    top: 0;
    left: 0;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    display: inline-block;
}

.instruction-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsiveness for instruction modal */
@media (max-width: 768px) {
    .instruction-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .instruction-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .instruction-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .instruction-modal-body {
        padding: 1.5rem;
    }
    
    .instruction-button {
        margin-bottom: 0.75rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .main-title {
        font-size: 1.1rem;
        max-width: calc(100% - 70px);
    }
    
    .header-nav {
        padding: 0.4rem 0.8rem;
    }
}

/* Verification Page Styles - Use existing modal structure */
.verification-alert {
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid;
    margin-bottom: 1rem;
}

.verification-alert.alert-success {
    background: #d1fae5;
    color: #047857;
    border-color: #10b981;
}

.verification-alert.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border-color: #ef4444;
}

.verification-alert.alert-info {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #3b82f6;
}

.btn-link:hover {
    color: #374151;
    text-decoration: underline;
}
