/* Reset و استایلهای پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0a0a2a 0%, #1a1a3a 100%);
    min-height: 100vh;
    color: #e0e0e0;
    transition: all 0.5s ease;
}

/* حالت روشن */
body.light-theme {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333333;
}

/* هدر */
.header {
    background: linear-gradient(135deg, #0c1b33 0%, #1a2b4a 100%);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 25px rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    transition: all 0.5s ease;
}

body.light-theme .header {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.container {
    padding: 0.5rem 1rem;
    max-width: 1300px;
    margin: 0 auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    height: 70px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

/* لوگو */
.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    order: 1;
}

.nav-img {
    width: 90px;
    height: auto;
    transition: transform 0.3s ease;
}

.nav-img:hover {
    transform: scale(1.1);
}

/* منوی اصلی */
.main-menu {
    display: flex;
    list-style: none;
    gap: 0.8rem;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    order: 2;
}

.menu-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.3px;
}

body.light-theme .menu-link {
    color: #333333;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

body.light-theme .menu-link:hover {
    background-color: rgba(0,0,0,0.1);
    border-color: rgba(124, 17, 17, 0.2);
}

/* دکمههای ثبت نام و ورود */
.auth-buttons {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-shrink: 0;
    order: 3;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    border: 2px solid;
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-register {
    background-color: rgb(48, 2, 95);
    color: white;
    border-color: rgb(48, 2, 95);
}

.btn-register:hover {
    background-color: rgb(60, 5, 115);
    border-color: rgb(70, 10, 130);
    box-shadow: 0 6px 15px rgba(48, 2, 95, 0.3);
}

.btn-login {
    background-color: transparent;
    color: white;
    border-color: white;
}

body.light-theme .btn-login {
    color: #333333;
    border-color: #333333;
}

.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 12px rgba(255,255,255,0.1);
}

body.light-theme .btn-login:hover {
    background-color: rgba(0,0,0,0.1);
}

/* دکمه منوی موبایل */
.mobile-menu-btn {
    display: none;
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    transform: rotate(90deg);
}

/* بخش قیمت بازار */
.market-price {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 3rem 1rem;
    margin-top: 3rem;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.market-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(192, 192, 192, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.market-price h2 {
    color: #fff;
    font-size: 2.5rem;
    margin: 0 0 2rem 0;
    text-align: center;
    text-shadow: 0 3px 6px rgba(0,0,0,0.4);
    position: relative;
    padding-bottom: 1.5rem;
}

.market-price h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 3px;
}

.market-price1 {
    display: flex;
    background: linear-gradient(145deg, #1e1e2e, #2a2a3a);
    margin: 2rem auto 0 auto;
    font-size: 1.2rem;
    justify-content: center;
    width: 90%;
    max-width: 1100px;
    align-items: stretch;
    border-radius: 25px;
    padding: 3rem 2rem;
    flex-wrap: wrap;
    gap: 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s ease;
}

body.light-theme .market-price1 {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border: 1px solid rgba(0,0,0,0.1);
}

.price-cart {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    background: linear-gradient(145deg, #2a2a3a, #1e1e2e);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

body.light-theme .price-cart {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border: 1px solid rgba(0,0,0,0.1);
}

.price-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 20px 20px 0 0;
}

.price-cart:nth-child(2)::before {
    background: linear-gradient(90deg, #c0c0c0, #e8e8e8);
}

.price-cart:nth-child(3)::before {
    background: linear-gradient(90deg, #0057b7, #0098ff);
}

.price-cart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    z-index: 0;
}

.link-tala {
    text-decoration: none;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

body.light-theme .link-tala {
    color: #333333;
}

.price-cart:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border-color: rgba(255, 215, 0, 0.3);
}

.price-cart:nth-child(2):hover {
    border-color: rgba(192, 192, 192, 0.3);
}

.price-cart:nth-child(3):hover {
    border-color: rgba(0, 87, 183, 0.3);
}

/* آیکون و متن */
.price-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.price-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.light-theme .price-title {
    color: #222222;
}

.price-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffd700;
    margin: 1rem 0;
    transition: all 0.5s ease;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

body.light-theme .price-value {
    color: #3d024d;
}

/* انیمیشن برای تغییر قیمت */
@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.price-updating {
    animation: priceUpdate 0.8s ease;
}

.price-change {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.change-up {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.change-down {
    background-color: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.price-unit {
    font-size: 1rem;
    color: #666;
    margin-top: 0.5rem;
}

/* استایل برای زمان زنده */
.live-time {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
    transition: opacity 0.3s ease;
}

/* بخش flox-box */
.flox-box {
    display: flex;
    gap: 8px;
    margin: 3rem auto;
    max-width: 1300px;
    padding: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #ffd700 #1a1a2a;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(145deg, #1a1a2a, #2a2a3a);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: all 0.5s ease;
}

body.light-theme .flox-box {
    background: linear-gradient(145deg, #f5f5f5, #e5e5e5);
    border: 1px solid rgba(0,0,0,0.1);
}

.flox-box.active {
    cursor: grabbing;
}

/* مخفی کردن اسکرولبار در برخی مرورگرها */
.flox-box::-webkit-scrollbar {
    height: 6px;
}

.flox-box::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 3px;
}

.flox-box::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 3px;
}

.flox-box::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #ffed4e, #ffd700);
}

.flex {
    display: flex;
    width: 400px;
    height: 200px;
    background: linear-gradient(135deg, #2a2a3a 0%, #1a1a2a 100%);
    color: aliceblue;
    margin: 4px;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    transition: all 0.4s ease;
    position: relative;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

body.light-theme .flex {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid rgba(0,0,0,0.2);
}

.flex:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.4);
    border-color: #ffd700;
}

.flex::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 10px 10px 0 0;
}

.flex:nth-child(2)::before {
    background: linear-gradient(90deg, #c0c0c0, #e8e8e8);
}

.flex:nth-child(3)::before {
    background: linear-gradient(90deg, #0057b7, #0098ff);
}

.flex::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.05), transparent);
    z-index: 1;
}

.flex img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    position: relative;
    z-index: 0;
}

.flex:hover img {
    transform: scale(1.1);
}

/* دکمه تغییر تم */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.theme-toggle:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

body.light-theme .theme-toggle {
    background: rgba(61, 2, 77, 0.2);
    color: #3d024d;
    border: 1px solid rgba(61, 2, 77, 0.5);
}

body.light-theme .theme-toggle:hover {
    background: rgba(61, 2, 77, 0.3);
    box-shadow: 0 0 20px rgba(61, 2, 77, 0.5);
}

/* Media Queries برای رسپانسیو */

/* تبلت (تا 1024px) */
@media (max-width: 1024px) {
    .main-menu {
        gap: 0.6rem;
    }
    
    .menu-link {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
        min-width: 90px;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
        min-width: 90px;
    }
    
    .flex {
        width: 350px;
        height: 180px;
        margin: 3px;
    }
    
    .flox-box {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .nav-img {
        width: 70px;
    }
}

/* موبایل (تا 768px) */
@media (max-width: 768px) {
    .header-top {
        padding: 0.4rem 1rem;
        height: 65px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: rgb(1, 13, 31);
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .container {
        padding-top: 65px;
    }
    
    .main-menu {
        display: none;
    }
    
    .auth-buttons {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        margin-left: auto;
    }
    
    .nav-img {
        width: 55px;
    }
    
    .market-price1 {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .price-cart {
        width: 100%;
        margin: 0.3rem 0;
        padding: 1rem;
    }
    
    .market-price h2 {
        font-size: 1.3rem;
        margin: 1rem 0;
    }
    
    .flox-box {
        gap: 6px;
        padding: 0.5rem;
    }
    
    .flex {
        width: 300px;
        height: 180px;
        margin: 2px;
    }
    
    /* مخفی کردن اسکرولبار در موبایل */
    .flox-box::-webkit-scrollbar {
        display: none;
    }
    
    .flox-box {
        scrollbar-width: none;
    }
    
    .live-time {
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }
}

/* موبایل کوچک (تا 480px) */
@media (max-width: 480px) {
    .header-top {
        padding: 0.3rem;
        height: 60px;
    }
    
    .container {
        padding-top: 60px;
        padding: 0.5rem;
    }
    
    .nav-img {
        width: 50px;
    }
    
    .mobile-menu-btn {
        width: 35px;
        height: 35px;
        padding: 5px;
        font-size: 16px;
    }
    
    .market-price1 {
        font-size: 1rem;
        padding: 0.6rem;
    }
    
    .market-price h2 {
        font-size: 1.2rem;
    }
    
    .flex {
        width: 280px;
        height: 160px;
        margin: 1px;
    }
    
    .live-time {
        font-size: 0.7rem;
    }
}

/* دسکتاپ بزرگ (از 1200px) */
@media (min-width: 1200px) {
    .container {
        padding: 1.5rem;
    }
    
    .menu-link {
        font-size: 1.1rem;
    }
    
    .market-price1 {
        max-width: 1000px;
    }
}