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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 70px; /* Space for fixed navbar */
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Gradient Text Utility */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fallback for older browsers */
    color: #667eea;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 70px;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Brand/Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-logo {
    width: 40px;
    height: 40px;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation Links */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    /* Button reset styles */
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #667eea;
}

.nav-link.active,
.nav-link[aria-selected="true"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
}

.language-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.language-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.language-btn.active {
    background: #667eea;
    color: white;
}

.language-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Notifications */
.navbar-notifications {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: #333;
    position: relative;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: #f5f5f5;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #f44336;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-outline-nav {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-outline-nav:hover {
    background: #667eea;
    color: white;
}

.btn-primary-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-primary-nav:hover {
    opacity: 0.9;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border: none;
    padding: 6px 12px 6px 6px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-toggle:hover {
    background: #e8e8e8;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-email-nav {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    color: #666;
    transition: transform 0.2s ease;
}

.user-menu-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    padding: 8px 0;
    z-index: 1001;
    animation: slideDown 0.2s ease;
}

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

.dropdown-header {
    padding: 12px 16px;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-email {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.dropdown-status {
    font-size: 0.8rem;
    color: #999;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    font-family: inherit;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item svg {
    color: #666;
    flex-shrink: 0;
}

.dropdown-item-danger {
    color: #f44336;
}

.dropdown-item-danger:hover {
    background: #ffebee;
}

.dropdown-item-danger svg {
    color: #f44336;
}

/* Admin Panel Link Styling */
#adminPanelLink {
    color: #2196F3;
    font-weight: 500;
}

#adminPanelLink:hover {
    background: #e3f2fd;
}

#adminPanelLink svg {
    color: #2196F3;
}

/* ============================================
   CONVERTER TAB LAYOUT
   ============================================ */

.converter-layout {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-label {
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.input-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

.input-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Conversions Panel */
.conversions-panel {
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.conversions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px 12px 0 0;
}

.conversions-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.3rem;
}

.conversions-actions {
    display: flex;
    gap: 10px;
}

.conversions-list {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 700px;
}

.empty-conversions {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-conversions p {
    margin: 0;
    font-size: 1.1rem;
}

/* Conversion Card */
.conversion-card {
    background: white;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    overflow: visible;
    transition: all 0.2s ease;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversion-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.conversion-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.conversion-timestamp {
    font-size: 0.85rem;
    color: #999;
}

.conversion-card-actions {
    display: flex;
    gap: 8px;
    position: relative;
}

/* Context Menu */
.context-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 100;
    display: none;
    overflow: hidden;
}

.context-menu.show {
    display: block;
    animation: contextMenuFadeIn 0.15s ease;
}

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

.context-menu-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #333;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item.context-menu-info {
    cursor: default;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.4;
}

.context-menu-item.context-menu-info:hover {
    background: transparent;
}

.context-menu-timestamp {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

.context-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

.context-menu-btn-danger {
    color: #dc3545;
}

.context-menu-btn-danger:hover {
    background: #fff5f5;
}

.conversion-content {
    display: flex;
    gap: 0;
}

.conversion-content.vertical-layout {
    flex-direction: column;
}

.conversion-pane {
    flex: 1;
    padding: 15px;
    min-width: 0;
}

/* English pane - cool blue tint */
.conversion-pane.english-pane {
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.12));
    border-right: 1px solid rgba(59, 130, 246, 0.2);
}

/* Romanian pane - warm peach/coral tint */
.conversion-pane.romanian-pane {
    background: linear-gradient(to bottom, rgba(251, 146, 60, 0.08), rgba(251, 146, 60, 0.12));
}

/* Vertical layout adjustments */
.conversion-content.vertical-layout .conversion-pane.english-pane {
    border-right: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.conversion-pane-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-copy-pane {
    padding: 4px 8px;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy-pane:hover {
    background: #667eea;
    color: white;
}

.conversion-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    white-space: normal;
    padding: 8px;
}

/* Editable word spans */
.editable-word-span {
    display: inline;
    padding: 0;
    margin: 0;
    border-radius: 3px;
    cursor: text;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
}

.editable-word-span:hover {
    background: rgba(249, 249, 249, 0.8);
    border-color: #e0e0e0;
    padding: 2px 4px;
    margin: 0 -4px; /* Negative margin to compensate for padding */
}

.editable-word-span:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    padding: 2px 4px;
    margin: 0 -4px; /* Negative margin to compensate for padding */
}

/* User-edited words - always highlighted */
.editable-word-span.user-edited {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.3);
    font-weight: 500;
    position: relative;
}

.editable-word-span.user-edited::after {
    content: '✎';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    color: #667eea;
    background: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.editable-word-span.user-edited:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
}

.editable-word-span.user-edited:focus {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: #667eea;
}

