/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    padding: 20px;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #667eea;
    z-index: 9999;
    text-align: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader-content {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin-top: -30px;
    color: white;
}

.preloader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: simple-spin 1s linear infinite;
}

.preloader-text {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

@keyframes simple-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== HEADER & NAVIGATION ===== */
header {
    background: url('img/header-bg.jpg') no-repeat center center;
    background-size: cover;
    color: white;
    margin-bottom: 40px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 60px;
    position: relative;
    z-index: 2;
}

.header-text {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-logo {
    width: 101px;
    height: 101px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    object-fit: contain;
}

.header-title h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-title p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.app-store-button img {
    height: 60px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.app-store-button:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.top-menu {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.menu-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.menu-item {
    padding: 16px 24px;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item:hover,
.menu-item.active {
    color: #3b82f6;
    background-color: #f8fafc;
}

.menu-item.active {
    border-bottom-color: #3b82f6;
    background-color: #f0f7ff;
}

.intro-text {
    text-align: center;
    font-size: 1.125rem;
    color: #4b5563;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ===== ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ КНОПОК ===== */
button, 
.copy-hashtags, 
.panel-btn {
    padding: 12px 20px;
    background-color: #f8fafc;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    min-height: 44px;
    height: auto;
    box-sizing: border-box;
    font-size: 0.875rem;
}

button:hover, 
.copy-hashtags:hover, 
.panel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#clearFilters, 
#clearHashtags, 
#clearHashtagsDesktop {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #ef4444;
}

#clearFilters:hover, 
#clearHashtags:hover, 
#clearHashtagsDesktop:hover {
    background-color: #fecaca;
    border-color: #dc2626;
}

#copyHashtags, 
#copyHashtagsDesktop {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

#copyHashtags:hover, 
#copyHashtagsDesktop:hover {
    background-color: #bfdbfe;
    border-color: #2563eb;
}

.copy-hashtags {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
    font-size: 0.875rem;
    border-radius: 6px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    height: auto;
}

.copy-hashtags:hover {
    background-color: #bfdbfe;
    border-color: #2563eb;
}

.panel-btn {
    min-height: 44px;
    height: auto;
    padding: 12px 16px;
    font-size: 0.875rem;
    background-color: #f3f4f6;
    color: #4b5563;
    border-color: #9ca3af;
}

.panel-btn:hover {
    background-color: #e5e7eb;
    border-color: #6b7280;
}

.toggle-panel {
    font-size: 0.875rem;
    background-color: #f3f4f6;
    color: #4b5563;
    border-color: #9ca3af;
}

.toggle-panel:hover {
    background-color: #e5e7eb;
    border-color: #6b7280;
    color: #374151;
}

.copy-icon, 
.clear-icon {
    width: 16px;
    height: 16px;
}

#copyHashtags .copy-icon,
#copyHashtagsDesktop .copy-icon,
.copy-hashtags .copy-icon {
    filter: brightness(0) saturate(100%) invert(20%) sepia(98%) saturate(2000%) hue-rotate(220deg) brightness(90%) contrast(90%);
}

#clearFilters .clear-icon,
#clearHashtags .clear-icon,
#clearHashtagsDesktop .clear-icon {
    filter: brightness(0) saturate(100%) invert(20%) sepia(90%) saturate(4000%) hue-rotate(350deg) brightness(90%) contrast(90%);
}

.panel-btn .copy-icon,
.panel-btn .clear-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(10%) saturate(600%) hue-rotate(180deg) brightness(90%) contrast(90%);
}

.copy-hashtags .copy-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0) saturate(100%) invert(20%) sepia(98%) saturate(2000%) hue-rotate(220deg) brightness(90%) contrast(90%);
}

/* ===== ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ GLOBAL SEARCH ===== */

/* БАЗОВЫЕ СТИЛИ ДЛЯ КНОПОК ПОИСКА И ОЧИСТКИ */
#searchButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    height: 44px;
    width: 44px;
    padding: 0;
    background-color: #d1fae5;
    color: #059669;
    border: 1px solid #10b981;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#searchButton:hover {
    background-color: #a7f3d0;
    border-color: #059669;
    transform: translateY(-1px);
}

/* ЗАМЕНА ЭМОДЗИ НА ИКОНКУ SEARCH */
.search-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(20%) sepia(98%) saturate(2000%) hue-rotate(140deg) brightness(90%) contrast(90%);
}

