/* ===================================================
   AXORY STORE - TELEGRAM MINI APP DESIGN
   Полностью переработанный дизайн для Telegram Mini App
   =================================================== */

/* ========== CSS ПЕРЕМЕННЫЕ ========== */
:root {
    /* Основные цвета */
    --accent-primary: #6C63FF;
    --accent-hover: #5750e6;
    --accent-light: rgba(108, 99, 255, 0.1);
    
    /* Светлая тема */
    --bg-primary-light: #F8F9FB;
    --bg-card-light: #FFFFFF;
    --bg-secondary-light: #F0F1F3;
    --text-primary-light: #1B1C1E;
    --text-secondary-light: #A6A9B6;
    --border-light: #E5E7EB;
    
    /* Тёмная тема */
    --bg-primary-dark: #1D1E22;
    --bg-card-dark: #2A2B30;
    --bg-secondary-dark: #23242A;
    --text-primary-dark: #EDEDED;
    --text-secondary-dark: #A6A9B6;
    --border-dark: #3A3B40;
    
    /* Радиусы */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.16);
    
    /* Переходы */
    --transition-fast: 0.15s ease;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-индексы */
    --z-header: 1000;
    --z-sidebar: 1100;
    --z-overlay: 1050;
    --z-modal: 1200;
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition), color var(--transition);
}

/* Светлая тема (по умолчанию) */
body.theme-light,
body[data-theme="light"] {
    --bg-primary: var(--bg-primary-light);
    --bg-card: var(--bg-card-light);
    --bg-secondary: var(--bg-secondary-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --border-color: var(--border-light);
    
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Тёмная тема */
body.theme-dark,
body[data-theme="dark"] {
    --bg-primary: var(--bg-primary-dark);
    --bg-card: var(--bg-card-dark);
    --bg-secondary: var(--bg-secondary-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --border-color: var(--border-dark);
    
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Отключаем скролл при открытых сайдбарах */
body.no-scroll {
    overflow: hidden;
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-header);
    transition: transform var(--transition), background-color var(--transition);
}

.header.hidden {
    transform: translateY(-100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 100%;
}

.header-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-secondary);
}

.header-btn:active {
    transform: scale(0.92);
    background: var(--accent-light);
}

.header-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--accent-light);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.header-btn:active::after {
    width: 100px;
    height: 100px;
}

.header-btn svg {
    width: 22px;
    height: 22px;
}

/* Logo */
.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* Cart count badge */
.cart-count {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    padding: 0 5px;
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-top: 60px;
    padding: 16px;
    min-height: calc(100vh - 60px);
}

/* ========== OVERLAY ========== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: var(--z-overlay);
    transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========== SIDEBAR BASE ========== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-card);
    z-index: var(--z-sidebar);
    overflow-y: auto;
    transition: transform var(--transition);
    box-shadow: var(--shadow-xl);
}

/* Кастомный скроллбар для сайдбаров */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Левый сайдбар (настройки) */
#settingsSidebar {
    left: 0;
    transform: translateX(-100%);
}

#settingsSidebar.active {
    transform: translateX(0);
}

/* Правый сайдбар (корзина) */
#cartSidebar {
    right: 0;
    transform: translateX(100%);
}

#cartSidebar.active {
    transform: translateX(0);
}

/* Кнопка закрытия сайдбара */
.sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    z-index: 10;
}

.sidebar-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    transform: rotate(90deg);
}

.sidebar-close:active {
    transform: rotate(90deg) scale(0.85);
    background: rgba(239, 68, 68, 0.2);
}

/* Контент сайдбара */
.sidebar-content {
    padding: 20px;
    padding-top: 60px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.sidebar-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ========== SETTINGS SIDEBAR ========== */

/* Кнопка профиля */
.sidebar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
}

.sidebar-btn-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.sidebar-btn-text {
    flex: 1;
}

/* Группа кнопок настроек */
.sidebar-btn-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-btn {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
}

.settings-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

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

/* Theme toggle */
.theme-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.theme-toggle {
    position: relative;
    width: 56px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 16px;
    cursor: pointer;
    transition: background-color var(--transition);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.theme-dark .theme-toggle {
    background: var(--accent-primary);
}

body.theme-dark .theme-toggle::before {
    transform: translateX(24px);
}

/* ========== CART SIDEBAR ========== */

.cart-items {
    margin-bottom: 20px;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.cart-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.cart-empty h3 {
    font-size: 16px;
    font-weight: 500;
}

/* Cart item */
.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    transition: background-color var(--transition-fast);
}

.cart-item:hover {
    background: var(--bg-primary);
}

.cart-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-item-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.cart-item-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-top: auto;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

/* Quantity controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.qty-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

.qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Remove button */
.remove-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: var(--radius);
    color: #EF4444;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

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

/* Cart total */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.cart-total::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: shimmer 3s infinite;
}

