* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Arial', sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Фоновый логотип */
.bg-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 1200px;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    background-image: url('./blackaff.webp?4');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: contrast(1.2);
}

/* Лучи вокруг логотипа */
.bg-rays {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000vw;
    height: 1000vh;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
    animation: rotate 60s linear infinite;
}

.bg-rays::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(139, 69, 19, 0.2) 3deg,
        transparent 6deg
    );
}

@keyframes rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
}

/* Хедер */
header {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(10, 10, 10, 0.98));
    padding: 15px 20px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #000;
    position: relative;
    overflow: hidden;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 50%;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: rgba(219, 110, 33, 0.9);
}

.tagline {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.header-stats {
    display: flex;
    gap: 40px;
}

/* CTA Button in header */
.header-stats .cta-button {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(219, 110, 33, 0.8));
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.header-stats .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.4);
}

/* Статистика */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.8), rgba(15, 15, 15, 0.8));
    border-radius: 10px;
    margin: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 69, 19, 0.1);
}

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

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: rgba(219, 110, 33, 0.9);
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Основная разметка с боковой панелью */
.main-wrapper {
    display: flex;
    gap: 30px;
    padding: 20px;
    flex: 1;
}

/* Боковая панель фильтров */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.5);
    border-radius: 3px;
}

/* Секции фильтров */
.filter-section {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.filter-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(219, 110, 33, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
}

/* Элементы фильтров */
.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid transparent;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-item:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.3);
    color: #aaa;
}

.filter-item.active {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.25), rgba(139, 69, 19, 0.15));
    border-color: rgba(139, 69, 19, 0.5);
    color: rgba(255, 150, 50, 0.9);
}

.filter-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.filter-item.disabled:hover {
    background: rgba(20, 20, 20, 0.6);
    border-color: transparent;
    color: #888;
}

.filter-count {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(139, 69, 19, 0.6);
}

.filter-item.active .filter-count {
    color: rgba(255, 150, 50, 0.8);
}

.filter-item.popular {
    background: rgba(139, 69, 19, 0.08);
}

.filter-item.popular:after {
    content: "🔥";
    font-size: 10px;
    margin-left: 5px;
}

/* Основной контент */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(40, 40, 40, 0.5) transparent;
    background: rgba(0, 0, 0, 0.3);
}

.main-content-area {
    flex: 1;
    min-width: 0;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(40, 40, 40, 0.5);
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(60, 60, 60, 0.7);
}

/* Секция офферов */
.offers-section {
    max-width: 100%;
    margin: 0 auto;
}

.section-title {
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
    color: #fff;
    font-weight: 300;
    letter-spacing: 2px;
}

/* ВАЖНО: Сетка офферов - точно 3 колонки */
.offers-grid,
#offersGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Карточки офферов */
.offer-card {
    background: linear-gradient(135deg, rgba(36, 36, 36, 0.95), rgba(20, 20, 20, 0.95));
    border: 1px solid rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.offer-card:hover {
    background: linear-gradient(135deg, rgba(8, 8, 8, 0.98), rgba(15, 15, 15, 0.98));
    border-color: rgba(139, 69, 19, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.3);
}

.offer-card:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.offer-card:hover:before {
    opacity: 1;
}

.offer-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.offer-logo {
    width: 60px;
    height: 60px;
    background: #0f0f0f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: rgba(139, 69, 19, 0.8);
    border: 1px solid #1a1a1a;
    overflow: hidden;
    flex-shrink: 0;
}

.offer-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-info {
    flex: 1;
    min-width: 0;
}

.offer-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(219, 110, 33, 0.8));
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 10;
}

