/**
 * Ghomashi Dictionary - Main Stylesheet
 * ghomashi.eu
 */

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

:root {
    --primary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --accent: #3b82f6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text: #1e293b;
    --nav-text: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: var(--text);
    line-height: 1.6;
}

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

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.stat-box {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

nav {
    margin-top: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
}

.search-box {
    position: relative;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 1.2rem 3.5rem 1.2rem 1.5rem;
    font-size: 1.1rem;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    outline: none;
    transition: all 0.3s;
    background: white;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
}

.search-icon:hover {
    color: var(--accent);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 16px 16px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
}

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

.autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f8fafc;
}

.autocomplete-item.selected {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

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

/* Language Tabs */
.language-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab {
    padding: 1rem 2rem;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text);
}

.tab:hover {
    background: #e2e8f0;
}

.tab.active {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Slides Section */
.slides-section {
    margin-bottom: 3rem;
    text-align: center;
}

.slide-container {
    position: relative;
    min-height: 100px;
}

.slide {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    display: none;
    animation: fadeIn 0.5s;
}

.slide.active {
    display: block;
}

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

/* Results Section */
.results-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: var(--accent);
}

.word-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.word-main {
    font-size: 1.1rem;
    font-weight: ;
    color: var(--text);
    flex: 1;
}

.audio-icon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: white;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.audio-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.word-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Translations */
.translations {
    margin-top: 1.5rem;
}

.translation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
    color: #1e40af;
    padding: 0.6rem 1.2rem;
    border-radius: 24px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: default;
}

.tag:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Example Sentences */
.examples-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.examples-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 1rem;
}

.example-tags {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-tag {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.2s;
}

.example-tag:hover {
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.example-de {
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.example-fa {
    color: #475569;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    font-family: 'Tahoma', 'Arial', sans-serif;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.no-results p {
    font-size: 1.2rem;
    color: #64748b;
}

/* Footer */
footer {
    background: #1e293b;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .results-section {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .container {
        padding: 1rem;
    }

    .results-section {
        grid-template-columns: 1fr;
    }

    .language-tabs {
        flex-direction: column;
    }

    .tab {
        width: 100%;
    }
}

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

    .search-input {
        font-size: 1rem;
        padding: 1rem 3rem 1rem 1rem;
    }

    .word-main {
        font-size: 1.4rem;
    }

    .tag {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }
}