/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Шапка */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo h1 {
    font-size: 32px;
    color: #2c3e50;
    font-weight: 700;
}

/* Основной контент */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.dictionary-header {
    text-align: center;
    margin-bottom: 40px;
}

.dictionary-header h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.description {
    font-size: 16px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}


/* Категории словаря */
.categories-section {
    margin-top: 30px;
    margin-bottom: 30px;
}

.categories-section h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-item {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: #f0f0f0;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-item-active {
    background-color: #3498db;
    border-color: #3498db;
    color: #fff;
}

.category-item-active .category-name {
    color: #fff;
}

.category-item-active .category-count {
    color: #ecf0f1;
}

.category-name {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
}

.category-count {
    font-size: 13px;
    color: #7f8c8d;
}

.category-reset-btn {
    padding: 12px 20px;
    border-radius: 12px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.category-reset-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.category-filter-message {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: #3498db;
    color: #fff;
    border-radius: 12px;
    margin-top: 15px;
    font-size: 14px;
}

.category-filter-message span {
    flex: 1;
}

.filter-reset-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.filter-reset-btn:hover {
    transform: scale(1.2);
}

.word-category {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Список слов по префиксу */
.words-list-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
}

.words-list-container h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

.word-card {
    padding: 12px 16px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    color: #2c3e50;
    transition: all 0.3s ease;
    font-weight: 500;
}

.word-card:hover {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* Поиск */
.search-section {
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #3498db;
}

.search-btn {
    padding: 16px 32px;
    font-size: 16px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.search-btn:hover {
    background-color: #2980b9;
}

/* Результат поиска */
.word-result {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.word-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.word-title-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.word-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.word-title {
    font-size: 36px;
    color: #2c3e50;
    font-weight: 700;
    margin: 0;
}

.word-transcription {
    font-size: 18px;
    color: #7f8c8d;
    font-style: italic;
}

.audio-btn {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.audio-btn:active {
    transform: scale(0.95);
}

.example-audio-btn {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.example-audio-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.example-audio-btn:active {
    transform: scale(0.9);
}

.word-definitions {
    margin-bottom: 20px;
}

.definition-item {
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 3px solid #3498db;
}

.definition-item .part-of-speech {
    font-weight: 600;
    color: #3498db;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.definition-item .meaning {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.definition-item .translation {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
}

.word-examples {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.example-item {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 12px;
}

.example-item .example-en {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-style: italic;
}

.example-item .example-kk {
    font-size: 16px;
    color: #2c3e50;
}

.example-item .example-ru {
    font-size: 16px;
    color: #555;
}

.example-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 600;
}

.meaning-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Алфавитная навигация */
.alphabet-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alphabet-section h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 25px;
}

.alphabet-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.alphabet-group {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    background-color: #fafafa;
}

.alphabet-group h4 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.alphabet-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alphabet-link {
    display: inline-block;
    padding: 6px 12px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.alphabet-link:hover {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* Информация о проекте */
.project-info-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-top: 60px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-info-section h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.project-institution {
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.project-institution p {
    margin: 5px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.project-institution p strong {
    color: #2c3e50;
    font-size: 18px;
}

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

.project-detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 12px;
    border-left: 3px solid #3498db;
}

.detail-label {
    font-weight: 600;
    color: #3498db;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.detail-value strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Подвал */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 30px 0;
    margin-top: 60px;
}

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

.footer-text {
    font-size: 14px;
    color: #bdc3c7;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }

    .word-title {
        font-size: 28px;
    }

    .alphabet-nav {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .project-info-section {
        padding: 20px;
        margin-top: 40px;
    }

    .project-info-section h3 {
        font-size: 24px;
    }

    .project-institution {
        padding: 15px;
    }

    .project-institution p {
        font-size: 14px;
    }

    .project-institution p strong {
        font-size: 16px;
    }

    .project-detail-item {
        padding: 12px;
    }

    .detail-label {
        font-size: 13px;
    }

    .detail-value {
        font-size: 14px;
    }
}

