/* OpenRust - Custom Styles */

/* Rust Font - только для логотипа */
@font-face {
    font-family: 'Rust';
    src: url('../fonts/RUST.eot'); /* IE9 Compat Modes */
    src: url('../fonts/RUST.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('../fonts/RUST.woff') format('woff'), /* Modern Browsers */
         url('../fonts/RUST.TTF') format('truetype'), /* Safari, Android, iOS */
         url('../fonts/RUST.svg#rust') format('svg'); /* Legacy iOS */
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --rust-primary: #ce422b;
    --rust-secondary: #738d45;
    --rust-accent: #96d031;
    --rust-dark: #191e18;
    --rust-darker: #0d0f0c;
    --rust-light: #2a2a22;
    --rust-blue: #255579;
    --rust-orange: #d2691e;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --background-overlay: rgba(25, 30, 24, 0.85);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--rust-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loader Styles */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: var(--rust-darker);
}

#loader {
    display: block;
    position: relative;
    left: 50%;
    top: 50%;
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--rust-secondary);
    animation: spin 2s linear infinite;
    z-index: 10000;
}

#loader:before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--rust-primary);
    animation: spin 3s linear infinite;
}

#loader:after {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--rust-blue);
    animation: spin 1.5s linear infinite;
}

.loader-section {
    position: fixed;
    top: 0;
    width: 51%;
    height: 100%;
    background-color: var(--rust-darker);
    z-index: 9998;
    transform: translateX(0);
}

.section-left {
    left: 0;
}

.section-right {
    right: 0;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideOutLeft {
    to { transform: translateX(-100%); }
}

@keyframes slideOutRight {
    to { transform: translateX(100%); }
}

.loaded .section-left {
    animation: slideOutLeft 0.7s ease-in-out forwards;
}

.loaded .section-right {
    animation: slideOutRight 0.7s ease-in-out forwards;
}

.loaded #loader-wrapper {
    visibility: hidden;
    transform: translateY(-100%);
    transition: all 0.3s 1s ease-out;
}

/* Navigation Styles */
.rust-navbar {
    background: linear-gradient(135deg, var(--background-overlay), rgba(42, 42, 34, 0.95));
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--rust-primary);
    transition: all 0.3s ease;
    padding: 1rem 0; /* Увеличили padding для лучших пропорций */
}

.navbar-nav {
    align-items: center;
    gap: 0.5rem; /* Добавляем расстояние между элементами навигации */
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.rust-navbar.scrolled {
    background: rgba(25, 30, 24, 0.98);
    backdrop-filter: blur(15px);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--text-light) !important;
}

.brand-text {
    font-family: 'Rust', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--rust-primary);
    text-shadow: 0 0 10px rgba(206, 66, 43, 0.5);
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 45px; /* Увеличили высоту под кнопку Steam */
}

.nav-link:hover {
    background-color: rgba(206, 66, 43, 0.2);
    color: var(--rust-accent) !important;
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: var(--rust-primary);
    color: white !important;
}

.nav-link i {
    font-size: 1.1rem;
}

/* Steam кнопка с картинкой */
.steam-login-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    height: auto !important;
    transition: all 0.3s ease;
}

.steam-login-btn:hover {
    background: none !important;
    transform: translateY(-2px) scale(1.05);
}

.steam-login-btn img {
    height: 45px; /* Увеличили размер */
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(1);
}

.steam-login-btn:hover img {
    filter: brightness(1.2) drop-shadow(0 4px 8px rgba(206, 66, 43, 0.4));
    animation: steamGlow 2s ease-in-out infinite alternate;
}

@keyframes steamGlow {
    0% {
        filter: brightness(1.2) drop-shadow(0 4px 8px rgba(206, 66, 43, 0.4));
    }
    100% {
        filter: brightness(1.3) drop-shadow(0 6px 12px rgba(206, 66, 43, 0.6));
    }
}

