/* Nukta Kamusi - Modern Theme with Mobile Support */

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

:root {
    --primary-color: #1E90FF;
    --primary-dark: #1873cc;
    --secondary-color: #000000;
    --tertiary-color: #1f2937;
    --light-bg: #ffffff;
    --dark-bg: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #666666;
    --border-color: #e5e7eb;
    --hover-color: #f3f4f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--secondary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo span {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* Main Container */
.container {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    position: relative;
}

/* Main Content - Default view when no columns are shown */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--light-bg);
}

/* Two-column layout for languages and threads */
.two-column-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

.languages-column {
    width: 300px;
    min-width: 300px;
    background-color: var(--secondary-color);
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.threads-column {
    flex: 1;
    min-width: 300px;
    overflow-y: auto;
    background-color: var(--light-bg);
    border-left: 1px solid var(--border-color);
}

/* Main content area when language is selected */
.main-content {
    flex: 2;
    display: none; /* Hidden by default, shown when language is selected */
    overflow-y: auto;
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-left: 1px solid var(--border-color);
}

/* When main content is shown, adjust the layout */
.main-content.active {
    display: block;
}

/* Adjust the two-column layout when main content is shown */
.main-content.active ~ .two-column-layout .threads-column {
    display: none;
}

.main-content.active ~ .two-column-layout {
    width: 300px;
    flex: 0 0 300px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header .subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: white;
    border-bottom-color: var(--primary-color);
}

/* Sidebar Content */
#sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #ffffff;
}

/* Welcome Screen */
#main-content.welcome-screen {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.welcome-content {
    max-width: 1000px;
    margin: 0 auto;
}

.welcome-content h1 {
    color: #2d3748;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.welcome-subtitle {
    color: #4a5568;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 400;
}

.welcome-message {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    line-height: 1.8;
    text-align: center;
    display: none;
}

.featured-languages {
    margin: 2rem 0;
    text-align: center;
}

.featured-languages h3 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

.language-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.language-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
    display: none;
}

.feature {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature h3 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.feature p {
    color: #4a5568;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cta-text {
    text-align: center;
    font-weight: 500;
    color: #2d3748;
    margin-top: 2rem;
    display: none;
}

/* Chat Interface - Ollama Web UI Style (Dark Theme) */
.chat-container {
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2rem;
    padding-bottom: 0;
}

.chat-header {
    background: #2d2d3d;
    color: white;
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid #3d3d4d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.chat-header p {
    margin: 0;
    opacity: 0.7;
    font-size: 0.85rem;
    font-weight: 400;
    color: #a0a0b0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Empty State - Centered Content */
.chat-messages.empty-state {
    text-align: center;
}

.chat-empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.chat-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 2rem;
}

.chat-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 900px;
}

.suggestion-card {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.suggestion-card:hover {
    background: #ffffff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.suggestion-title {
    font-weight: 600;
    color: #333333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.suggestion-description {
    font-size: 0.85rem;
    color: #666666;
    line-height: 1.4;
}

.message {
    display: flex;
    gap: 1rem;
    animation: slideIn 0.3s ease;
    width: 100%;
    max-width: 900px;
}

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

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

.user-message .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-content {
    flex: 1;
    max-width: 85%;
}

.message p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
    color: #e0e0e0;
}

.message ul, .message ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding: 0;
}

.message li {
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.bot-message {
    flex-direction: row;
}

.user-message {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.user-message .message-content {
    text-align: right;
    background: #3d3d4d;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: #ffffff;
}

.chat-input-container {
    display: flex;
    padding: 1.5rem;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 0.75rem;
    align-items: flex-end;
    position: sticky;
    bottom: 0;
    margin: 0 -2rem -0 -2rem;
    padding: 1.5rem 2rem;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 1rem;
    background: #f9f9f9;
    color: #333333;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.chat-input::placeholder {
    color: #999999;
}

.chat-send-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: #764ba2;
    transform: scale(1.05);
}

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

/* Language View */
.language-view {
    animation: fadeIn 0.3s ease;
    padding: 2rem;
}

.language-header {
    margin-bottom: 1rem;
}

.language-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.language-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.125rem 0;
    display: inline-block;
    margin-right: 1rem;
}

