/* Основные переменные */
:root {
    /* Цветовая схема */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #4f46e5;
    --accent-color: #8b5cf6;
    --background-color: #ffffff;
    --surface-color: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
    --card-background: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --canvas-color: #2563eb;
    
    /* Модальные окна */
    --modal-background: #ffffff;
    --modal-text: #1e293b;
    --modal-border: rgba(0, 0, 0, 0.1);
    
    /* Тени */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Размеры */
    --container-max-width: 1280px;
    --header-height: 72px;
    --border-radius: 12px;
    
    /* Анимации */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}
/* Кнопка перехода к обрезке */
.cutter-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
/* Темная тема */
[data-theme="dark"] {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --card-background: rgba(30, 41, 59, 0.9);
    --modal-overlay: rgba(0, 0, 0, 0.9);
    --canvas-color: #4f46e5;
    
    /* Модальные окна */
    --modal-background: linear-gradient(135deg, #1a1f2e, #131722);
    --modal-text: #ffffff;
    --modal-border: rgba(255, 255, 255, 0.1);
}

/* Анимированный фон */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--background-color);
    overflow: hidden;
}

#triangleCanvas {
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Контейнер */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Прелоадер */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Шапка */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-controls-main-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-button, .cutter-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.blog-button:hover, .cutter-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.blog-button i, .cutter-button i {
    font-size: 1rem;
}

.nav-controls button {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color var(--transition-fast);
}

.nav-controls button:hover {
    background-color: var(--surface-color);
}

/* Языковое меню */
.language-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    z-index: 99;
}

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

.language-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

.language-item:hover {
    background-color: var(--surface-color);
}

.language-item.active {
    background-color: var(--primary-color);
    color: white;
}

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

/* Главный контент */
.main-content {
    padding-top: calc(var(--header-height) + 2rem);
}

/* Hero секция */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    color: transparent;
}

.hero-description {
    max-width: 768px;
    margin: 0 auto 3rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Форма поиска */
.search-form {
    max-width: 640px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background-color: var(--surface-color);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    padding: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

.search-input-wrapper button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: calc(var(--border-radius) - 4px);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-input-wrapper button:hover {
    background-color: var(--primary-hover);
}

/* Категории */
.categories-section {
    padding: 2rem 0;
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.category-card.active {
    background-color: var(--primary-color);
    color: white;
}

/* Список звуков */
.sounds-section {
    padding: 2rem 0;
}

.sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 1440px;
}

.sound-card {
    position: relative;
    background: var(--card-background);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease-out;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateZ(0);
    will-change: transform;
    display: flex;
    flex-direction: column;
}

.sound-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.sound-image {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--surface-color);
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--border-color);
}

.sound-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.sound-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.sound-card:hover .sound-image::after,
.playing .sound-image::after {
    opacity: 1;
}

.sound-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 4;
}

.sound-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 2.8rem;
    margin-bottom: 0.5rem;
}

/* Кастомный аудио плеер */
.sound-content .audio-player {
    display: none;
}

.sound-content .play-button {
    display: none;
}

/* Визуализатор */
.visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playing .visualizer {
    opacity: 1;
}

