
:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --highlight-light: #ff6b81;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --purple: #6f42c1;
    --text: #ffffff;
    --text-secondary: #b8b8b8;
    --border-radius: 20px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--primary);
    color: var(--text);
    position: relative;
}

/* Particles.js container */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--primary);
}

/* Стили для кастомного контекстного меню */
#custom-context-menu {
    display: none;
    position: absolute;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    width: 200px;
}

#custom-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#custom-context-menu li {
    padding: 8px 15px;
    color: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 20px
}

#custom-context-menu li:hover {
    background-color: #0f3460;
}

#custom-context-menu .icon {
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
}

#custom-context-menu .icon img {
    width: 30px;
    height: 30px;
}

#quick-access {
    font-weight: bold;
    border-bottom: 1px solid #444;
    pointer-events: none;
}

header {
    background-color: rgba(22, 33, 62, 0.95);
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-right: 20px;
}

.logo-icon {
    color: var(--highlight);
    font-size: 1.8rem;
}

.nav-container {
    display: flex;
    align-items: center;
    width: 100%;
    flex-grow: 1;
}

.main-nav {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

nav a:hover {
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.05);
}

nav a.active {
    color: var(--highlight);
    background-color: rgba(233, 69, 96, 0.1);
}

.action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
    white-space: nowrap;
}

.action-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.action-button svg {
    width: 16px;
    height: 16px;
}

.chat-btn {
    background-color: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

.chat-btn:hover {
    background-color: rgba(23, 162, 184, 0.25);
}

.deposit-btn {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.deposit-btn:hover {
    background-color: rgba(40, 167, 69, 0.25);
}

.cart-btn {
    background-color: rgba(255, 193, 7, 0.15);
    color: var(--warning);
}

.cart-btn:hover {
    background-color: rgba(255, 193, 7, 0.25);
}

.history-btn {
    background-color: rgba(111, 66, 193, 0.15);
    color: var(--purple);
}

.history-btn:hover {
    background-color: rgba(111, 66, 193, 0.25);
}

.admin-btn {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

.admin-btn:hover {
    background-color: rgba(220, 53, 69, 0.25);
}

.logout-btn {
    background-color: rgba(233, 69, 96, 0.15);
    color: var(--highlight);
}

.logout-btn:hover {
    background-color: rgba(233, 69, 96, 0.25);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 15px;
}

.user-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.user-balance {
    background-color: rgba(233, 69, 96, 0.15);
    color: var(--highlight);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.login-btn {
    background-color: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.register-btn {
    background-color: var(--highlight);
    color: white;
}

.register-btn:hover {
    background-color: var(--highlight-light);
}

.search-container {
    width: 100%;
}

.search-bar {
    width: 100%;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-bar:focus {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--highlight);
}

/* Модальное окно чата */
.chat-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    background-color: var(--secondary);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    overflow: hidden;
}

.chat-header {
    background-color: var(--accent);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-chat {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-break: break-word;
}

.message.self {
    align-self: flex-end;
    background-color: var(--highlight);
}

.message.other {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.1);
}

.message-sender {
    font-size: 0.8rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
    outline: none;
}

.chat-input button {
    margin-left: 10px;
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background-color: var(--highlight);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.chat-input button:hover {
    background-color: var(--highlight-light);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

/* Анимация дрожания вокруг центра */
@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

/* Применение анимации при наведении */
.shake-on-hover:hover {
    animation: shake 0.2s ease-in-out infinite;
}

/* Стили для иконок */
.action-button svg,
nav a svg {
    transition: transform 0.2s ease;
}

.action-button:hover svg,
nav a:hover svg {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .main-nav ul {
        justify-content: center;
        gap: 3px;
    }
    
    nav a {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        justify-content: center;
        gap: 5px;
        margin-left: 0;
    }
    
    .action-button span {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    .logo {
        margin-right: 0;
        justify-content: center;
    }

    .chat-modal {
        width: 95%;
        height: 80%;
    }
}