/* The Avâr Language Website Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #7f8c8d;
    --text-color: #2c3e50;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --link-color: #3498db;
    --link-hover: #2980b9;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--accent-color);
    font-size: 0.95rem;
}

nav {
    background-color: var(--secondary-color);
    padding: 0.75rem 0;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffffff;
}

/* Main content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.content-section {
    background-color: var(--card-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-section h3 {
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.content-section h4 {
    color: var(--secondary-color);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.content-section p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: var(--card-bg);
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

table th {
    background-color: var(--secondary-color);
    color: #ffffff;
    font-weight: 600;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #e8e9ea;
}

/* Search */
.search-container {
    margin: 2rem 0;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: var(--link-color);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-hover);
}

.search-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #e8e9ea;
}

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

/* Vocabulary list */
.vocabulary-list {
    margin-top: 2rem;
}

.vocabulary-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--card-bg);
    border-left: 4px solid var(--link-color);
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vocabulary-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.vocabulary-item.hidden {
    display: none;
}

.vocab-english {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.vocab-type {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-style: italic;
    margin-left: 0.5rem;
}

.vocab-avar {
    font-size: 1.05rem;
    color: var(--secondary-color);
    margin: 0.25rem 0;
}

.vocab-arabic {
    font-size: 1.2rem;
    direction: rtl;
    text-align: right;
    font-family: 'Arial', sans-serif;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

/* Alphabet table */
.alphabet-table {
    font-size: 0.95rem;
}

.alphabet-table td {
    vertical-align: middle;
}

.unicode-info {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: #ecf0f1;
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
}

footer a {
    color: #ecf0f1;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--accent-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--accent-color);
}

.empty-state p {
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Search highlight */
mark {
    background-color: #fff3cd;
    color: var(--text-color);
    padding: 0;
    border-radius: 2px;
    display: inline;
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin: 0.25rem 0;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Grammar pages */
.grammar-table {
    width: auto;
    min-width: 60%;
    max-width: 100%;
    font-size: 0.95rem;
}

.grammar-table th,
.grammar-table td {
    padding: 0.45rem 0.85rem;
}

.grammar-table.compact th,
.grammar-table.compact td {
    padding: 0.3rem 0.7rem;
    font-size: 0.9rem;
}

.grammar-table .latin {
    font-style: italic;
}

.grammar-table .cyr {
    font-family: "Times New Roman", Georgia, serif;
}

.grammar-table .gloss {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.grammar-table .case-label {
    font-weight: 600;
    background-color: #f8f9fa;
    white-space: nowrap;
}

.example {
    margin: 0.5rem 0 1rem 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--border-color);
}

.example .av {
    font-style: italic;
}

.example .cyr {
    color: var(--accent-color);
}

.example .en {
    margin-top: 0.15rem;
}

.editor-note {
    margin: 1rem 0;
    padding: 0.6rem 0.9rem;
    background: #fbfaf6;
    border-left: 3px solid #c9b88a;
    font-size: 0.92rem;
    color: #555;
}

.editor-note::before {
    content: "Editor's note: ";
    font-weight: 600;
    color: #8a7a3a;
}

.lead {
    font-size: 1.02rem;
}