.visualizer-bar {
    width: calc(100% / 32 - 4px);
    height: 100%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.3));
    transform: scaleY(0.1);
    transform-origin: bottom;
    transition: transform 0.1s ease;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.playing .visualizer-bar {
    transition: transform 0.05s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* Дополнительные стили для аудио плеера */
.sound-image .audio-player {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    padding: 1rem;
    backdrop-filter: blur(8px);
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sound-image:hover .audio-player,
.playing .sound-image .audio-player {
    opacity: 1;
}

.sound-image .play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0.8;
}

.sound-image .play-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.playing .sound-image .play-button {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.sound-image:hover .play-button {
    opacity: 1;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 5;
}

.progress-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.progress {
    background: rgba(255, 255, 255, 0.8);
    height: 100%;
    border-radius: 2px;
}

.time-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.volume-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-progress {
    background: rgba(255, 255, 255, 0.8);
    height: 100%;
    border-radius: 2px;
}

.sound-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.sound-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tag:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.sound-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: space-between;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--surface-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.action-button:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.action-button i {
    font-size: 0.9rem;
    margin-right: 0.1rem;
    color: var(--text-primary);
}

.action-button:hover i {
    color: #ffffff;
}

/* Удаляем прыгающую анимацию */
.sound-card {
    animation: none;
}

/* Стили для аудио плеера */
audio {
    filter: grayscale(1) opacity(0.8);
    transition: all 0.2s ease;
}

audio:hover,
audio:focus {
    filter: none;
}

/* Пагинация */
.pagination {
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.pagination-item:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.pagination-item.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.pagination-nav {
    font-size: 14px;
    color: var(--text-primary);
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0 4px;
}

/* Футер */
.main-footer {
    background-color: var(--surface-color);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-logo img {
    height: 32px;
    width: auto;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-social p {
    color: var(--text-primary);
    margin: 0;
    font-size: 1rem;
}

.footer-social .telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #0066aa !important;
    color: #ffffff !important;
    border-radius: 0.5rem;
    text-decoration: none !important;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.footer-social .telegram-link:hover {
    background: #005599;
}

.footer-social .telegram-link i {
    font-size: 1.2rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Модальное окно в современном стиле */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.modal[style*="display: flex"] {
    opacity: 1;
}

/* Исправление для модального окна, чтобы предотвратить смещение контента */
body:after {
    content: "";
    display: block;
    position: fixed;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    z-index: -1;
}

html[dir="ltr"] body.modal-open,
html[dir="rtl"] body.modal-open {
    overflow: hidden;
    padding-right: 0 !important; /* Предотвращает добавление padding-right при открытии модального окна */
    width: 100%;
    position: fixed;
}

/* Сброс стилей после закрытия модального окна */
html[dir="ltr"] body,
html[dir="rtl"] body {
    width: 100%;
    overflow-x: hidden;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--modal-background);
    border-radius: 20px;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    color: var(--modal-text);
    border: 1px solid var(--border-color);
}

.modal[style*="display: flex"] .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Стили для модального окна с информацией */
.info-container {
    padding: 2rem;
    width: 100%;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(19, 23, 34, 0.8));
    backdrop-filter: blur(10px);
}

.info-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.track-preview {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.track-preview .image-container {
    width: 100%;
    max-width: 300px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.track-preview .image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.track-preview .image-container img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.track-preview .image-container:hover img {
    transform: scale(1.03);
}

.track-preview .audio-preview {
    margin-top: 1rem;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Тонкий аудио плеер для страниц с видео */
.has-video .modal-audio-player {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.has-video .modal-audio-player .audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.has-video .modal-audio-player .play-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    font-size: 1rem;
}

.has-video .modal-audio-player .progress-bar {
    height: 4px;
}

/* Стандартный аудио плеер для страниц без видео */
.modal-audio-player {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.modal-audio-player .audio-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.modal-audio-player .play-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    font-size: 1.25rem;
}

.modal-audio-player .play-button:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #5d54e6, #3373ec);
}

.modal-audio-player .progress-area {
    flex: 1;
    min-width: 150px;
}

.modal-audio-player .progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.modal-audio-player .progress {
    background: linear-gradient(90deg, #4f46e5, #2563eb);
    height: 100%;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.5);
}

.modal-audio-player .time-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Стили для эквалайзера */
.audio-equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 40px;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0 0.5rem;
    position: relative;
}

.equalizer-bar {
    width: 4px;
    background: linear-gradient(to top, #4f46e5, #2563eb);
    border-radius: 2px;
    margin: 0 1px;
    transition: height 0.1s ease;
    box-shadow: 0 0 5px rgba(79, 70, 229, 0.5);
    height: 5px;
}

/* Добавляем стили для анимации эквалайзера */
@keyframes equalizerAnimation {
    0% { height: 5px; }
    50% { height: var(--random-height); }
    100% { height: 5px; }
}

.playing .equalizer-bar {
    animation: equalizerAnimation 0.5s infinite;
    animation-delay: calc(var(--bar-index) * 0.05s);
}

/* Стили для кнопки скачивания */
.modal-download-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-download-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #5d54e6, #3373ec);
}

.modal-download-button i {
    font-size: 1.25rem;
}

/* Стили для видео-контейнера в модальном окне */
#infoModal .video-container {
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#infoModal .video-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Стили для модального окна с YouTube видео */
#youtubeModal .modal-content {
    max-width: 900px;
    padding-bottom: 0;
    background: linear-gradient(135deg, #1a1f2e, #131722);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#youtubeModal .video-container {
    width: 100%;
    margin-bottom: 0;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    box-shadow: 0 -8px 16px rgba(0, 0, 0, 0.2) inset;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    background-color: #000;
    width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

#youtubeModal .modal-download-button-container {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(26, 31, 46, 0.8), rgba(19, 23, 34, 0.8));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.share-links {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-links h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.social-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.social-share-buttons a {
    flex: 0 0 calc(25% - 0.75rem);
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-share-buttons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.direct-link {
    margin-top: 1.5rem;
}

.direct-link h3 {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.link-container {
    display: flex;
    margin-top: 0.75rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.link-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: monospace;
    border: 1px solid var(--border-color);
}

.link-container button {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.link-container button:hover {
    background: linear-gradient(135deg, #5d54e6, #3373ec);
}

@media (min-width: 1024px) {
    .share-links {
        margin-top: 1.5rem;
        max-width: 100%;
        padding-top: 1.5rem;
    }
    
    .share-links h3 {
        text-align: center;
    }
    
    .social-share-buttons {
        justify-content: center;
    }
    
    .social-share-buttons a {
        flex: 0 0 calc(25% - 0.75rem);
    }
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    /* Общие стили для мобильных устройств */
    .container {
        padding: 0 1rem;
        width: 100%;
    }
    
    /* Скрываем логотип на мобильных */
    .logo {
        display: none;
    }
    
    /* Растягиваем навигацию на всю ширину */
    .nav-controls {
        width: 100%;
        justify-content: space-between;
        gap: 0.4rem;
    }
    
    .nav-controls-main-group {
        gap: 0.3rem;
        flex: 1;
        justify-content: space-around;
    }
    
    /* Делаем кнопки больше */
    .blog-button, .cutter-button {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        flex-grow: 1;
        justify-content: center;
    }
    
    .blog-button i, .cutter-button i {
        font-size: 0.9rem;
    }
    
    /* Уменьшаем переключатель языка */
    .language-toggle {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    /* Скрываем иконку глобуса */
    .language-toggle i {
        display: none;
    }
    
    /* Скрываем иконку темы */
    .theme-toggle {
        font-size: 0.9rem;
        padding: 0.4rem;
    }
    
    /* Центрирование элементов для обоих направлений текста */
    html[dir="ltr"] .nav-container,
    html[dir="rtl"] .nav-container {
        justify-content: flex-start !important; /* Changed from center to allow scrolling */
        width: 100%;
    }
    
    html[dir="ltr"] .logo,
    html[dir="rtl"] .logo {
        margin: 0;
    }
    
    html[dir="ltr"] .nav-controls,
    html[dir="rtl"] .nav-controls {
        margin: 0;
    }
    
    /* Mobile horizontal scroll for navigation */
    .nav-container {
        display: flex !important;
        align-items: center;
        gap: 1rem;
        overflow: visible; /* Container itself doesn't scroll */
        width: 100%;
        position: relative; /* For gradient overlays */
        justify-content: flex-start !important; /* Allow scrolling */
    }
    
    /* Logo stays fixed */
    .logo {
        flex-shrink: 0;
        margin-right: 0.5rem;
        z-index: 2; /* Above gradient overlays */
    }
    
    /* Navigation controls scroll horizontally */
    .nav-controls {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scrollbar-width: none; /* Firefox - hide scrollbar */
        -ms-overflow-style: none; /* IE/Edge - hide scrollbar */
        scroll-behavior: smooth;
        flex: 1;
        min-width: 0; /* Allow shrinking */
        margin: 0;
        position: relative;
        /* Gradient overlays to indicate scrollable content */
        mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 20px,
            black calc(100% - 20px),
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 20px,
            black calc(100% - 20px),
            transparent 100%
        );
    }
    
    .nav-controls::-webkit-scrollbar {
        display: none; /* Chrome/Safari - hide scrollbar */
        width: 0;
        height: 0;
    }
    
    /* Gradient fade indicator on right side - shows when content extends right */
    .nav-controls::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        width: 30px;
        pointer-events: none;
        z-index: 1;
        transition: opacity 0.3s ease;
        background: linear-gradient(to left, var(--background-color), transparent);
        opacity: 1; /* Show by default (content extends right) */
    }
    
    /* Hide right fade when scrolled to the end (no more content right) */
    .nav-controls.scrolled-right::after {
        opacity: 0;
    }
    
    /* Show right fade when NOT at the end (has content to scroll) */
    .nav-controls:not(.scrolled-right)::after {
        opacity: 1;
    }
    
    .nav-controls-main-group {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap !important; /* Prevent wrapping */
        min-width: max-content; /* Prevent wrapping - makes it scrollable */
    }
    
    .blog-button, .cutter-button {
        white-space: nowrap !important; /* Prevent text wrapping */
        flex-shrink: 0 !important; /* Prevent buttons from shrinking */
        min-width: fit-content;
    }
    
    .language-toggle, .theme-toggle {
        flex-shrink: 0 !important; /* Prevent toggles from shrinking */
        margin-left: 0.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .search-input-wrapper input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .search-input-wrapper button {
        width: 100%;
    }
    
    .sounds-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }
    
    /* Исправление для LTR версии */
    html[dir="ltr"] .sound-card,
    html[dir="ltr"] .category-card,
    html[dir="ltr"] .search-form,
    html[dir="ltr"] .hero-title,
    html[dir="ltr"] .hero-description {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
    
    /* Исправление для RTL версии */
    html[dir="rtl"] .sound-card,
    html[dir="rtl"] .category-card,
    html[dir="rtl"] .search-form,
    html[dir="rtl"] .hero-title,
    html[dir="rtl"] .hero-description {
        margin-right: auto;
        margin-left: auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .nav-controls {
        gap: 0.25rem;
    }
    
    .nav-controls-main-group {
        gap: 0.2rem;
    }
    
    .blog-button, .cutter-button {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .blog-button i, .cutter-button i {
        font-size: 0.85rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .categories-grid {
        justify-content: center;
    }
    
    .category-card {
        width: 100%;
        justify-content: center;
    }
}

/* Дополнительные стили для RTL направления */
html[dir="rtl"] .search-input-wrapper button {
    border-radius: calc(var(--border-radius) - 4px);
}

html[dir="rtl"] .nav-controls {
    flex-direction: row-reverse;
}

html[dir="rtl"] .categories-grid,
html[dir="rtl"] .sounds-grid {
    direction: rtl;
}

/* Новые стили для медиа-запросов */
@media (max-width: 768px) {
    .footer-social {
        padding: 1rem 0;
    }
    
    .footer-social p {
        font-size: 0.9rem;
    }
    
    .footer-social .telegram-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        display: block;
    }
    
    .info-container {
        padding: 1.5rem;
        max-height: calc(90vh - 3rem);
        overflow-y: auto;
    }
    
    .info-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .track-preview .image-container {
        max-width: 280px;
    }
    
    .modal-audio-player {
        padding: 1.25rem;
    }
    
    .modal-audio-player .audio-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .modal-audio-player .play-button {
        margin: 0 auto 1rem;
        width: 48px;
        height: 48px;
    }
    
    .social-share-buttons a {
        flex: 1 0 calc(50% - 0.75rem);
        min-width: auto;
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .modal-youtube-button {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    
    .modal-youtube-button i {
        font-size: 1.25rem;
    }
    
    .modal-download-button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .modal-download-button i {
        font-size: 1.25rem;
    }
    
    .link-container {
        flex-direction: column;
    }
    
    .link-container input {
        border-radius: 12px 12px 0 0;
        padding: 0.875rem 1rem;
    }
    
    .link-container button {
        border-radius: 0 0 12px 12px;
        padding: 0.875rem 1.25rem;
    }
    
    .default-image {
        height: 250px;
    }
    
    .default-image i {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .info-title {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .track-preview .image-container {
        max-width: 240px;
    }
    
    .modal-audio-player {
        padding: 1rem;
    }
    
    .modal-audio-player .play-button {
        width: 42px;
        height: 42px;
        margin: 0 auto 0.75rem;
    }
    
    .social-share-buttons {
        gap: 0.75rem;
    }
    
    .social-share-buttons a {
        flex: 1 0 100%;
        padding: 0.75rem 0.5rem;
    }
    
    .modal-download-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .default-image {
        height: 200px;
    }
    
    .default-image i {
        font-size: 3.5rem;
    }
}

/* Стили для социальных сетей */
.share-facebook {
    background-color: #1877f2;
}

.share-twitter {
    background-color: #1da1f2;
}

.share-whatsapp {
    background-color: #25d366;
}

.share-telegram {
    background-color: #0088cc;
}

.default-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(37, 99, 235, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.default-image::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(37, 99, 235, 0));
    animation: rotate 15s linear infinite;
}

.default-image i {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 2;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.modal-youtube-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.9), rgba(200, 0, 0, 1));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-youtube-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 25px rgba(255, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 30, 30, 0.9), rgba(220, 0, 0, 1));
}

.modal-youtube-button i {
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Стили для SEO блока */
.seo-block {
    background: var(--card-background);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: var(--shadow-md);
}

.seo-block h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.seo-block h2:hover {
    color: var(--primary-color);
}

.seo-block h2 i {
    color: var(--primary-color);
}

.seo-block p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.seo-block ol {
    color: var(--text-primary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.seo-block ol li {
    margin-bottom: 0.5rem;
}

.seo-block .logodiv {
    margin-bottom: 2rem;
    text-align: center;
}

.seo-block .banner {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

.seo-block .banner:hover {
    transform: scale(1.02);
}

/* Стили для секции Telegram */
.footer {
    background: var(--surface-color);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
}

.footer p {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #0066aa !important;
    color: #ffffff !important;
    border-radius: 0.5rem;
    text-decoration: none !important;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.telegram-link:hover {
    background: #005599;
}

.telegram-link i {
    font-size: 1.2rem;
}

/* Стили для видео попапа */
.video-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.video-popup.active {
    display: flex;
}

.video-popup .video-container {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 1rem;
    max-width: 800px;
    width: 90%;
    position: relative;
}

.video-popup .video-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.video-popup video {
    width: 100%;
    border-radius: 0.5rem;
}

.video-popup .close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.video-popup .close-popup:hover {
    background: var(--primary-color-dark);
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .seo-block {
        padding: 1.5rem;
        margin: 1.5rem 1rem;
    }
    
    .seo-block h2 {
        font-size: 1.25rem;
    }
    
    .video-popup .video-container {
        padding: 1rem;
    }
    
    .video-popup .video-title {
        font-size: 1.25rem;
    }
}

/* Стили для уведомления о копировании */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color, #4f46e5);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 500;
    text-align: center;
    min-width: 200px;
    max-width: 90%;
}

/* Адаптивные стили для уведомления */
@media (max-width: 480px) {
    .copy-notification {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        min-width: 180px;
    }
}

/* Центрирование для обоих направлений */
html[dir="ltr"] .modal-content,
html[dir="rtl"] .modal-content {
    margin: 0 auto;
}

.flag-icon-background {
    background-size: contain;
    background-position: 50%;
    background-repeat: no-repeat;
}

.flag-icon {
    display: inline-block;
    width: 1.3em;
    height: 1em;
    margin-right: 0.5rem;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.flag-icon:before {
    content: '\00a0';
}

.flag-icon.flag-icon-squared {
    width: 1em;
}

/* Флаги для используемых языков */
.flag-icon-us {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/us.svg);
}

.flag-icon-ru {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/ru.svg);
}

.flag-icon-il {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/il.svg);
}

.flag-icon-ae {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/ae.svg);
}

.flag-icon-jp {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/jp.svg);
}

.flag-icon-kr {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/kr.svg);
}

.flag-icon-nl {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/nl.svg);
}

.flag-icon-no {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/no.svg);
}

.flag-icon-pl {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/pl.svg);
}

.flag-icon-pt {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/pt.svg);
}

.flag-icon-ua {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/ua.svg);
}

.flag-icon-tw {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/tw.svg);
}

.flag-icon-bd {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/bd.svg);
}

.flag-icon-de {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/de.svg);
}

.flag-icon-es {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/es.svg);
}

.flag-icon-fi {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/fi.svg);
}