.language-header .language-code,
.language-header .language-country {
    display: inline-block;
    margin: 0.25rem 0;
    padding: 0.25rem 0.75rem;
    background: var(--dark-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 3px;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

.language-header .language-code strong,
.language-header .language-country strong {
    color: var(--text-primary);
    font-weight: 600;
}

.language-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.75rem 0;
}

/* Add Word Section */
.add-word-section {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.add-word-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.add-word-section form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Enhanced inputs for rich word entry */
.add-word-section .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}
.translations-repeater {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.translation-row {
    display: grid;
    grid-template-columns: 160px 1fr 32px;
    gap: 8px;
}
.translation-row .remove-translation {
    background: #efefef;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}
#add-translation-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
}

.add-word-section input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.add-word-section button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.add-word-section button:hover {
    background: var(--primary-dark);
}

/* Words Section */
.words-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.words-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.word-item {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.word-item-word { font-weight: 600; font-size: 1.05rem; color: var(--text-primary); }
.word-item-word .phonetic { color: var(--text-secondary); font-weight: 400; margin-left: 6px; }
.word-item-meta { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }
.word-item-translation { color: var(--text-primary); margin-top: 6px; line-height: 1.5; }
.badge { display: inline-block; padding: 2px 6px; font-size: 11px; border-radius: 999px; background: #eef2ff; color: #1e3a8a; margin-right: 6px; }
.word-item-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f1f5f9; color: #0f172a; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.tag-muted { background: #f8fafc; color: #475569; }
.word-item-morph { color: #475569; font-size: 0.85rem; margin-top: 6px; }

.word-item .translation {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.word-item .date {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Languages List */
.languages-search {
    padding: 10px;
}

.languages-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
}

.languages-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.languages-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.language-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.language-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.language-item-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.language-item-code {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* Threads List */
.threads-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.thread-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.thread-item-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.thread-item-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* New Thread Button */
.new-thread-btn {
    padding: 10px;
}

.new-thread-btn button {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.new-thread-btn button:hover {
    background: var(--primary-dark);
}

/* 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);
}

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

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-body input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.modal-body button {
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.modal-body button:hover {
    background: var(--primary-dark);
}

/* HTMX Loading States */
.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-indicator {
    display: none;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 200ms ease-out;
}

/* Dictionary Section */
.dictionary-section {
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.dictionary-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Words list */
.words-list {
    margin: 2rem 0;
    min-height: 100px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.word-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.word-item-header {
    position: relative;
    padding-right: 2rem;
}

.delete-word-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.delete-word-btn:hover {
    opacity: 1;
    background-color: #fff5f5;
}

.word-item-word {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2d3748;
    display: inline-block;
}

.word-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.word-item-word {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.phonetic {
    color: #718096;
    font-size: 0.9em;
    margin-left: 0.5rem;
}

.word-item-meta {
    color: #4a5568;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.word-item-translation {
    margin: 0.75rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
}

.word-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.tag {
    background: #edf2f7;
    color: #4a5568;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.tag-muted {
    background: #f7fafc;
    color: #a0aec0;
}

.word-item-morph {
    color: #718096;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.word-item-date {
    color: #a0aec0;
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* Success message */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
    border-radius: 0.25rem;
    text-align: center;
}

/* Form styles */
.add-word-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.translations-repeater {
    margin: 1rem 0;
}

.translation-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.translation-row input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.remove-translation {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
    padding: 0.5rem;
    cursor: pointer;
}

.remove-translation:hover {
    background: #f1b0b7;
}

#add-translation-btn {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

#add-translation-btn:hover {
    background: #d5d8dc;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 3rem 0 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.pagination-btn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
    font-weight: 600;
}

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

.pagination-ellipsis {
    padding: 8px 4px;
    color: var(--text-secondary);
    user-select: none;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

/* Welcome Screen - Ollama Dark Style */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #2d2d3d;
    padding: 2rem;
}

.welcome-content {
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.welcome-content h1 {
    font-size: 3.5rem;
    margin: 0;
    color: #ffffff;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.welcome-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Scrollbar Styling for Dark Theme */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #2d2d3d;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #4d4d5d;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5d5d6d;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
    }

    .hamburger-menu {
        display: flex;
    }

    .header-actions {
        display: none;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        flex: 1;
        overflow: visible;
        min-height: calc(100vh - 60px);
    }

    #main-content {
        padding: 1.5rem;
        overflow: visible;
    }

    .language-view {
        padding: 1rem;
    }

    .language-header h2 {
        font-size: 1.5rem;
    }

    .words-list {
        grid-template-columns: 1fr;
    }

    .add-word-section form {
        flex-direction: column;
    }

    .add-word-section input {
        min-width: auto;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    /* Welcome Screen Mobile */
    .welcome-screen {
        padding: 1rem;
        background: #2d2d3d;
    }

    .welcome-content {
        max-width: 100%;
    }

    .welcome-content h1 {
        font-size: 2.5rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
        color: #a0a0b0;
    }

    .chat-container {
        height: 100%;
        max-width: 100%;
        padding: 1rem;
        padding-bottom: 0;
    }

    .chat-messages {
        padding: 1.5rem;
        background: #ffffff;
    }

    .message-content {
        max-width: 95%;
    }

    .chat-suggestions {
        grid-template-columns: 1fr;
    }

    .suggestion-card {
        background: #f5f5f5;
        border-color: #e0e0e0;
    }

    .chat-input-container {
        margin: 0 -1rem -0 -1rem;
        padding: 1rem;
    }

    .language-tags {
        gap: 0.5rem;
    }

    .language-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Language Metadata Styling */
.language-alternate-names,
.language-keywords {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--dark-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 3px;
}

.language-alternate-names h4,
.language-keywords h4 {
    color: var(--primary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.language-alternate-names p,
.language-keywords p {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.language-item-alt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
}

.languages-search input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.languages-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }

    .logo-text span {
        display: inline;
    }

    .language-header h2 {
        font-size: 1.25rem;
    }

    .language-header p {
        font-size: 0.9rem;
    }

    .language-code,
    .language-country,
    .language-alternate-names,
    .language-keywords {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    #main-content {
        padding: 1rem;
    }

    .add-word-section {
        padding: 1rem;
    }

    .word-item {
        padding: 0.75rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }
}

