/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #141420;
    --bg-card: rgba(20, 20, 32, 0.8);
    --bg-card-hover: rgba(30, 30, 45, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #707080;
    --accent: #3390ec;
    --accent-hover: #4a9ef0;
    --accent-secondary: #9d6bff;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-glow: rgba(51, 144, 236, 0.3);
}

[data-theme="light"] {
    /* Light theme */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(245, 245, 247, 0.95);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --accent: #3390ec;
    --accent-hover: #4a9ef0;
    --accent-secondary: #9d6bff;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-glow: rgba(51, 144, 236, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Оптимизация для мобильных */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Предотвращение выделения текста при тапе */
    -webkit-tap-highlight-color: transparent;
    /* Улучшение производительности скролла */
    -webkit-overflow-scrolling: touch;
    /* Оптимизация рендеринга */
    text-rendering: optimizeLegibility;
    /* Улучшение производительности анимаций */
    will-change: scroll-position;
}

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

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

[data-theme="light"] .animated-bg {
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars {
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 40%, white, transparent),
        radial-gradient(1px 1px at 33% 60%, white, transparent),
        radial-gradient(1px 1px at 55% 80%, white, transparent);
    background-repeat: repeat;
    background-size: 200% 200%;
    animation: sparkle 20s linear infinite;
    opacity: 0.5;
}

