:root {
    /* Landing Page Theme - Purple + Cyan */
    --color-bg: #0a0a0f;
    --color-bg-dark-alt: #1a1a2e;
    --color-surface: #1a1a2e;
    --color-primary: #8B5CF6;
    --color-purple-bright: #A78BFA;
    --color-secondary: #22D3EE;
    --color-cyan-bright: #22D3EE;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-text: #E5E7EB;
    --color-text-secondary: #9CA3AF;
    --color-border: rgba(139, 92, 246, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(26, 26, 46, 0.98) 100%);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 2px solid var(--color-border);
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #8B5CF6 0%, #22D3EE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.logo-icon {
    font-size: 32px;
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: var(--color-primary);
}

.stat-value.in-stock {
    color: var(--color-success);
}

.stat-value.out-stock {
    color: var(--color-danger);
}

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

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--color-danger);
    border-radius: 8px;
    color: var(--color-danger);
    font-weight: 600;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--color-danger);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Main Container */
.main-container {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Filter Bar */
.filter-bar {
    flex-direction: column;
    align-items: stretch;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}

.search-box input {
    padding: 10px 16px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    width: 300px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--color-surface);
    border-radius: 12px;
    border: 2px solid var(--color-border);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

/* Updated animation for real-time updates */
.product-card.updated {
    animation: cardFlash 1s ease-in-out;
}

@keyframes cardFlash {
    0%, 100% {
        border-color: var(--color-border);
    }
    50% {
        border-color: var(--color-success);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }
}

/* Fixed product image container */
.product-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: #1a1a24;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 12px;
}

.product-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--color-text-secondary);
    padding: 0;
}

.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.stock-badge.in-stock {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.stock-badge.out-stock {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8em;
}

.product-region {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    width: fit-content;
}

.product-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.stat-row .label {
    color: var(--color-text-secondary);
}

.stat-row .value {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.stat-row .value.stock {
    color: var(--color-success);
}

.stat-row .value.stock.zero {
    color: var(--color-danger);
}

.stat-row .value.time {
    color: var(--color-text);
}

.product-link {
    display: block;
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.product-link:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--color-text-secondary);
}

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

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

/* Footer */
.footer {
    background: var(--color-surface);
    border-top: 2px solid var(--color-border);
    padding: 16px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 13px;
}

.footer p {
    margin: 4px 0;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--color-text);
}

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

/* Large Desktop (1400px+) - default styles above */

/* Desktop (1024px - 1399px) */
@media (max-width: 1399px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .product-image-container {
        height: 260px;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .header .container {
        gap: 16px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .logo-icon {
        font-size: 28px;
    }
    
    .header-stats {
        gap: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .main-container {
        padding: 24px 16px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .product-image-container {
        height: 240px;
    }
    
    .search-box input {
        width: 250px;
    }
}

/* Mobile Large (640px - 767px) */
@media (max-width: 767px) {
    .header {
        padding: 16px 0;
    }
    
    .header .container {
        padding: 0 16px;
        gap: 12px;
    }
    
    .logo {
        font-size: 18px;
        width: 100%;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-around;
        gap: 16px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .live-indicator {
        width: 100%;
        justify-content: center;
    }
    
    .main-container {
        padding: 20px 12px;
    }
    
    .filter-bar {
    flex-direction: column;
    align-items: stretch;
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 24px;
        gap: 12px;
    }
    
    .filter-group {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .product-image-container {
        height: 200px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .stat-row {
        font-size: 12px;
    }
    
    .product-link {
        padding: 8px;
        font-size: 13px;
        margin-top: 10px;
    }
}

/* Mobile Small (below 640px) */
@media (max-width: 639px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .product-card {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .product-image-container {
        height: 300px;
    }
    
    .header-stats {
        gap: 12px;
    }
    
    .stat {
        flex: 1;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

/* Mobile Extra Small (below 400px) */
@media (max-width: 399px) {
    .logo {
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .product-image-container {
        height: 250px;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
}

/* Enhanced Filter Layout */
.filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 80px;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

/* Active Filters Display */
.active-filters {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.clear-filters-btn {
    padding: 6px 16px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: auto;
}

.clear-filters-btn:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

/* Responsive updates for new layout */
@media (max-width: 1023px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-label {
        min-width: auto;
    }
    
    .filter-group {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .filter-section {
        gap: 12px;
    }
    
    .filter-group {
        gap: 8px;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .active-filters {
        padding: 12px;
        gap: 8px;
    }
    
    .filter-tag {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .clear-filters-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
}

@media (max-width: 639px) {
    .filter-group {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 6px 12px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 600;
}

.lang-btn:hover {
    border-color: var(--color-primary);
}

.lang-btn.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Social Links */
.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.social-link:hover {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.social-link svg {
    flex-shrink: 0;
}

.social-link.threads:hover {
    background: #000000;
    border-color: #000000;
}

.social-link.telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
}

.social-link.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

/* Mobile responsive for social links */
@media (max-width: 639px) {
    .social-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .social-link {
        width: 100%;
        justify-content: center;
    }
    
    .language-switcher {
        width: 100%;
        justify-content: center;
    }
    
    .lang-btn {
        flex: 1;
    }
}