/* Checkout button */
.cart-checkout {
    width: 100%;
    padding: 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
    position: relative;
    overflow: hidden;
}

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

.cart-checkout:active::before {
    width: 300px;
    height: 300px;
}

.cart-checkout:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.5);
}

.cart-checkout:active {
    transform: translateY(0);
}

.cart-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cart-checkout:disabled::before {
    display: none;
}

/* ========== PRODUCTS GRID ========== */

/* Category chips */
.category-section {
    margin-bottom: 16px;
}

.category-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
}

.chip.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.chip:active {
    transform: scale(0.95);
}

/* Gender filters */
.filter-section {
    margin-bottom: 20px;
}

.gender-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gender-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--bg-secondary);
}

.filter-btn.active {
    background: var(--accent-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Product card */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
    position: relative;
}

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

.product-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(108, 99, 255, 0.05),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.product-card:hover::before {
    opacity: 1;
    animation: shine 1.5s ease-in-out infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.product-image {
        width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-secondary);
}

.product-info {
    padding: 12px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color var(--transition-fast);
}

.product-card:hover .product-name {
    color: var(--accent-primary);
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    transition: transform var(--transition-fast);
    display: block;
    text-align: center;
}

.product-card:hover .product-price {
    transform: scale(1.05);
}

/* ========== CONTACT SECTION ========== */

.contact-section {
    margin-top: 32px;
    padding: 20px 0;
    }
    
    .contact-card {
    background: var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite;
}

.contact-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite reverse;
}

.contact-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.contact-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.contact-content p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
    line-height: 1.5;
    }
    
    .contact-manager {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.telegram-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(2px) scale(1.05);
}

.telegram-link:active {
    transform: translateX(0) scale(0.98);
}

/* ========== LOADING STATE ========== */

.loading-state {
    display: flex;
        flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

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

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

/* ========== BUTTON STYLES ========== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--accent-light);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn-secondary:active::after {
    width: 300px;
    height: 300px;
}

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

/* ========== RESPONSIVE ========== */

@media (max-width: 640px) {
    .main-content {
        padding: 12px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .product-price {
        font-size: 15px;
    }
}

/* ========== ANIMATIONS ========== */

/* Fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ========== ДОПОЛНИТЕЛЬНЫЕ ВИЗУАЛЬНЫЕ ЭФФЕКТЫ ========== */

/* Эффект стекла (glassmorphism) */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.theme-dark .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Неоморфизм (мягкие тени) */
.neomorph {
    background: var(--bg-card);
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.1),
        -8px -8px 16px rgba(255, 255, 255, 0.5);
}

body.theme-dark .neomorph {
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 0.02);
}

/* Градиентные границы */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--accent-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Светящийся эффект */
.glow {
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(108, 99, 255, 0.5);
    }
}

/* Эффект радуги на hover */
.rainbow-hover {
    position: relative;
    overflow: hidden;
}

.rainbow-hover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(108, 99, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.rainbow-hover:hover::before {
    opacity: 1;
    animation: rainbow-slide 1.5s ease-in-out infinite;
}

@keyframes rainbow-slide {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Эффект пульсации */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Эффект покачивания */
.wiggle {
    animation: wiggle 1s ease-in-out;
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Эффект прыжка */
.bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Градиентный текст */
.gradient-text {
    background: var(--accent-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Эффект рипл (волна при клике) */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}

/* Парящие частицы фон */
.floating-particles {
    position: relative;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.05;
    animation: float 20s ease-in-out infinite;
}

.floating-particles::before {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-particles::after {
    bottom: 10%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Эффект shimmer (мерцание) */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

/* Улучшенные карточки с 3D эффектом */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Магнитный эффект на кнопках */
.magnetic-btn {
    transition: transform 0.2s ease;
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Эффект печатной машинки для текста */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* Кастомный скроллбар с акцентом */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

/* Эффект успеха с конфетти */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    animation: confetti-fall 3s ease-in-out;
}

/* Улучшенный фокус для доступности */
*:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Эффект loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--border-color) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Прогресс бар с градиентом */
.progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

/* Эффект наклона при hover */
.tilt-hover {
    transition: transform 0.3s ease;
}

.tilt-hover:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ========== UTILITIES ========== */

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

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.hidden {
        display: none !important;
    }
    
/* ========== ACCESSIBILITY ========== */

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ========== SCROLLBAR ========== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