[data-theme="light"] .stars,
[data-theme="light"] .stars2 {
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(0, 0, 0, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(0, 0, 0, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(0, 0, 0, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(0, 0, 0, 0.2), transparent),
        radial-gradient(2px 2px at 90% 40%, rgba(0, 0, 0, 0.3), transparent),
        radial-gradient(1px 1px at 33% 60%, rgba(0, 0, 0, 0.2), transparent),
        radial-gradient(1px 1px at 55% 80%, rgba(0, 0, 0, 0.2), transparent);
    opacity: 0.3;
}

[data-theme="light"] .stars3 {
    opacity: 0.15;
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 25% 25%, white, transparent),
        radial-gradient(1px 1px at 75% 75%, white, transparent),
        radial-gradient(1px 1px at 40% 60%, white, transparent);
    background-repeat: repeat;
    background-size: 300% 300%;
    animation: sparkle 30s linear infinite reverse;
    opacity: 0.3;
}

.stars3 {
    background-image: 
        radial-gradient(1px 1px at 15% 45%, var(--accent), transparent),
        radial-gradient(1px 1px at 85% 55%, var(--accent-secondary), transparent);
    background-repeat: repeat;
    background-size: 400% 400%;
    animation: sparkle 40s linear infinite;
    opacity: 0.2;
}

@keyframes sparkle {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(15px);
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .header {
    background: rgba(245, 245, 247, 0.95);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Header Top Row */
.header-top-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.theme-toggle:hover {
    border-color: var(--text-muted);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Language Selector */
.language-selector-wrapper {
    position: relative;
}

.language-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    min-width: 50px;
}

.language-toggle:hover {
    border-color: var(--text-muted);
}

.language-toggle:active {
    transform: scale(0.95);
}

.language-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

.language-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.language-toggle.active .language-chevron {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-search-wrapper {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.language-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.language-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.language-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.1);
}

.language-search-input::placeholder {
    color: var(--text-muted);
}

.language-list {
    padding: 4px;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.language-item:hover {
    background: var(--bg-card-hover);
}

.language-item.active {
    background: rgba(51, 144, 236, 0.15);
    color: var(--accent);
}

.language-item-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.language-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box > i:first-of-type {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

.search-filter-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.2s ease;
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.search-filter-icon:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.search-filter-icon i {
    font-size: 16px;
    line-height: 1;
}

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

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

.search-box input::placeholder {
    color: var(--text-muted);
}

.upload-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    /* Оптимизация для мобильных */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow-glow);
}

.footer-upload-btn {
    margin-right: 15px;
}

/* Filters Toggle Button (Desktop and Mobile) */
.filters-toggle {
    display: flex; /* Visible on desktop and mobile */
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.filters-toggle:hover {
    border-color: var(--text-muted);
}

.filters-toggle.active {
    border-color: var(--accent);
    color: var(--accent);
}

.active-filters-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent);
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
}

/* Header Filters Row */
.header-filters-row {
    display: none; /* Hidden by default on desktop and mobile */
    gap: 0;
    align-items: center;
    flex-wrap: wrap;
    padding: 0;
}

.header-filters-row.active {
    display: flex; /* Show when toggle is active */
}

/* Search Filters Panel - Only on search page */
.search-filters-panel {
    display: none; /* Hidden by default */
    gap: 0;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.search-filters-panel[style*="block"] {
    display: flex !important; /* Show when toggled */
}

/* Filters Inline - Minimalistic */
.filters-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.filter-select {
    padding: 8px 32px 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23b0b0c0' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 140px;
    flex: 0 1 auto;
}

.filter-select:hover {
    border-color: var(--text-muted);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Active filter indicator - subtle */
.filter-select.filter-active {
    border-color: var(--accent);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Reset Filters Button - Minimalistic */
.reset-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.reset-filters-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.reset-filters-btn i {
    font-size: 14px;
}

/* Legacy support for old selectors */
.type-filter,
.messenger-filter,
.sort-filter {
    display: flex;
    align-items: center;
}

.type-select,
.messenger-select,
.sort-select {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b0c0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

.type-select:hover,
.messenger-select:hover,
.sort-select:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.type-select:focus,
.messenger-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}

/* Main Content */
.main {
    position: relative;
    z-index: 1;
    padding-bottom: 60px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Packs Grid */
.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

@media (min-width: 1400px) {
    .packs-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.pack-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    /* Оптимизация для мобильных */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.pack-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--shadow-glow);
    background: var(--bg-card-hover);
}

.pack-preview-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.pack-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-secondary);
    display: block;
    transform: scale(0.8);
    transform-origin: center center;
    /* Оптимизация загрузки изображений */
    loading: lazy;
    decoding: async;
    /* Оптимизация рендеринга */
    image-rendering: -webkit-optimize-contrast;
    will-change: transform;
}

.messenger-badge {
    position: relative;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.messenger-badge i {
    font-size: 11px;
    opacity: 0.7;
}

.messenger-badge span {
    letter-spacing: 0.2px;
}

.pack-card:hover .messenger-badge {
    opacity: 0.8;
}

.pack-info {
    padding: 20px 15px;
}

.pack-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.pack-character {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.pack-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    gap: 8px;
}

.pack-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pack-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.like-btn,
.dislike-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.like-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.dislike-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.like-btn.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.dislike-btn.active {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.like-count,
.dislike-count {
    font-size: 12px;
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

.admin-likes-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.admin-likes-control input[type="number"] {
    width: 50px;
    padding: 2px 4px;
    font-size: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    text-align: center;
    -moz-appearance: textfield;
}

.admin-likes-control input[type="number"]::-webkit-outer-spin-button,
.admin-likes-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.admin-likes-control button {
    padding: 2px 6px;
    font-size: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-likes-control button:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.admin-likes-control .admin-likes-set {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.admin-likes-control .admin-likes-set:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.delete-pack-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.delete-pack-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    transform: scale(1.1);
}

.delete-pack-btn-modal {
    padding: 8px 16px;
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.5);
    border-radius: 8px;
    color: #ff3b30;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.delete-pack-btn-modal:hover {
    background: rgba(255, 59, 48, 0.3);
    border-color: #ff3b30;
    transform: translateY(-1px);
}

.success-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px var(--shadow-glow);
}

.success-message.show {
    opacity: 1;
    transform: translateX(0);
}

.error-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid #ff4444;
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.3);
}

.error-message.show {
    opacity: 1;
    transform: translateX(0);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-color: transparent;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

[data-theme="light"] .modal {
    background: rgba(245, 245, 247, 0.95);
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 1600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    margin-top: 40px;
    box-shadow: 0 20px 60px var(--shadow), 0 0 0 1px var(--border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="light"] .modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.modal-close:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 30px;
    background: var(--bg-card);
}

.pack-info {
    margin-bottom: 30px;
    padding: 20px 15px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .pack-info {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pack-info-item {
    margin-bottom: 10px;
    font-size: 14px;
}

.pack-info-item strong {
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Stickers Gallery */
.stickers-gallery {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    /* Оптимизация производительности */
    contain: layout style paint;
}

@media (max-width: 1600px) {
    .stickers-gallery {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1000px) {
    .stickers-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .stickers-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .stickers-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sticker-item {
    aspect-ratio: 1;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    /* Оптимизация производительности */
    contain: layout style paint;
    will-change: transform;
    /* Оптимизация для мобильных */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sticker-item:hover {
    transform: scale(1.05);
    border-color: var(--accent);
    box-shadow: 0 5px 20px var(--shadow-glow);
}

.sticker-media-container {
    width: 100%;
    height: 100%;
    cursor: pointer;
    padding: 8px;
    box-sizing: border-box;
}

.sticker-item img,
.sticker-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* Оптимизация рендеринга */
    transform: translateZ(0);
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
}

.sticker-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 32px;
    border-radius: 8px;
}

.delete-sticker-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    z-index: 20;
    font-size: 12px;
    padding: 0;
}

.sticker-item:hover .delete-sticker-btn {
    opacity: 1;
}

.delete-sticker-btn:hover {
    background: rgba(255, 68, 68, 0.9);
    border-color: #ff4444;
    transform: scale(1.1);
}

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

.main-cover-btn {
    position: absolute;
    top: 5px;
    right: 38px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: #ffc107;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
}

.sticker-item:hover .main-cover-btn {
    opacity: 1;
    pointer-events: auto;
}

.main-cover-btn:hover {
    background: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
    color: #ffc107;
    transform: scale(1.1);
}

.main-cover-btn.active {
    background: rgba(255, 193, 7, 0.4);
    border-color: #ffc107;
    color: #ffc107;
    opacity: 1;
    pointer-events: auto;
}

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

.main-sticker-btn {
    position: absolute;
    top: 5px;
    right: 70px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid rgba(0, 123, 255, 0.6);
    color: #007bff;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 15;
    opacity: 0.3;
    pointer-events: auto;
}

.sticker-item:hover .main-sticker-btn {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.main-sticker-btn:hover {
    background: rgba(0, 123, 255, 0.3);
    border-color: #007bff;
    color: #007bff;
    transform: scale(1.1);
}

.main-sticker-btn.active {
    background: rgba(0, 123, 255, 0.6);
    border-color: #007bff;
    color: #007bff;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
}

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

/* Stickers Loading Indicator */
.stickers-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.stickers-loading p {
    margin-top: 15px;
    font-size: 14px;
}

/* Packs Loading Indicator */
.packs-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.packs-loading p {
    margin-top: 15px;
    font-size: 14px;
}

.spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Sticker Viewer */
.sticker-viewer .modal-content {
    max-width: 600px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.sticker-viewer .modal-content.sticker-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.sticker-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.sticker-viewer-content {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px var(--shadow), 0 0 0 1px var(--border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="light"] .sticker-viewer-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border);
}

.sticker-viewer-content img,
.sticker-viewer-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sticker-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-btn {
    pointer-events: all;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    /* Оптимизация для мобильных */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.sticker-viewer .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

/* Upload Modal */
.upload-modal-content {
    max-width: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px var(--shadow), 0 0 0 1px var(--border);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-form label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 200px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow-glow), 0 4px 12px rgba(51, 144, 236, 0.2);
    background: var(--bg-card);
}

.upload-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.upload-status {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        position: relative;
        padding: 12px 0;
        margin-bottom: 15px;
    }
    
    .header-content {
        gap: 12px;
    }
    
    .header-top-row {
        gap: 10px;
    }
    
    .search-box {
        min-width: unset;
    }
    
    .search-box input {
        padding: 10px 40px 10px 40px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .header-filters-row {
        flex-direction: column;
        gap: 0;
        padding: 12px 0;
        margin-top: 8px;
    }
    
    .filters-inline {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-select {
        width: 100%;
        min-width: unset;
    }
    
    .reset-filters-btn {
        align-self: flex-end;
        margin-top: 4px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Скрываем кнопку загрузки на мобильных */
    .upload-btn {
        display: none;
    }
    
    /* Упрощённая секция тегов на мобильных */
    .tags-filter-section {
        display: block;
        margin-top: 15px;
    }
    
    .tags-filter-label {
        display: none !important;
        margin-bottom: 10px;
        font-size: 13px;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        align-items: center;
        justify-content: space-between;
    }
    
    .tags-filter-label i {
        font-size: 14px;
    }
    
    .tags-toggle-icon {
        display: none !important;
        font-size: 12px;
        transition: transform 0.2s ease;
        margin-left: auto;
        padding-left: 8px;
    }
    
    .tags-filter-label.collapsed .tags-toggle-icon {
        transform: rotate(-90deg);
    }
    
    .tags-filter-container {
        max-height: none !important;
        overflow: visible !important;
        transition: none;
    }
    
    .tags-filter-section.expanded .tags-filter-container {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .tags-filter-section.collapsed .tags-filter-container {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .tags-filter-list {
        gap: 6px;
        padding-top: 8px;
    }
    
    .tag-filter-item {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    .tag-filter-count {
        font-size: 10px;
        padding: 1px 5px;
        min-width: 16px;
    }
    
    .packs-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .pack-card {
        border-radius: 12px;
    }
    
    .pack-info {
        padding: 15px 12px;
    }
    
    .pack-name {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .pack-character {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .pack-meta {
        font-size: 12px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pack-actions {
        gap: 6px;
    }
    
    .like-btn,
    .dislike-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .delete-pack-btn {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .stickers-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .sticker-media-container {
        padding: 6px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin-top: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-header h2 {
        font-size: 20px;
        flex: 1;
        min-width: 0;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .pack-info {
        padding: 15px 12px;
    }
    
    .pack-info-item {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .upload-modal-content {
        max-width: 100%;
    }
    
    .upload-form textarea {
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 12px;
        min-height: 150px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 44px;
        flex: 1;
    }
    
    .upload-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination {
        gap: 8px;
        margin-top: 30px;
    }
    
    .pagination button {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        min-width: 44px;
    }
    
    .empty-state {
        padding: 60px 20px;
    }
    
    .empty-state i {
        font-size: 48px;
    }
    
    .empty-state h2 {
        font-size: 20px;
    }
    
    .success-message,
    .error-message {
        bottom: 15px;
        right: 15px;
        left: 15px;
        max-width: calc(100% - 30px);
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .sticker-viewer-content {
        padding: 15px;
        border-radius: 16px;
    }
    
    .delete-pack-btn-modal {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 8px 0;
        margin-bottom: 12px;
    }
    
    .header-content {
        gap: 8px;
    }
    
    .packs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stickers-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .sticker-media-container {
        padding: 5px;
    }
    
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        margin-top: 5px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .pack-info {
        padding: 12px 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .pagination button {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 44px;
        min-width: 40px;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state i {
        font-size: 40px;
    }
    
    .empty-state h2 {
        font-size: 18px;
    }
    
    .sticker-viewer-content {
        padding: 10px;
    }
}

/* Оптимизация для очень маленьких экранов */
@media (max-width: 360px) {
    .pack-name {
        font-size: 14px;
    }
    
    .pack-character {
        font-size: 12px;
    }
    
    .pack-meta {
        font-size: 11px;
    }
    
    .type-select {
        font-size: 12px;
        padding: 10px 12px;
        min-width: 120px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
}

/* Tags Filter Section */
.tags-filter-section {
    margin-top: 20px;
}

.tags-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: default;
}

.tags-filter-label i {
    font-size: 16px;
    color: var(--accent);
}

.tags-toggle-icon {
    display: none; /* По умолчанию скрыт на десктопе */
}

.tags-filter-container {
    width: 100%;
    max-height: none !important; /* На десктопе всегда видимо */
    overflow: visible !important;
}

.tags-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tag-filter-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tag-filter-item.active {
    background: rgba(51, 144, 236, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.tag-filter-item.active:hover {
    background: rgba(51, 144, 236, 0.25);
}

.tag-filter-text {
    font-weight: 500;
}

.tag-filter-count {
    font-size: 11px;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tag-filter-item.active .tag-filter-count {
    background: rgba(51, 144, 236, 0.2);
    opacity: 1;
}

.more-tags-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.more-tags-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* Pack Tags (on pack page) */
.pack-tags-container {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.pack-tags-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pack-tags-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pack-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pack-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(51, 144, 236, 0.1);
    border: 1px solid rgba(51, 144, 236, 0.3);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    transition: all 0.2s ease;
}

.pack-tag {
    position: relative;
    padding-right: 28px;
}

.pack-tag:hover {
    background: rgba(51, 144, 236, 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.pack-tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.add-tag-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(51, 144, 236, 0.1);
    border: 1px solid rgba(51, 144, 236, 0.3);
    border-radius: 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-tag-btn:hover {
    background: rgba(51, 144, 236, 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.add-tag-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.add-tag-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-tag-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.add-tag-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.2);
}

.save-tag-btn,
.cancel-tag-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.save-tag-btn {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.save-tag-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.cancel-tag-btn {
    color: var(--text-muted);
}

.cancel-tag-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.pack-tag-remove {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0;
}

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

.pack-tag-remove:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

/* Pack Card Tags (on main page) */
.pack-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.pack-card-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.pack-card-tag:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(51, 144, 236, 0.4);
    color: var(--text-primary);
}

.pack-card-tag-more {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Responsive Tags */
@media (max-width: 768px) {
    .pack-tags-container {
        padding: 12px;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .pack-tags-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .pack-tags-content {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pack-tags-label {
        font-size: 13px;
    }
    
    .pack-tags-list {
        width: 100%;
        gap: 6px;
    }
    
    .pack-tag {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    .pack-tag-remove {
        width: 22px;
        height: 22px;
        font-size: 11px;
        right: 3px;
        opacity: 1;
        background: rgba(255, 255, 255, 0.15);
    }
    
    .pack-tag-remove:active {
        background: rgba(255, 59, 48, 0.3);
        transform: translateY(-50%) scale(1.1);
    }
    
    .add-tag-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
        touch-action: manipulation;
    }
    
    .add-tag-form {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .add-tag-input {
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 10px 12px;
        min-height: 44px;
    }
    
    .save-tag-btn,
    .cancel-tag-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .pack-card-tag {
        padding: 4px 8px;
        font-size: 10px;
        max-width: 90px;
        min-height: 24px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .tags-filter-section {
        margin-top: 12px;
    }
    
    .tags-filter-label {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .tags-filter-list {
        gap: 5px;
        padding-top: 6px;
    }
    
    .tag-filter-item {
        padding: 7px 10px;
        font-size: 11px;
        min-height: 34px;
    }
    
    .tag-filter-count {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .more-tags-btn {
        padding: 7px 10px;
        font-size: 11px;
        min-height: 34px;
    }
    
    .pack-card-tags {
        gap: 4px;
    }
    
    .pack-card-tag {
        max-width: 75px;
        font-size: 9px;
        padding: 3px 6px;
        min-height: 22px;
    }
    
    .pack-tags-container {
        padding: 10px;
    }
    
    .pack-tag {
        padding: 7px 10px;
        font-size: 11px;
        min-height: 34px;
    }
    
    .add-tag-btn {
        padding: 9px 14px;
        font-size: 12px;
        min-height: 38px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Оптимизация для мобильных - более тонкий скроллбар */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 6px;
    }
}

/* Оптимизация изображений для мобильных */
@media (max-width: 768px) {
    img, video {
        /* Улучшение рендеринга на мобильных */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Улучшение производительности анимаций на мобильных */
@media (max-width: 768px) {
    .pack-card:hover {
        transform: none; /* Отключаем hover эффекты на мобильных */
    }
    
    .sticker-item:hover {
        transform: none; /* Отключаем hover эффекты на мобильных */
    }
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.98) 0%, rgba(10, 10, 15, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    padding: 50px 0 20px;
    margin-top: 80px;
}

[data-theme="light"] .footer {
    background: linear-gradient(180deg, rgba(245, 245, 247, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-top-color: rgba(0, 0, 0, 0.08);
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    gap: 50px;
    padding-bottom: 35px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

/* Footer Brand Section */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    max-width: 280px;
}

/* Footer Links Section */
.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.footer-links-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section-title i {
    color: var(--accent);
    font-size: 18px;
    flex-shrink: 0;
}

.footer-tags-list,
.footer-messengers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.footer-tag,
.footer-messenger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}

[data-theme="light"] .footer-tag,
[data-theme="light"] .footer-messenger {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.footer-tag:hover,
.footer-messenger:hover {
    background: rgba(51, 144, 236, 0.12);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.15);
}

/* Footer Actions Section */
.footer-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
}

.footer-copyright {
    text-align: center;
}

.footer-copyright p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.footer-sitemap-link {
    margin-top: 10px;
    font-size: 13px;
    display: block;
}

.sitemap-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
}

.sitemap-link:hover {
    color: var(--accent);
    background: rgba(51, 144, 236, 0.1);
    text-decoration: none;
}

.sitemap-link i {
    font-size: 14px;
}

/* Auth Section in Footer */
.auth-section {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#authLoggedIn {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
}

.auth-user-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.25s ease;
}

[data-theme="light"] .auth-user-info {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.auth-user-info i {
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.auth-user {
    color: var(--text-primary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.footer-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--text-primary);
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(51, 144, 236, 0.25);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    min-width: 140px;
}

.footer-auth-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.footer-auth-btn:hover::before {
    width: 300px;
    height: 300px;
}

.footer-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(51, 144, 236, 0.4);
}

.footer-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(51, 144, 236, 0.3);
}

.footer-auth-btn i {
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.footer-auth-btn span {
    position: relative;
    z-index: 1;
}

.footer-auth-btn.logout-btn {
    background: linear-gradient(135deg, rgba(51, 144, 236, 0.2), rgba(157, 107, 255, 0.2));
    border: 1.5px solid var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 10px rgba(51, 144, 236, 0.15);
}

.footer-auth-btn.logout-btn:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--text-primary);
    box-shadow: 0 6px 25px rgba(51, 144, 236, 0.4);
    border-color: transparent;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
    
    .footer-actions {
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 35px 0 15px;
        margin-top: 50px;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 35px;
        padding-bottom: 30px;
        margin-bottom: 25px;
    }
    
    .footer-brand {
        text-align: center;
        align-items: center;
    }
    
    .footer-brand-description {
        max-width: 100%;
        text-align: center;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-links-group {
        align-items: center;
        text-align: center;
    }
    
    .footer-tags-list,
    .footer-messengers-list {
        justify-content: center;
    }
    
    .footer-actions {
        align-items: stretch;
        width: 100%;
    }
    
    .auth-section {
        width: 100%;
    }
    
    #authLoggedIn {
        align-items: stretch;
        width: 100%;
    }
    
    .auth-user-info {
        justify-content: center;
        width: 100%;
    }
    
    .auth-user {
        max-width: none;
        text-align: center;
    }
    
    .footer-auth-btn {
        width: 100%;
    }
    
    .footer-upload-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-bottom {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 30px 0 15px;
        margin-top: 40px;
    }
    
    .footer-main {
        gap: 30px;
        padding-bottom: 25px;
        margin-bottom: 20px;
    }
    
    .footer-brand-title {
        font-size: 18px;
    }
    
    .footer-brand-description {
        font-size: 13px;
    }
    
    .footer-section-title {
        font-size: 13px;
        justify-content: center;
    }
    
    .footer-section-title i {
        font-size: 16px;
    }
    
    .footer-tag,
    .footer-messenger {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    .footer-copyright p {
        font-size: 12px;
    }
    
    .footer-auth-btn {
        font-size: 13px;
        padding: 11px 20px;
        min-width: 120px;
    }
    
    .auth-user-info {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    .auth-user-info i {
        font-size: 16px;
    }
}

/* Login Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.form-group label i {
    font-size: 16px;
    color: var(--accent);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-group input {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--shadow-glow), 0 4px 12px rgba(51, 144, 236, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.login-error {
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.4);
    border-radius: 12px;
    color: #ff3b30;
    font-size: 14px;
    display: none;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.2);
}

.login-error:not(:empty),
.login-error[style*="display: block"] {
    display: block !important;
}

.login-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(51, 144, 236, 0.2);
    position: relative;
    overflow: hidden;
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 144, 236, 0.4);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-submit-btn i {
    font-size: 18px;
    position: relative;
    z-index: 1;
}

.login-submit-btn span {
    position: relative;
    z-index: 1;
}

/* Admin Link in Footer */
.footer-admin-link {
    display: none;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    margin-left: 15px;
    padding: 4px 8px;
    border-radius: 6px;
}

.footer-admin-link:hover {
    color: var(--accent);
    background: rgba(51, 144, 236, 0.1);
    text-decoration: none;
}

.footer-admin-link i {
    font-size: 14px;
    margin-right: 4px;
}

/* Admin Page Styles */
.admin-page {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.admin-header h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.admin-header h1 i {
    color: var(--accent);
}

.admin-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.admin-section {
    margin-bottom: 40px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
}

.admin-section-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.admin-section-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-section-header h2 i {
    color: var(--accent);
    font-size: 24px;
}

.admin-section-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.admin-card:hover {
    border-color: var(--accent);
    box-shadow: 0 5px 25px var(--shadow-glow);
    transform: translateY(-2px);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.admin-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.admin-badge {
    padding: 6px 12px;
    background: var(--accent);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-badge-warning {
    background: var(--accent-secondary);
}

.admin-card-body {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.admin-card-body p {
    margin: 0 0 15px 0;
}

.admin-card-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-btn {
    min-width: 180px;
}

.admin-status {
    min-height: 24px;
    display: flex;
    align-items: center;
}

.status-success {
    color: #4ade80;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-error {
    color: #f87171;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card-info {
    background: rgba(157, 107, 255, 0.1);
    border-color: var(--accent-secondary);
}

.admin-status-display {
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot-running {
    background: var(--accent);
}

.status-dot-success {
    background: #28a745;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

/* Admin Statistics */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.admin-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--shadow-glow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Admin Actions Grid */
.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.admin-action-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-action-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow-glow);
}

.admin-action-card i {
    font-size: 32px;
    color: var(--accent);
}

/* Responsive Admin Styles */
@media (max-width: 768px) {
    .admin-page {
        padding: 20px 10px;
    }
    
    .admin-header h1 {
        font-size: 32px;
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-section {
        padding: 20px;
    }
    
    .admin-section-header h2 {
        font-size: 22px;
    }
    
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-btn {
        width: 100%;
    }
    
    .footer-admin-link {
        width: 100%;
        min-width: unset;
    }
}

/* ==================== SEARCH PAGE STYLES ==================== */

.search-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.search-page-header h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.search-page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.search-filters {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-type-filter {
    display: flex;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}

.search-type-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
}

.search-type-option input[type="radio"] {
    display: none;
}

.search-type-option span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.search-type-option input[type="radio"]:checked + span {
    color: var(--text-primary);
}

.search-type-option:has(input[type="radio"]:checked) {
    background: var(--accent);
}

.search-type-option:has(input[type="radio"]:checked) span {
    color: white;
}

.search-type-option:hover:not(:has(input[type="radio"]:checked)) {
    background: var(--bg-card);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 1400px) {
    .search-results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1000px) {
    .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.search-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pack-result {
    padding-bottom: 0;
}

.search-result-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.result-preview {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.result-preview img,
.result-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sticker-preview {
    padding: 20px;
}

.result-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 48px;
}

.result-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.result-count {
    color: var(--text-secondary);
}

.result-reactions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-like-btn,
.result-dislike-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.result-like-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.result-dislike-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.result-like-btn.active {
    color: #22c55e;
}

.result-dislike-btn.active {
    color: #ef4444;
}

.result-like-btn i,
.result-dislike-btn i {
    font-size: 14px;
}

.result-like-count,
.result-dislike-count {
    font-size: 13px;
    font-weight: 500;
}

.result-emoji {
    font-size: 24px;
    line-height: 1;
    margin-top: 4px;
}

.add-stickers-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #3390ec;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: auto;
}

.add-stickers-btn:hover {
    background: #2a7fd4;
    color: white;
}

.add-stickers-btn:active {
    background: #2369b8;
}

.messenger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.messenger-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.add-stickers-btn span:not(.messenger-icon) {
    font-weight: 500;
}

/* Pagination for search page */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search scroll loader */
.search-scroll-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-scroll-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.search-scroll-loader p {
    margin: 0;
    font-size: 14px;
}

/* Mobile styles for search page */
@media (max-width: 768px) {
    .search-page-header h1 {
        font-size: 28px;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-type-filter {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-type-option {
        flex: 1;
        justify-content: center;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-scroll-loader {
        padding: 30px 15px;
    }
    
    .search-scroll-loader .spinner {
        width: 32px;
        height: 32px;
    }
    
    .search-scroll-loader p {
        font-size: 13px;
    }
    
    .result-info {
        padding: 12px;
    }
    
    .result-title {
        font-size: 14px;
    }
    
    .result-subtitle {
        font-size: 12px;
    }
    
    .pagination {
        gap: 6px;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
        padding: 0 8px;
    }
}