/* Button Styles */
.btn-rust {
    background: linear-gradient(135deg, var(--rust-primary), #b8361f);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3);
}

.btn-rust:hover {
    background: linear-gradient(135deg, #b8361f, var(--rust-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(206, 66, 43, 0.4);
    color: white;
}

.btn-outline-light {
    border: 2px solid var(--text-light);
    color: var(--text-light);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-outline-light:hover {
    background-color: var(--text-light);
    color: var(--rust-dark);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    margin-top: 76px;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: fixed; /* Фиксированный фон на всю страницу */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('../images/main_background.webp') center center/cover no-repeat;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 1;
    transition: opacity 2s ease-in-out;
    z-index: -100; /* Очень низкий z-index чтобы был под всем */
}

/* Дополнительный слой для смены фонов */
.hero-background-next {
    position: fixed; /* Фиксированный фон на всю страницу */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    z-index: -100; /* Очень низкий z-index чтобы был под всем */
}

.hero-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, 
        rgba(25, 30, 24, 0.8) 0%, 
        rgba(25, 30, 24, 0.6) 50%, 
        rgba(206, 66, 43, 0.3) 100%);
    z-index: -1;
    pointer-events: none; /* Чтобы не блокировал клики */
}

.hero-content {
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

.text-rust {
    color: var(--rust-primary);
    text-shadow: 0 0 20px rgba(206, 66, 43, 0.6);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    max-width: 600px;
}

.hero-actions {
    margin-bottom: 3rem;
}

/* Server Stats */
.server-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--rust-accent);
    text-shadow: 0 0 10px rgba(150, 208, 49, 0.5);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Server Panel */
.server-panel {
    background: linear-gradient(135deg, 
        rgba(42, 42, 34, 0.95), 
        rgba(25, 30, 24, 0.95));
    border-radius: 15px;
    border: 1px solid var(--rust-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: fadeInRight 1s ease-out;
}

.panel-header {
    background: linear-gradient(135deg, var(--rust-primary), #b8361f);
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.panel-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
}

.panel-body {
    padding: 2rem;
}

.server-info {
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 600;
    color: var(--text-muted);
}

.info-item .value {
    font-weight: 700;
    color: var(--text-light);
}

.status-online {
    color: var(--rust-accent) !important;
}

.status-online i {
    animation: pulse 2s infinite;
}

.copy-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Block System - чередование темных и светлых блоков */
.dark-block {
    background: linear-gradient(135deg, var(--rust-light), var(--rust-dark));
    border-top: 2px solid var(--rust-primary);
    position: relative;
    z-index: 1;
}

.light-block {
    background: transparent;
    border-top: 2px solid var(--rust-primary);
    position: relative;
    z-index: 1;
}

.light-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 30, 24, 0.7); /* Легкое затемнение для читаемости */
    z-index: -1;
}

/* Features Section - темный блок */
.features-section {
    /* Стили управляются классом dark-block */
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.feature-card {
    background: rgba(42, 42, 34, 0.9);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: var(--rust-primary);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--rust-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.feature-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* News Section - светлый блок */
.news-section {
    /* Стили управляются классом light-block */
}

.news-card {
    background: rgba(25, 30, 24, 0.85);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--rust-primary);
}

.news-date {
    font-size: 0.9rem;
    color: var(--rust-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-card h5 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.news-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--background-overlay), rgba(42, 42, 34, 0.95));
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--rust-primary);
    color: var(--text-light) !important;
    height: 76px; /* Такая же высота как у хедера */
    display: flex;
    align-items: center;
    position: relative;
    z-index: 200; /* Выше чем сайдбар */
}

.footer .fw-bold {
    font-family: 'Rust', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--rust-primary);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo-brand {
    display: flex;
    align-items: center; /* Выравнивание по центру для логотипа и текста */
}