/* КНОПКА ОЧИСТКИ ПОИСКА ДЛЯ ДЕСКТОПА */
#clearSearchDesktop {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    height: 44px;
    width: 44px;
    padding: 0;
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #ef4444;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#clearSearchDesktop:hover {
    background-color: #fecaca;
    border-color: #dc2626;
    transform: translateY(-1px);
}

#clearSearchDesktop .clear-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(20%) sepia(90%) saturate(4000%) hue-rotate(350deg) brightness(90%) contrast(90%);
}

/* ===== TAGS & FILTERS ===== */
.tag {
    padding: 6px 16px;
    background-color: #f3f4f6;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    line-height: 1.3;
    text-align: center;
}

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

.tag.country {
    background-color: #eff6ff;
    color: #1d4ed8;
    gap: 8px;
}

.tag.topic {
    background-color: #f0fdf4;
    color: #15803d;
}

.tag.hashtag {
    background-color: #f9fafb;
    color: #4b5563;
    padding: 6px 12px;
    border-radius: 15px;
    min-height: auto;
    line-height: 1.2;
}

.tag.selected {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.tag.country.selected {
    background-color: #1d4ed8;
}

.tag.topic.selected {
    background-color: #15803d;
}

.tag.hashtag.selected {
    background-color: #6d28d9;
}

.tag.hashtag.highlight.selected {
    background-color: #6d28d9;
}

.tag.hashtag.highlight:not(.selected) {
    background-color: #fef08a;
    color: #1f2937;
}

.flag {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* ===== FILTERS SECTION ===== */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.filter-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.filter-section:first-child .filter-title {
    background-color: #eef2ff;
}

.filter-section:last-child .filter-title {
    background-color: #f0fdf4;
}

.filter-section:first-child .filter-title,
.filter-section:last-child .filter-title {
    width: 100%;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.filter-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: #111827;
    border-bottom: 2px solid #f3f4f6;
    font-weight: 600;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    flex-grow: 1;
    min-height: 120px;
    align-items: flex-start;
}

.region-header, 
.tier-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    width: 100%;
    margin: 12px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.3;
}

.country-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
    clear: both;
    page-break-inside: avoid;
    break-inside: avoid;
}

.controls {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

/* ===== COMPACT SELECTED COUNTERS ===== */
.selected-filters {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: auto;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    min-height: 50px;
    font-size: 0.95rem;
}

.selected-label {
    font-weight: 600;
    margin-right: 12px;
    color: #4b5563;
}

.selected-count {
    font-weight: 700;
    color: #3b82f6;
    background: #e0e7ff;
    padding: 6px 12px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
    display: inline-block;
}

/* ===== RESULTS SECTION ===== */
.results {
    background: transparent;
    margin-bottom: 100px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

#resultCount, 
#searchResultCount {
    font-weight: 600;
    color: #3b82f6;
    font-size: 1.125rem;
}

.results-search-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.results-search-input, 
.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1f2937;
    outline: none;
    transition: all 0.2s ease;
    background-color: white;
    height: 44px;
    box-sizing: border-box;
}

.results-search-input:focus, 
.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.results-search-input {
    max-width: 300px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    break-inside: avoid;
    page-break-inside: avoid;
    position: relative;
    z-index: 1;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #eef2ff;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.card-header .tag.topic {
    background-color: #f0fdf4;
    color: #15803d;
    display: inline-flex;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 32px;
    align-items: center;
    justify-content: center;
}

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

.loading, 
.no-results {
    text-align: center;
    padding: 24px;
    font-style: italic;
    color: #6b7280;
}

.no-results {
    padding: 40px;
    font-size: 1.125rem;
}

.error {
    color: #ef4444;
    text-align: center;
    padding: 24px;
    background-color: #fee2e2;
    border-radius: 8px;
    margin: 24px 0;
}

/* ===== FIXED PANEL ===== */
.fixed-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 10px 24px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.fixed-panel.hidden {
    display: none;
}

.fixed-panel.collapsed .selected-hashtags {
    display: none;
}

.fixed-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background-color: #eef2ff;
    padding: 6px 12px;
    border-radius: 6px;
}

.fixed-panel-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fixed-panel-title {
    font-weight: 600;
    color: #111827;
    font-size: 0.9rem;
    background-color: #e0e7ff;
    padding: 5px 12px;
    border-radius: 6px;
}