/* Inline word edit input */
.word-edit-input {
    font-family: inherit;
    font-size: inherit;
    padding: 2px 4px;
    margin: 0;
    border: 1px solid #667eea;
    border-radius: 3px;
    outline: none;
    background: white;
    min-width: 80px;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.editable-word-span.editing {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

.conversion-divider {
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.conversion-content.vertical-layout .conversion-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.alignment-indicator {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.9rem;
    opacity: 0.8;
    cursor: help;
    transition: opacity 0.2s ease;
}

.alignment-indicator:hover {
    opacity: 1;
}

.alignment-indicator.grouped {
    opacity: 0.9;
}

.converter-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Controls Bar */
.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

/* Split View Container */
.split-text-container {
    display: flex;
    gap: 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 500px;
    background: white;
    transition: flex-direction 0.3s ease;
}

/* Vertical layout mode */
.split-text-container.vertical-layout {
    flex-direction: column;
}

.split-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex item from overflowing */
}

.pane-label {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 2px solid #5568d3;
}

.split-pane textarea {
    flex: 1;
    width: 100%;
    padding: 15px;
    border: none;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: none;
    transition: background-color 0.3s;
}

.split-pane textarea:focus {
    outline: none;
    background-color: #fffef7;
}

.split-pane.right-pane textarea {
    background-color: #f9f9f9;
}

.split-pane.right-pane textarea:focus {
    background-color: #f5f5f5;
}

/* Split Divider */
.split-divider {
    width: 3px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.split-divider::before {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Vertical layout divider */
.split-text-container.vertical-layout .split-divider {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.split-text-container.vertical-layout .split-divider::before {
    content: '⋯';
}

/* Legacy label styles (kept for other parts of the app) */
label {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

/* Legacy textarea styles (for non-split textareas) */
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

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

textarea[readonly] {
    background-color: #f9f9f9;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-panel,
.manual-correction,
.recent-words {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.stats-panel h3,
.manual-correction h3,
.recent-words h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#stats p,
#recentWords p {
    color: #666;
    line-height: 1.8;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item:last-child {
    border-bottom: none;
}

.correction-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.correction-input:focus {
    outline: none;
    border-color: #667eea;
}

.word-list {
    max-height: 300px;
    overflow-y: auto;
}

.word-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.word-item:last-child {
    border-bottom: none;
}

.word-item .english {
    color: #333;
    font-weight: 600;
}

.word-item .romanian {
    color: #667eea;
}

.word-item .count {
    color: #999;
    font-size: 0.8rem;
}

footer {
    background: #f9f9f9;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 2px solid #e0e0e0;
}

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

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    animation: slideDown 0.3s;
}

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

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
}

.modal-instruction {
    margin-bottom: 15px;
    color: #666;
    font-size: 1rem;
}

#editableOutput {
    width: 100%;
    min-height: 300px;
}

.modal-footer {
    padding: 20px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.modal-footer button {
    white-space: nowrap;
    min-width: fit-content;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
    z-index: 2000;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #f44336;
}

/* History Panel Styles */
.history-panel {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-header h3 {
    color: #667eea;
    margin: 0;
    font-size: 1.2rem;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.history-stats {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.history-stats p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

#historyList {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.15s ease;
}

.history-item:hover {
    border-color: #667eea;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-date {
    font-size: 0.8rem;
    color: #999;
}

.history-delete {
    background: transparent;
    border: none;
    color: #f44336;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.history-delete:hover {
    transform: scale(1.2);
}

.history-text {
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    margin: 4px 0;
    padding: 6px;
    background: #f9f9f9;
    border-radius: 4px;
}

.history-text-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 2px;
}

.history-english {
    color: #333;
}

.history-romanian {
    color: #667eea;
}

.history-arrow {
    text-align: center;
    color: #999;
    margin: 4px 0;
    font-size: 0.8rem;
}

/* Interactive Word Editor Styles */
.interactive-view {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    margin-top: 15px;
}

.interactive-panel {
    margin-bottom: 20px;
}

.interactive-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.interactive-text {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    min-height: 100px;
    line-height: 2;
    font-size: 1.05rem;
    font-family: 'Courier New', monospace;
}


/* ===== AUTHENTICATION STYLES ===== */

/* Email Verification Banner */
.email-banner {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.email-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.email-banner-dismiss {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.email-banner-dismiss:hover {
    background: rgba(255,255,255,0.5);
}

/* Legacy user-email style (kept for backwards compatibility) */
.user-email {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

/* Auth Modal */
.auth-modal-content {
    max-width: 450px;
    margin: 50px auto;
}

.auth-form {
    padding: 10px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid #c62828;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-switch a {
    color: #4CAF50;
    font-weight: 500;
    text-decoration: none;
}

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

/* Sign In Prompts */
.sign-in-prompt {
    background: #e3f2fd;
    border: 2px dashed #2196F3;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.sign-in-prompt p {
    margin: 0;
    font-size: 14px;
    color: #1976d2;
}

.sign-in-prompt a {
    color: #1976d2;
    font-weight: 600;
    text-decoration: none;
}

.sign-in-prompt a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet and below */
@media (max-width: 1024px) {
    .navbar-title {
        font-size: 1.2rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .user-email-nav {
        display: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .navbar {
        height: 60px;
    }

    .navbar-container {
        padding: 0 15px;
    }

    .navbar-title {
        font-size: 1.1rem;
    }

    .navbar-logo {
        width: 32px;
        height: 32px;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    /* Hide desktop navigation */
    .navbar-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .navbar-nav.mobile-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        text-align: left;
    }

    /* Mobile navbar actions */
    .navbar-actions {
        order: 1;
        margin-right: auto;
    }

    .auth-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-outline-nav,
    .btn-primary-nav {
        width: 100%;
        justify-content: center;
    }

    .user-menu-toggle {
        padding: 4px 8px 4px 4px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .user-dropdown {
        right: -15px;
        left: auto;
        min-width: calc(100vw - 30px);
        max-width: 300px;
    }

    .container {
        margin: 10px auto;
        border-radius: 12px;
    }

    .email-banner-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .auth-modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    /* Mobile converter layout adjustments */
    .converter-layout {
        padding: 20px;
        gap: 20px;
    }

    .controls {
        padding: 12px;
        gap: 10px;
    }

    .controls .btn-small {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .conversions-list {
        max-height: 500px;
    }

    .conversion-content {
        flex-direction: column;
    }

    .conversion-divider {
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .navbar-brand {
        gap: 8px;
    }

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

    .btn-outline-nav,
    .btn-primary-nav {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .notification-btn {
        padding: 6px;
    }
}

/* ============================================
   TAB SYSTEM
   ============================================ */

.tab-content-container {
    position: relative;
    min-height: 500px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInSlideUp 0.3s ease-in;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PAGE SECTIONS (Dictionary, How It Works, About)
   ============================================ */

.section-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 30px;
}

.section-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
}

.section-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ============================================
   DICTIONARY TAB LAYOUT
   ============================================ */

.dictionary-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    padding: 30px;
}

.dictionary-main {
    min-width: 0;
}

.dictionary-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 1024px) {
    .dictionary-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   DICTIONARY SECTION
   ============================================ */

.dictionary-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dictionary-search {
    flex: 1;
    min-width: 300px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.dictionary-search:focus {
    outline: none;
    border-color: #667eea;
}

.dictionary-stats-summary {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

.dictionary-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dictionary-table {
    width: 100%;
    border-collapse: collapse;
}

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

.dictionary-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.dictionary-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.15s ease;
}

.dictionary-table tbody tr:hover {
    background: #f9f9f9;
}

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

.dictionary-table td {
    padding: 15px 20px;
    color: #333;
    font-size: 0.95rem;
}

.dictionary-table td:first-child {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.dictionary-table td:nth-child(2) {
    font-family: 'Courier New', monospace;
    color: #667eea;
}

.dictionary-table td:nth-child(3) {
    color: #999;
    font-weight: 600;
}

.dictionary-table td.loading-cell {
    text-align: center;
    padding: 30px;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.empty-state p {
    color: #999;
    font-size: 1.1rem;
    margin: 0;
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */

.how-it-works-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.step-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #667eea;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.step-card h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.step-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.tech-stack {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 2px solid #e0e0e0;
}

.tech-stack h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.example-conversion {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.example-conversion h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.conversion-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.flow-step {
    flex: 1;
    min-width: 150px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.flow-label {
    font-size: 0.85rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flow-value {
    font-size: 1.2rem;
    color: #333;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.flow-arrow {
    font-size: 2rem;
    color: #667eea;
    font-weight: 600;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.about-description {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.about-description p {
    color: #666;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

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

.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: #666;
    font-size: 1.05rem;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 700;
    font-size: 1.3rem;
}

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

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.about-footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.about-footer h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.about-footer p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
}

.inline-link {
    color: white;
    font-weight: 700;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.inline-link:hover {
    opacity: 0.8;
}

/* ============================================
   RESPONSIVE STYLES FOR NEW SECTIONS
   ============================================ */

@media (max-width: 768px) {
    .section-content {
        padding: 30px 20px;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1rem;
    }

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

    .dictionary-table th,
    .dictionary-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .how-it-works-content {
        grid-template-columns: 1fr;
    }

    .conversion-flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

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

    .about-footer {
        padding: 30px 20px;
    }

    .about-footer h3 {
        font-size: 1.5rem;
    }

    .about-footer p {
        font-size: 1rem;
    }
}