.footer .copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--rust-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(206, 66, 43, 0.4);
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .server-stats {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1rem !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }
    
    .stat-item {
        flex: 1 !important;
        min-width: 0 !important;
        text-align: center !important;
    }
    
    .stat-label {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .stat-number {
        font-size: 1.8rem !important;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer {
        height: auto;
        padding: 1rem 0;
    }
    
    .footer .d-flex {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer .d-flex > .d-flex:first-child {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .footer .logo-brand {
        display: flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .footer .copyright {
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
        flex-basis: 100%;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .nav-text {
        display: inline; /* Показываем текст в мобильном меню */
        font-size: 0.9rem;
        margin-left: 0.5rem;
    }
    
    .hero-content {
        padding-top: 60px; /* Отступ только для текста Hero */
    }
    
    .navbar-nav {
        gap: 0.3rem; /* Меньшее расстояние на мобильных */
    }
    
    .nav-link {
        padding: 0.5rem !important;
        justify-content: center;
        height: 40px;
    }
    
    .steam-login-btn img {
        height: 35px; /* Увеличили и на мобильных */
    }
    
    .server-panel {
        margin-bottom: 2rem; /* Отступ снизу для планшетов */
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-lg {
        width: 100%;
    }
    
    .server-panel {
        margin-top: 2rem;
        margin-bottom: 3rem; /* Добавляем отступ снизу */
    }
    
    .server-stats {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.5rem !important;
        margin-top: 2rem !important;
        flex-wrap: nowrap !important;
    }
    
    .stat-item {
        flex: 1 !important;
        min-width: 0 !important;
        text-align: center !important;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .hero-content {
        padding-top: 50px; /* Отступ для текста Hero на маленьких экранах */
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px; /* Сделали тоньше */
}

::-webkit-scrollbar-track {
    background: var(--rust-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--rust-primary); /* Убрали градиент, просто красный */
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8361f; /* Темнее при наведении */
}

/* Background Music Player */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    transform: translateX(100px); /* Скрыта за экраном по умолчанию */
    transition: transform 0.5s ease-in-out;
}

.music-player.visible {
    transform: translateX(0); /* Показывается с анимацией */
}

.music-toggle {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--rust-primary), #b8361f);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.music-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(206, 66, 43, 0.4);
    background: linear-gradient(135deg, #b8361f, var(--rust-primary));
}

.music-toggle:active {
    transform: translateY(0) scale(0.95);
}

.music-toggle.playing {
    animation: musicPulse 2s ease-in-out infinite;
}

.music-toggle.muted {
    background: linear-gradient(135deg, var(--rust-primary), #b8361f);
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3);
}

.music-toggle.muted:hover {
    background: linear-gradient(135deg, #b8361f, var(--rust-primary));
    box-shadow: 0 6px 20px rgba(206, 66, 43, 0.4);
}

/* Перечёркнутая иконка для выключенного состояния */
.music-toggle.muted .fa-volume-up::before {
    content: "\f6a9"; /* FontAwesome fa-volume-mute (перечёркнутая) */
}

@keyframes musicPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3), 0 0 0 0 rgba(206, 66, 43, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(206, 66, 43, 0.4), 0 0 0 10px rgba(206, 66, 43, 0);
    }
}

/* Адаптивность для музыкального плеера */
@media (max-width: 768px) {
    .music-player {
        bottom: 15px;
        right: 15px;
        transform: translateX(80px); /* Меньше смещение для мобильных */
    }
    
    .music-player.visible {
        transform: translateX(0);
    }
    
    .music-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .music-player {
        bottom: 10px;
        right: 10px;
        transform: translateX(70px); /* Ещё меньше для маленьких экранов */
    }
    
    .music-player.visible {
        transform: translateX(0);
    }
    
    .music-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Utility Classes */
.text-rust {
    color: var(--rust-primary) !important;
}

.bg-rust {
    background-color: var(--rust-primary) !important;
}

.border-rust {
    border-color: var(--rust-primary) !important;
}

.shadow-rust {
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3) !important;
}

/* Shop Styles */
.shop-main {
    padding-top: 100px;
    padding-bottom: 100px; /* Добавляем отступ снизу для футера */
    position: relative;
    z-index: 2;
}

/* Shop Header */
.shop-header {
    background: linear-gradient(135deg, var(--rust-light), var(--rust-dark));
    border: 2px solid var(--rust-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem; /* Увеличиваем отступ снизу для dropdown */
    position: relative;
    overflow: visible; /* Позволяем dropdown выходить за границы */
}


.shop-category-dropdown {
    font-weight: 600;
}

.category-dropdown-menu {
    background: var(--rust-dark);
    border: 2px solid var(--rust-primary);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 1050; /* Высокий z-index для отображения поверх всех элементов */
}

.category-dropdown-menu .dropdown-item {
    color: var(--text-light);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.category-dropdown-menu .dropdown-item:hover,
.category-dropdown-menu .dropdown-item.active {
    background: var(--rust-primary);
    color: white;
}

.category-dropdown-menu .dropdown-item i {
    width: 20px;
}

.shop-search-input {
    background: var(--rust-darker);
    border: 1px solid var(--rust-primary);
    color: var(--text-light);
}

.shop-search-input:focus {
    background: var(--rust-darker);
    border-color: var(--rust-accent);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(150, 208, 49, 0.25);
}

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

/* Кнопка поиска - убираем смещение блока, анимируем только иконку */
.shop-search-input + .btn-rust:hover {
    transform: none; /* Убираем смещение всей кнопки */
}

.shop-search-input + .btn-rust:hover i {
    transform: scale(1.2); /* Увеличиваем только иконку */
    transition: transform 0.3s ease;
}

.shop-search-input + .btn-rust i {
    transition: transform 0.3s ease;
}

/* Shop Items Grid - 4 в ряду */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.shop-item {
    background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(206, 66, 43, 0.2);
    border-radius: 16px;
    padding: 0;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.shop-item:hover {
    border-color: var(--rust-primary);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(206, 66, 43, 0.3),
        0 0 0 1px rgba(206, 66, 43, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.shop-item:hover .shop-item-image img {
    transform: rotate(5deg) scale(1.1);
}

/* Современная картинка товара */
.shop-item-image {
    width: calc(100% - 20px); /* -10% по бокам */
    height: 180px;
    margin: 10px auto 0;
    background: linear-gradient(135deg, 
        rgba(206, 66, 43, 0.1) 0%, 
        rgba(115, 141, 69, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(206, 66, 43, 0.3);
}

.shop-item-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, 
        rgba(206, 66, 43, 0.1) 0%, 
        transparent 70%);
    border-radius: 12px;
}

.shop-item-image::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, 
        transparent, 
        rgba(206, 66, 43, 0.1), 
        transparent);
    animation: rotate 20s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shop-item:hover .shop-item-image::after {
    opacity: 1;
}

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

.shop-item-image img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
    z-index: 2;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Нижняя секция с названием и ценой */
.shop-item-info {
    padding: 1rem 1.5rem 1.5rem;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(26, 26, 26, 0.8) 100%);
}

.shop-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.3;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

/* Красивая цена в пилюле */
.shop-item-price {
    display: inline-block;
    background: linear-gradient(135deg, 
        rgba(206, 66, 43, 0.2) 0%, 
        rgba(206, 66, 43, 0.1) 100%);
    color: var(--rust-primary);
    border: 2px solid rgba(206, 66, 43, 0.4);
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.shop-item-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(206, 66, 43, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

.shop-item:hover .shop-item-price {
    border-color: var(--rust-primary);
    background: linear-gradient(135deg, 
        rgba(206, 66, 43, 0.3) 0%, 
        rgba(206, 66, 43, 0.2) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.4);
}

.shop-item:hover .shop-item-price::before {
    left: 100%;
}

/* Пилюльки под картинкой */
.shop-item-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem;
}

.shop-item-category {
    background: linear-gradient(135deg, 
        rgba(115, 141, 69, 0.3) 0%, 
        rgba(115, 141, 69, 0.2) 100%);
    color: rgba(115, 141, 69, 1);
    border: 1px solid rgba(115, 141, 69, 0.4);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.shop-item-rarity {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.shop-item-rarity.common { 
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.3), rgba(108, 117, 125, 0.2));
    color: rgba(108, 117, 125, 1);
    border: 1px solid rgba(108, 117, 125, 0.4);
}
.shop-item-rarity.uncommon { 
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.3), rgba(25, 135, 84, 0.2));
    color: rgba(25, 135, 84, 1);
    border: 1px solid rgba(25, 135, 84, 0.4);
}
.shop-item-rarity.rare { 
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.3), rgba(13, 110, 253, 0.2));
    color: rgba(13, 110, 253, 1);
    border: 1px solid rgba(13, 110, 253, 0.4);
}
.shop-item-rarity.epic { 
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.3), rgba(111, 66, 193, 0.2));
    color: rgba(111, 66, 193, 1);
    border: 1px solid rgba(111, 66, 193, 0.4);
}
.shop-item-rarity.legendary { 
    background: linear-gradient(135deg, rgba(253, 126, 20, 0.3), rgba(253, 126, 20, 0.2));
    color: rgba(253, 126, 20, 1);
    border: 1px solid rgba(253, 126, 20, 0.4);
}

/* Floating Sidebar */
.shop-sidebar {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 100; /* Понижаем z-index чтобы не перекрывать футер */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-sidebar-block {
    background: linear-gradient(135deg, var(--rust-light), var(--rust-dark));
    border: 2px solid var(--rust-primary);
    border-radius: 12px;
    padding: 1rem;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.shop-sidebar-title {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--rust-primary);
    padding-bottom: 0.5rem;
}

.balance-info {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--rust-accent);
    margin: 0.5rem 0;
    text-align: center;
}

.balance-currency {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Promo Form */
.promo-form .form-control {
    background: var(--rust-darker);
    border: 1px solid var(--rust-primary);
    color: var(--text-light);
}

.promo-form .form-control:focus {
    background: var(--rust-darker);
    border-color: var(--rust-accent);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(150, 208, 49, 0.25);
}

.promo-result {
    min-height: 1.5rem;
    font-size: 0.8rem;
    text-align: center;
}

.promo-result.success {
    color: var(--rust-accent);
}

.promo-result.error {
    color: var(--rust-primary);
}

/* Modern Modal Styles */
.modern-modal {
    background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(206, 66, 43, 0.3);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.modern-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(206, 66, 43, 0.2);
    border: 2px solid var(--rust-primary);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rust-primary);
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

.modern-close::before {
    content: '✕';
    display: block;
    line-height: 1;
}

.modern-close:hover {
    background: var(--rust-primary);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.4);
}

.modal-image-section {
    background: linear-gradient(135deg, 
        rgba(206, 66, 43, 0.1) 0%, 
        rgba(115, 141, 69, 0.1) 100%);
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-item-image {
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, 
        rgba(206, 66, 43, 0.2) 0%, 
        transparent 70%);
    border-radius: 50%;
    position: relative;
}

.modal-item-image::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: conic-gradient(from 0deg, 
        rgba(206, 66, 43, 0.3), 
        transparent, 
        rgba(206, 66, 43, 0.3));
    border-radius: 50%;
    animation: rotate 10s linear infinite;
    z-index: -1;
}

.modal-item-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

.modal-item-img:hover {
    transform: rotate(5deg) scale(1.05);
}

.modal-rarity-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3);
}

.modal-content-section {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-header-section {
    margin-bottom: 1.5rem;
}

.modal-item-title {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.modal-category {
    color: var(--rust-primary);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.modal-description {
    flex: 1;
    margin-bottom: 1.5rem;
}

.modal-description p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1rem;
}

.modal-price-section {
    margin-bottom: 1.5rem;
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(206, 66, 43, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(206, 66, 43, 0.3);
}

.price-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price-value {
    color: var(--rust-primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-quantity-section {
    margin-bottom: 2rem;
}

.quantity-label {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 1rem;
    display: block;
    font-size: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.qty-btn {
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3);
}

.qty-btn:hover {
    background: linear-gradient(135deg, var(--rust-secondary), var(--rust-primary));
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(206, 66, 43, 0.4);
}

.qty-input {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.8));
    border: 2px solid rgba(206, 66, 43, 0.3);
    color: var(--text-light);
    width: 100px;
    height: 45px;
    text-align: center;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.qty-input:focus {
    outline: none;
    border-color: var(--rust-primary);
    box-shadow: 0 0 0 3px rgba(206, 66, 43, 0.3);
    background: linear-gradient(135deg, rgba(206, 66, 43, 0.1), rgba(45, 45, 45, 0.9));
}

/* Красивый ползунок */
.quantity-slider-container {
    margin-top: 1rem;
}

.quantity-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        rgba(206, 66, 43, 0.2) 0%, 
        rgba(206, 66, 43, 0.1) 100%);
    outline: none;
    border: 1px solid rgba(206, 66, 43, 0.3);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.quantity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.4);
    transition: all 0.3s ease;
}

.quantity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(206, 66, 43, 0.6);
}

.quantity-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.4);
    transition: all 0.3s ease;
}