.toggle-panel {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #3b82f6;
    background-color: #e0e7ff;
    padding: 5px 12px;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 36px;
    height: auto;
    box-sizing: border-box;
}

.toggle-panel:hover {
    color: #1d4ed8;
    background-color: #c7d2fe;
    transform: translateY(-1px);
}

.selected-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    max-height: 200px;
    padding-right: 5px;
}

/* Стили для скроллбара в выбранных хештегах */
.selected-hashtags::-webkit-scrollbar {
    width: 6px;
}

.selected-hashtags::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.selected-hashtags::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.selected-hashtags::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.empty-hashtags-message {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 8px;
    width: 100%;
}

.selected-tag {
    padding: 6px 16px;
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    gap: 8px;
    cursor: pointer;
    min-height: 32px;
    line-height: 1.3;
    text-align: center;
    background-color: #6d28d9;
    flex-shrink: 0;
}

.selected-tag .remove {
    margin-left: 4px;
    font-weight: 700;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.selected-tag:hover .remove {
    opacity: 1;
}

/* ===== FLOATING SCROLL TO TOP BUTTON ===== */
.floating-scroll-top {
    position: fixed;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.floating-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-scroll-top:hover {
    background: #2563eb;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.floating-scroll-top:active {
    transform: translateY(0) scale(0.95);
}

/* ===== SEARCH SECTION ===== */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.search-input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
    background-color: #f0f9ff;
    padding: 16px;
    border-radius: 8px;
}

.search-input {
    padding: 12px 16px;
}

/* СТИЛИ ДЛЯ КОНТЕЙНЕРА МОБИЛЬНЫХ КНОПОК */
.search-buttons-container {
    display: none;
    gap: 12px;
    width: 100%;
}

/* ===== CONTENT PAGES ===== */
.about-content, 
.privacy-content,
.contact-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.about-content h2, 
.privacy-content h2,
.contact-content h2 {
    color: #1f2937;
    font-size: 2rem;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 700;
}

.about-content h3, 
.privacy-content h3,
.contact-content h3 {
    color: #3b82f6;
    font-weight: 600;
    margin: 32px 0 16px 0;
}

.about-content h3 {
    font-size: 1.4rem;
}

.privacy-content h3,
.contact-content h3 {
    font-size: 1.3rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3f4f6;
}

.about-content .content-section, 
.privacy-content .content-section,
.contact-content .content-section {
    margin-bottom: 32px;
    line-height: 1.7;
}

.about-content .content-section p, 
.privacy-content .content-section p,
.contact-content .content-section p {
    margin-bottom: 16px;
    color: #4b5563;
    font-size: 1.1rem;
}

/* ===== INFINITE SCROLL STYLES ===== */
.infinite-scroll-loader {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: simple-spin 1s linear infinite;
}

.loading-text {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #4b5563;
}

.loading-subtext {
    font-size: 0.85rem;
    color: #9ca3af;
}

.infinite-scroll-end {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    font-style: italic;
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
}

.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.loading-container .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: simple-spin 1s linear infinite;
}

.loading-container .loading-text {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #4b5563;
}

