/* Define Vazir font */
@font-face {
    font-family: 'Vazir';
    src: url('/static/fonts/Vazir-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* General Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* پایه‌ها */
.header {
    position: relative;
    background-color: #faf9ff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(160, 125, 255, 0.1);
    direction: rtl;
    font-family: "Vazirmatn", sans-serif;
    flex-wrap: wrap;
}

/* کلاس برای مخفی کردن عناصر */
.hidden {
    display: none;
}

/* سمت چپ: سبد خرید، تاریخ، روزشمار */
.header-left {
    text-align: right;
}

.cart-icon {
    margin-bottom: 8px;
}

.cart-symbol {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s;
}

.cart-symbol:hover {
    transform: scale(1.2);
}

.date-time {
    font-size: 14px;
    font-weight: bold;
    color: #6a0dad;
    margin-bottom: 5px;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    margin-top: 5px;
    transition: color 0.3s;
}

.countdown:hover {
    color: #8b5cf6;
}

.countdown-name {
    font-weight: bold;
    color: #6a0dad;
    font-size: 14px;
}

.countdown-value {
    color: #8b5cf6;
    font-size: 14px;
}

/* سمت راست: پروفایل */
.profile-container {
    position: relative;
    text-align: left;
}

.profile-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d8c6ff;
    box-shadow: 0 2px 8px rgba(160, 125, 255, 0.2);
    margin-bottom: 5px;
}

.username {
    font-size: 14px;
    font-weight: 600;
    color: #6a0dad;
    cursor: pointer;
    transition: color 0.3s;
}

.username:hover {
    color: #8b5cf6;
}

.profile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 160px;
    background-color: #fff;
    border: 1px solid #d8c6ff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(160, 125, 255, 0.15);
    z-index: 10;
    padding: 5px 0;
    animation: slideFadeIn 0.25s ease;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 15px;
    border-width: 0 6px 8px 6px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

.profile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-menu-item,
.logout-button {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    gap: 8px;
    transition: background 0.25s;
    cursor: pointer;
}

.profile-menu-item:hover,
.logout-button:hover {
    background-color: #f4f0ff;
    color: #6a0dad;
    border-radius: 6px;
}

.profile-menu-item i,
.logout-button i {
    font-size: 16px;
    color: #8b5cf6;
    min-width: 18px;
}

/* دکمه ورود */
.login-container {
    text-align: left;
    display: flex;
    gap: 10px;
}

.btn-login {
    display: inline-block;
    padding: 8px 16px;
    background-color: #8b5cf6;
    color: white;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #7c3aed;
}

.btn-register {
    display: inline-block;
    padding: 8px 16px;
    background-color: #a78bfa;
    color: white;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-register:hover {
    background-color: #9068e0;
}

/* بخش تبلیغاتی */
.ad-container {
    width: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ad-title {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}

.ad-description {
    font-size: 14px;
    color: #f4f0ff;
    margin-bottom: 12px;
}

.ad-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ffffff;
    color: #6a0dad;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.ad-button:hover {
    background-color: #f4f0ff;
    color: #8b5cf6;
}

/* پاسخ‌گویی */
@media (max-width: 768px) {
    .header {
        padding: 8px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-left {
        width: 100%;
    }

    .profile-container,
    .login-container {
        width: 100%;
        text-align: right;
    }

    .profile-menu {
        width: 100%;
        left: 0;
    }

    .cart-symbol {
        font-size: 20px;
    }

    .date-time {
        font-size: 13px;
    }

    .countdown {
        font-size: 12px;
        gap: 8px;
        text-align: center;
    }

    .countdown-name {
        font-size: 12px;
    }

    .countdown-value {
        font-size: 12px;
    }

    .ad-container {
        padding: 12px;
    }

    .ad-title {
        font-size: 14px;
    }

    .ad-description {
        font-size: 12px;
    }

    .ad-button {
        padding: 8px 16px;
        font-size: 12px;
    }

    .login-container {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .btn-login,
    .btn-register {
        width: 100%;
        text-align: center;
    }

    .profile-image {
        width: 40px;
        height: 40px;
    }

    .username {
        font-size: 13px;
    }

    .countdown {
        font-size: 11px;
        gap: 8px;
        text-align: center;
    }

    .countdown-name {
        font-size: 11px;
    }

    .countdown-value {
        font-size: 11px;
    }

    .ad-title {
        font-size: 13px;
    }

    .ad-description {
        font-size: 11px;
    }

    .ad-button {
        padding: 7px 14px;
        font-size: 11px;
    }

    .login-container {
        gap: 6px;
    }
}

/* موقعیت‌دهی لوگوی پس‌زمینه */
.header-left {
    position: relative;
    z-index: 1;
}

.header-logo-bg {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

.header-logo-bg img {
    max-width: 180px;
    height: auto;
}

/* تاریخ و روزشمار بالای لوگو قرار بگیرن */
.date-time,
.countdown {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* برای موبایل: کوچکتر کردن لوگو */
@media (max-width: 768px) {
    .header-logo-bg img {
        max-width: 120px;
    }
}