.quantity-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(206, 66, 43, 0.6);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-footer-section {
    border-top: 1px solid rgba(206, 66, 43, 0.2);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.total-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.total-value {
    color: var(--rust-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-buy {
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(206, 66, 43, 0.3);
}

.btn-buy:hover {
    background: linear-gradient(135deg, var(--rust-secondary), var(--rust-primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(206, 66, 43, 0.4);
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content-section {
        padding: 1.5rem;
    }
    
    .modal-image-section {
        min-height: 300px;
    }
    
    .modal-item-image {
        width: 200px;
        height: 200px;
    }
    
    .modal-item-img {
        width: 150px;
        height: 150px;
    }
    
    .modal-footer-section {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .btn-buy {
        width: 100%;
        justify-content: center;
    }
}

/* Pagination */
.pagination .page-link {
    background: var(--rust-darker);
    border-color: var(--rust-primary);
    color: var(--text-light);
}

.pagination .page-link:hover {
    background: var(--rust-primary);
    border-color: var(--rust-primary);
    color: white;
}

.pagination .page-item.active .page-link {
    background: var(--rust-primary);
    border-color: var(--rust-primary);
}

/* Toast Notifications */
.toast {
    backdrop-filter: blur(10px);
}

/* Loading State */
.shop-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.shop-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: var(--rust-primary);
}

/* Empty State */
.shop-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.shop-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--rust-primary);
}

/* Shop Media Queries */
@media (max-width: 1200px) {
    .shop-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .shop-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .shop-sidebar {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 2rem;
        margin-bottom: 2rem;
        flex-direction: row;
        justify-content: center;
        z-index: auto; /* Убираем фиксированный z-index на мобильных */
    }
    
    .shop-sidebar-block {
        min-width: auto;
        flex: 1;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .shop-main {
        padding-top: 120px;
        padding-bottom: 120px; /* Увеличиваем отступ снизу на мобильных */
    }
    
    .shop-header {
        padding: 1rem;
    }
    
    .shop-header .row > div {
        margin-bottom: 1rem;
    }
    
    .shop-header .row > div:last-child {
        margin-bottom: 0;
    }
    
    .shop-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .shop-item-image {
        height: 140px;
    }
    
    .shop-item-image img {
        width: 100px;
        height: 100px;
    }
    
    .shop-item-info {
        padding: 0.75rem 1rem 1rem;
    }
    
    .shop-item-name {
        font-size: 0.9rem;
    }
    
    .shop-item-price {
        font-size: 1.1rem;
    }
    
    .shop-sidebar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .shop-sidebar-block {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .shop-items-grid {
        grid-template-columns: 1fr;
    }
    
    .shop-category-dropdown {
        font-size: 0.9rem;
    }
    
    .shop-item-image {
        height: 160px;
    }
    
    .shop-item-image img {
        width: 120px;
        height: 120px;
    }
}