.offer-badge.hot {
    background: linear-gradient(135deg, #ff4444, #ff6666);
    animation: pulse 1.5s infinite;
}

.offer-badge.new {
    background: linear-gradient(135deg, #44ff44, #66ff66);
}

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

.offer-title {
    font-size: 18px;
    margin-bottom: 5px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-category {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
}

.offer-description {
    color: #999;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.offer-stats {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    margin-bottom: 15px;
}

.offer-stat {
    text-align: center;
    flex: 1;
}

.offer-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: rgba(219, 110, 33, 0.9);
}

.offer-stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-top: 3px;
}

/* Выпадающий список стран */
.countries-dropdown {
    position: relative;
    margin-top: 15px;
}

.countries-toggle {
    background: rgba(139, 69, 19, 0.05);
    border: 1px solid rgba(139, 69, 19, 0.2);
    color: #999;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.countries-toggle:hover {
    background: rgba(139, 69, 19, 0.1);
    color: #aaa;
}

.countries-toggle.active {
    border-color: rgba(139, 69, 19, 0.5);
    background: rgba(139, 69, 19, 0.15);
    border-radius: 8px 8px 0 0;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.countries-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.countries-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
}

.countries-list.show {
    max-height: 500px;
    margin-top: 0;
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-top: none;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
    padding: 10px;
}

.country-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(40, 40, 40, 0.5);
    border-radius: 4px;
    font-size: 11px;
    transition: all 0.2s ease;
}

.country-item:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.3);
}

.country-code {
    color: #999;
    font-weight: 600;
}

.country-rate {
    color: rgba(219, 110, 33, 0.9);
    font-weight: 700;
}

.show-more-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 6px;
    color: rgba(219, 110, 33, 0.8);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: rgba(139, 69, 19, 0.2);
}

.show-more-btn.expanded {
    background: rgba(20, 20, 20, 0.5);
    border-color: rgba(60, 60, 60, 0.5);
    color: #666;
}

/* Футер */
footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(10, 10, 10, 0.98));
    padding: 30px 20px;
    border-top: 1px solid rgba(139, 69, 19, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.8);
    margin-top: 50px;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cta-button {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(219, 110, 33, 0.8));
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.cta-button:hover {
    background: linear-gradient(135deg, rgba(139, 69, 19, 1), rgba(219, 110, 33, 1));
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.4);
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-link {
    color: rgba(219, 110, 33, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: rgba(219, 110, 33, 1);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(25, 25, 25, 0.98));
    padding: 35px;
    border-radius: 15px;
    border: 1px solid rgba(139, 69, 19, 0.3);
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(139, 69, 19, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: rgba(219, 110, 33, 0.9);
}

.modal-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: rgba(219, 110, 33, 0.9);
}

.modal-text {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.modal-link {
    color: rgba(219, 110, 33, 0.8);
    text-decoration: none;
    font-weight: bold;
}

.modal-link:hover {
    color: rgba(219, 110, 33, 1);
}

/* Scrollbar стили */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.7);
}

/* Состояние filtered-out для скрытия при фильтрации */
.offer-card.filtered-out {
    display: none;
}

.no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Адаптивность */
@media (max-width: 1400px) {
    .offers-grid,
    #offersGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
        padding: 15px;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        display: flex;
        gap: 15px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .sidebar::-webkit-scrollbar {
        height: 4px;
    }
    
    .filter-section {
        min-width: 250px;
        flex-shrink: 0;
    }
    
    .offers-grid,
    #offersGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        padding: 15px;
    }
    
    .header-stats {
        width: 100%;
    }
    
    .header-stats .cta-button {
        width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        margin: 15px;
    }
    
    .offers-grid,
    #offersGrid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .filter-section {
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .bg-logo {
        background-size: 80%;
    }
    
    .offer-card {
        padding: 15px;
    }
    
    .offer-logo {
        width: 50px;
        height: 50px;
    }
    
    .countries-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .main-wrapper {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .filter-item {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .offer-title {
        font-size: 14px;
    }
    
    .offer-stat-value {
        font-size: 18px;
    }
    
    .modal-content {
        padding: 25px;
    }
}