.flag-icon-fr {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/fr.svg);
}

.flag-icon-in {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/in.svg);
}

.flag-icon-it {
    background-image: url(https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/it.svg);
}

/* RTL поддержка для флагов */
html[dir="rtl"] .flag-icon {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .language-item {
        padding: 0.5rem 0.75rem;
    }
    
    .language-name {
        font-size: 0.85rem;
    }
    
    .flag-icon {
        width: 1.2em;
    }
}

@media (max-width: 480px) {
    .language-item {
        padding: 0.4rem 0.6rem;
    }
    
    .language-name {
        font-size: 0.8rem;
    }
    
    .flag-icon {
        width: 1.1em;
    }
}

/* Стили для модальных страниц Privacy и Terms */
.modal-page {
    background: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-page-content {
    color: #333333;
    line-height: 1.6;
    font-size: 1rem;
}

.modal-page-content h1 {
    color: #1a1a1a;
}

.policy-section h2,
.terms-section h2 {
    color: #1a1a1a;
}

.policy-section p,
.terms-section p {
    color: #333333;
}

/* RTL поддержка */
[dir="rtl"] .modal-page-content {
    text-align: right;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-page {
        padding: 1rem;
    }
    
    .modal-page-content {
        padding: 1rem;
    }
    
    .modal-page-content h1 {
        font-size: 1.75rem;
    }
    
    .policy-section h2,
    .terms-section h2 {
        font-size: 1.25rem;
    }
}

#pageModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#pageModal .modal-content {
    background: var(--bg-color);
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    margin: 0 auto;
}

#pageModal .modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1;
}

#pageModal .modal-close:hover {
    background: var(--primary-color-dark);
}

#pageModal iframe {
    border: none;
    width: 100%;
    height: 80vh;
    border-radius: 0.5rem;
    background: #ffffff;
}

/* RTL поддержка */
html[dir="rtl"] #pageModal .modal-close {
    right: auto;
    left: 1rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    #pageModal .modal-content {
        width: 95%;
        padding: 0.5rem;
    }
    
    #pageModal iframe {
        height: 85vh;
    }
} 