.loading-container .loading-subtext {
    font-size: 0.9rem;
    color: #9ca3af;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
button:focus-visible,
.copy-hashtags:focus-visible,
.panel-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.tag:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== IMPROVED SCROLLBAR STYLES ===== */
.selected-hashtags {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.selected-hashtags::-webkit-scrollbar {
    width: 6px;
}

.selected-hashtags::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.selected-hashtags::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.selected-hashtags::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== ERROR STATES ===== */
.search-input.error,
.results-search-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* ===== LOADING STATES ===== */
button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: simple-spin 0.75s linear infinite;
}

/* ===== DESKTOP PANEL FIX ===== */
@media (min-width: 769px) {
    .fixed-panel-top {
        display: none;
    }

    .fixed-panel-header {
        display: flex;
    }

    .mobile-counter {
        display: none;
    }
    
    /* Скрываем короткий текст в десктопной версии */
    .fixed-panel-header .short-text {
        display: none !important;
    }
    
    .fixed-panel-header .full-text {
        display: inline !important;
    }
    
    /* Убираем дублирование текста в меню для десктопной версии */
    .menu-item .short-text {
        display: none !important;
    }
    
    .menu-item .full-text {
        display: inline !important;
    }
    
    /* ПОКАЗЫВАЕМ КНОПКУ ОЧИСТКИ В ДЕСКТОПНОЙ ВЕРСИИ */
    #clearSearchDesktop {
        display: flex;
    }

    /* ПОКАЗЫВАЕМ КНОПКУ ПОИСКА В ДЕСКТОПНОЙ ВЕРСИИ */
    #searchButton {
        display: flex;
    }

    /* СКРЫВАЕМ КОНТЕЙНЕР МОБИЛЬНЫХ КНОПОК В ДЕСКТОПНОЙ ВЕРСИИ */
    .search-buttons-container {
        display: none !important;
    }
    
    /* Увеличиваем максимальную высоту для десктопной версии */
    .selected-hashtags {
        max-height: 300px;
    }
    
    /* Позиционирование плавающей кнопки для десктопа */
    .floating-scroll-top {
        right: 24px;
        bottom: calc(var(--panel-height, 0px) + 20px);
    }
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .menu-container {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 30px 60px;
    }

    .header-text {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .filters {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .controls {
        flex-direction: column;
        gap: 12px;
    }

    .menu-item {
        padding: 12px 16px;
        font-size: 0.9rem;
        justify-content: center;
    }

    /* Убираем дублирование текста в меню для мобильной версии */
    .menu-item .full-text {
        display: none !important;
    }
    
    .menu-item .short-text {
        display: inline !important;
    }

    button, 
    .panel-btn {
        width: 100%;
        padding: 12px 16px;
        justify-content: center;
        min-height: 44px;
        height: auto;
        font-size: 0.875rem;
        border-width: 1px;
    }

    .filter-section {
        padding: 16px;
        min-height: auto;
    }

    .tag-cloud {
        min-height: auto;
        gap: 6px;
    }

    .result-card {
        padding: 16px;
        margin-bottom: 20px;
    }

    .card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        margin-bottom: 16px;
        gap: 12px;
    }

    .fixed-panel-top {
        display: flex;
    }

    .fixed-panel-header {
        display: none;
    }

    .fixed-panel {
        padding: 8px 10px;
        gap: 8px;
    }

    .fixed-panel-top {
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
    }

    .fixed-panel-title {
        display: none;
    }

    /* Исправляем счетчик хештегов в мобильной версии - делаем абсолютно круглым */
    .mobile-counter {
        font-size: 1.1rem;
        font-weight: 700;
        color: #3b82f6;
        background: #e0e7ff;
        padding: 8px;
        border-radius: 50%;
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-right: auto;
    }

    .panel-btn {
        height: 40px;
        min-height: 40px;
        padding: 10px 14px;
        font-size: 0.8rem;
        flex: 0 1 auto;
        white-space: nowrap;
        justify-content: center;
        min-width: 70px;
    }

    #clearHashtags,
    #copyHashtags {
        flex: 0 1 auto;
        min-width: 70px;
    }

    .toggle-panel {
        background-color: #e5e7eb;
        color: #374151;
        justify-content: center;
        min-height: 40px;
        height: auto;
        font-size: 0.8rem;
        padding: 10px 12px;
        flex: 0 1 auto;
        min-width: 80px;
    }

    /* Убираем дублирование текста в кнопках панели для мобильной версии */
    .panel-btn .full-text {
        display: none !important;
    }
    
    .panel-btn .short-text {
        display: inline !important;
    }

    /* СТИЛИ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ ПОИСКА */
    .search-input-container {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }

    .search-input {
        margin-bottom: 0;
        height: 44px;
    }

    /* СКРЫВАЕМ ДЕСКТОПНЫЕ КНОПКИ В МОБИЛЬНОЙ ВЕРСИИ */
    #searchButton {
        display: none !important;
    }

    #clearSearchDesktop {
        display: none !important;
    }

    /* ПОКАЗЫВАЕМ КОНТЕЙНЕР МОБИЛЬНЫХ КНОПОК */
    .search-buttons-container {
        display: flex;
        width: 100%;
    }

    #searchButtonMobile {
        width: 50%;
        height: 44px;
        min-height: 44px;
        padding: 12px 16px;
        background-color: #d1fae5;
        color: #059669;
        border: 1px solid #10b981;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 1rem;
    }

    #searchButtonMobile:hover {
        background-color: #a7f3d0;
        border-color: #059669;
        transform: translateY(-1px);
    }

    #clearSearchMobile {
        width: 50%;
        height: 44px;
        min-height: 44px;
        padding: 12px 16px;
        background-color: #fee2e2;
        color: #dc2626;
        border: 1px solid #ef4444;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 1rem;
    }

    #clearSearchMobile:hover {
        background-color: #fecaca;
        border-color: #dc2626;
        transform: translateY(-1px);
    }

    #clearSearchMobile .clear-icon {
        width: 16px;
        height: 16px;
        filter: brightness(0) saturate(100%) invert(20%) sepia(90%) saturate(4000%) hue-rotate(350deg) brightness(90%) contrast(90%);
    }

    .results-search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .results-search-input {
        max-width: 100%;
        margin-bottom: 8px;
        height: 44px;
    }

    .about-content, .privacy-content, .contact-content {
        padding: 20px;
    }

    .about-content h2, .privacy-content h2, .contact-content h2 {
        font-size: 1.75rem;
    }

    .about-content h3 {
        font-size: 1.3rem;
    }

    .privacy-content h3,
    .contact-content h3 {
        font-size: 1.2rem;
    }

    .tag,
    .selected-tag {
        font-size: 1.1375rem;
        padding: 6px 14px;
        min-height: 28px;
    }

    .tag.country {
        gap: 6px;
    }

    .region-header, .tier-header {
        font-size: 1.43rem;
    }

    .country-header {
        font-size: 1.625rem;
    }

    .card-header .tag.topic {
        font-size: 1.3rem;
        width: auto;
        flex: 0 1 auto;
        margin-right: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 6px 14px;
        font-weight: 600;
    }

    .tag.hashtag {
        font-size: 1.1375rem;
        padding: 6px 12px;
        min-height: auto;
    }

    .copy-hashtags {
        font-size: 0.875rem;
        width: auto;
        min-width: 120px;
        white-space: nowrap;
        margin-left: auto;
        align-self: stretch;
        height: auto;
        min-height: 40px;
        padding: 10px 14px;
        flex-shrink: 0;
        flex: 0 0 auto;
        justify-content: center;
    }

    .search-input {
        font-size: 1.3rem;
        padding: 12px 18px;
    }

    .results-search-input {
        font-size: 1.1375rem;
        padding: 10px 14px;
    }

    .results-header h2 {
        font-size: 1.625rem;
    }

    #resultCount, #searchResultCount {
        font-size: 1.43rem;
    }

    .flag {
        width: 20px;
        height: 20px;
    }

    .copy-hashtags .copy-icon {
        width: 16px;
        height: 16px;
        margin-right: 6px;
        filter: brightness(0) saturate(100%) invert(20%) sepia(98%) saturate(2000%) hue-rotate(220deg) brightness(90%) contrast(90%);
    }

    .panel-btn .copy-icon,
    .panel-btn .clear-icon {
        width: 16px;
        height: 16px;
        margin-right: 6px;
        filter: brightness(0) saturate(100%) invert(40%) sepia(10%) saturate(600%) hue-rotate(180deg) brightness(90%) contrast(90%);
    }

    .toggle-panel .copy-icon,
    .toggle-panel .clear-icon {
        display: none;
    }
    
    /* Улучшенные стили скролла для мобильных устройств */
    .selected-hashtags {
        max-height: 150px;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Позиционирование плавающей кнопки для мобильных */
    .floating-scroll-top {
        right: 16px;
        bottom: calc(var(--panel-height, 0px) + 16px);
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.temp-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: rgba(59, 130, 246, 0.9);
    color: white;
    max-width: 80%;
    word-wrap: break-word;
}

.copy-hashtags:active {
    transform: scale(0.95);
}

/* ===== HIDDEN CLASS FOR FORMS ===== */
.hidden {
    display: none !important;
}

/* Стили для формы обратной связи */
#contact-form .search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#form-status.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

#form-status.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Адаптивность для формы */
@media (max-width: 768px) {
    #contact-form .search-input {
        font-size: 16px; /* Предотвращает zoom на iOS */
    }
}

/* reCAPTCHA v3 Badge Styles */
.grecaptcha-badge {
    visibility: visible !important;
}

/* Privacy notice for reCAPTCHA */
.recaptcha-notice {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin-top: 10px;
    line-height: 1.4;
}

.recaptcha-notice a {
    color: #3b82f6;
    text-decoration: none;
}

.recaptcha-notice a:hover {
    text-decoration: underline;
}