/* ============================================
   TopIcons.css - استایل نوار بالایی
   با عنوان برند متحرک سینمایی
   ============================================ */

.TopIcons {
    grid-area: TopIcons;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white, #ffffff);
    padding: var(--gap-md, 0.625rem) var(--gap-lg, 1rem);
    border-radius: 0;
    box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,0.08));
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    border-bottom: var(--border-thin, 1px) solid rgba(0,0,0,0.06);
    overflow: visible;
}

/* ===== دکمه منو ===== */
.TopIcons .menu-icon {
    cursor: pointer;
    padding: var(--gap-sm, 0.3125rem);
    border: none;
    background: none;
    border-radius: var(--radius-sm, 8px);
    transition: all var(--transition-md, 0.3s ease);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.TopIcons .menu-icon:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.TopIcons .menu-icon:active {
    transform: scale(0.92);
}

.TopIcons .menu-icon img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* ============================================
   عنوان برند (دیاکو سایت) - نسخه سینمایی
   ============================================ */
.TopIcons .brand-title {
    position: relative;
    display: inline-block;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0.75rem;
    padding: 2px 6px 5px 6px;
    line-height: 1.3;
    white-space: nowrap;
    user-select: none;
    cursor: default;
    isolation: isolate;
    transform-origin: center;

    background: linear-gradient(
        100deg,
        #1a2a3a 0%,
        #d4a847 20%,
        #f5d98a 40%,
        #4A90E2 60%,
        #d4a847 80%,
        #1a2a3a 100%
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    animation:
        brandAurora 6s ease-in-out infinite,
        brandBreathe 3s ease-in-out infinite,
        brandFadeIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;

    opacity: 0;
}

/* ===== هاله چرخان ===== */
.TopIcons .brand-title::before {
    content: '';
    position: absolute;
    inset: -6px -10px;
    border-radius: 12px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(212, 168, 71, 0.5) 60deg,
        rgba(74, 144, 226, 0.4) 120deg,
        transparent 180deg,
        rgba(212, 168, 71, 0.5) 240deg,
        rgba(74, 144, 226, 0.4) 300deg,
        transparent 360deg
    );
    filter: blur(8px);
    opacity: 0;
    z-index: -1;
    animation: brandHalo 5s linear infinite;
    pointer-events: none;
}

/* ===== نور عبوری (Shine) ===== */
.TopIcons .brand-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.85) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    animation: brandFlash 5s ease-in-out infinite;
    mix-blend-mode: overlay;
    filter: blur(1px);
}

/* ===== هاور ===== */
.TopIcons .brand-title:hover {
    transform: scale(1.08);
    animation-duration: 2s, 1.5s, 1s;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.TopIcons .brand-title:hover::before {
    opacity: 1;
    animation-duration: 2s;
}

/* ===== انیمیشن ۱: شفق رنگی ===== */
@keyframes brandAurora {
    0%   { background-position: 0% center;   filter: hue-rotate(0deg); }
    25%  { background-position: 50% center;  filter: hue-rotate(15deg); }
    50%  { background-position: 100% center; filter: hue-rotate(0deg); }
    75%  { background-position: 150% center; filter: hue-rotate(-15deg); }
    100% { background-position: 200% center; filter: hue-rotate(0deg); }
}

/* ===== انیمیشن ۲: تنفس زنده ===== */
@keyframes brandBreathe {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(212, 168, 71, 0.4));
        letter-spacing: 1px;
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(212, 168, 71, 0.7))
                drop-shadow(0 0 20px rgba(74, 144, 226, 0.3));
        letter-spacing: 1.5px;
    }
}

/* ===== انیمیشن ۳: هاله چرخان ===== */
@keyframes brandHalo {
    0%   { transform: rotate(0deg);   opacity: 0.4; }
    50%  { transform: rotate(180deg); opacity: 0.7; }
    100% { transform: rotate(360deg); opacity: 0.4; }
}

/* ===== انیمیشن ۴: نور عبوری ===== */
@keyframes brandFlash {
    0%, 50%   { left: -120%; opacity: 0; }
    55%       { opacity: 0.9; }
    65%       { left: 150%; opacity: 0.9; }
    70%, 100% { left: 150%; opacity: 0; }
}

/* ===== انیمیشن ۵: ظاهر شدن سینمایی ===== */
@keyframes brandFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(0.85) rotateX(45deg);
        filter: blur(8px);
    }
    60% {
        opacity: 1;
        transform: translateY(2px) scale(1.05) rotateX(-5deg);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0);
        filter: blur(0);
    }
}

/* ===== آیکون‌های چپ ===== */
.TopIcons .left-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

/* ===== دکمه‌های آیکون ===== */
.TopIcons .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: var(--radius-sm, 8px);
    transition: all var(--transition-fast, 0.2s ease);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
}

.TopIcons .icon-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.TopIcons .icon-btn:active {
    transform: scale(0.92);
}

.TopIcons .icon-btn img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ===== آیکون‌های متنی (برای دسکتاپ) ===== */
.TopIcons .left-icons .sidebar-icon,
.TopIcons .left-icons .aside-icon {
    display: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm, 8px);
    transition: all var(--transition-fast, 0.2s ease);
    line-height: 1;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.TopIcons .left-icons .sidebar-icon:hover,
.TopIcons .left-icons .aside-icon:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.TopIcons .left-icons .sidebar-icon:active,
.TopIcons .left-icons .aside-icon:active {
    transform: scale(0.92);
}

/* ============================================
   واکنش‌گرایی نوار بالایی
   ============================================ */

/* ===== موبایل (تا 767px) ===== */
@media(max-width: 767px) {
    .TopIcons {
        padding: var(--gap-sm, 0.3125rem) var(--gap-md, 0.625rem);
        gap: var(--gap-sm, 0.3125rem);
        justify-content: space-between;
    }

    .TopIcons .menu-icon {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0.2rem;
    }

    .TopIcons .menu-icon img {
        width: 26px;
        height: 26px;
    }

    .TopIcons .brand-title {
        font-size: 1.1rem;
        margin: 0 0.4rem;
        letter-spacing: 0.5px;
        padding: 1px 4px 4px 4px;
    }

    .TopIcons .left-icons {
        gap: 1rem;
        justify-content: flex-end;
        flex: 1 1 auto;
    }

    .TopIcons .icon-btn {
        width: 2.25rem;
        height: 2.25rem;
        padding: 0.25rem;
    }

    .TopIcons .icon-btn img {
        width: 22px;
        height: 22px;
    }

    .TopIcons .left-icons .desktop-only {
        display: none !important;
    }
}

/* ===== تبلت (768px تا 1023px) ===== */
@media(min-width: 768px) and (max-width: 1023px) {
    .TopIcons {
        padding: var(--gap-md, 0.625rem) var(--gap-lg, 1rem);
        justify-content: space-between;
    }

    .TopIcons .menu-icon {
        width: 2.75rem;
        height: 2.75rem;
    }

    .TopIcons .menu-icon img {
        width: 30px;
        height: 30px;
    }

    .TopIcons .brand-title {
        font-size: 1.3rem;
        margin: 0 0.6rem;
    }

    .TopIcons .left-icons {
        gap: 1.5rem;
        justify-content: flex-end;
        flex: 1 1 auto;
    }

    .TopIcons .icon-btn {
        width: 2.75rem;
        height: 2.75rem;
        padding: 0.35rem;
    }

    .TopIcons .icon-btn img {
        width: 26px;
        height: 26px;
    }

    .TopIcons .left-icons .sidebar-icon {
        display: inline-flex !important;
        font-size: 1.2rem;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0.35rem;
    }

    .TopIcons .left-icons .aside-icon {
        display: none !important;
    }
}

/* ===== دسکتاپ (1024px به بالا) ===== */
@media(min-width: 1024px) {
    .TopIcons {
        padding: var(--gap-md, 0.625rem) var(--gap-xl, 1.5rem);
        justify-content: space-between;
    }

    .TopIcons .menu-icon {
        width: 3rem;
        height: 3rem;
    }

    .TopIcons .menu-icon img {
        width: 32px;
        height: 32px;
    }

    .TopIcons .brand-title {
        font-size: 1.6rem;
        margin: 0 0.85rem;
    }

    .TopIcons .left-icons {
        gap: 2rem;
        justify-content: flex-end;
        flex: 1 1 auto;
    }

    .TopIcons .icon-btn {
        width: 3rem;
        height: 3rem;
        padding: 0.4rem;
    }

    .TopIcons .icon-btn img {
        width: 28px;
        height: 28px;
    }

    .TopIcons .left-icons .sidebar-icon,
    .TopIcons .left-icons .aside-icon {
        display: inline-flex !important;
        font-size: 1.3rem;
        width: 3rem;
        height: 3rem;
        padding: 0.4rem;
    }
}

/* ===== دسکتاپ بزرگ (1200px به بالا) ===== */
@media(min-width: 1200px) {
    .TopIcons {
        padding: var(--gap-md, 0.625rem) var(--gap-2xl, 2rem);
        justify-content: space-between;
    }

    .TopIcons .left-icons {
        gap: 2.5rem;
        justify-content: flex-end;
        flex: 1 1 auto;
    }

    .TopIcons .menu-icon {
        width: 3.25rem;
        height: 3.25rem;
    }

    .TopIcons .menu-icon img {
        width: 34px;
        height: 34px;
    }

    .TopIcons .brand-title {
        font-size: 1.75rem;
        margin: 0 1rem;
        letter-spacing: 1.5px;
    }

    .TopIcons .icon-btn {
        width: 3.25rem;
        height: 3.25rem;
        padding: 0.45rem;
    }

    .TopIcons .icon-btn img {
        width: 30px;
        height: 30px;
    }

    .TopIcons .left-icons .sidebar-icon,
    .TopIcons .left-icons .aside-icon {
        font-size: 1.4rem;
        width: 3.25rem;
        height: 3.25rem;
        padding: 0.45rem;
    }
}

/* ===== دسکتاپ فوق‌العاده بزرگ (1600px به بالا) ===== */
@media(min-width: 1600px) {
    .TopIcons {
        padding: var(--gap-md, 0.625rem) 3rem;
    }

    .TopIcons .left-icons {
        gap: 3rem;
    }

    .TopIcons .menu-icon {
        width: 3.5rem;
        height: 3.5rem;
    }

    .TopIcons .menu-icon img {
        width: 36px;
        height: 36px;
    }

    .TopIcons .brand-title {
        font-size: 2rem;
        margin: 0 1.25rem;
    }

    .TopIcons .icon-btn {
        width: 3.5rem;
        height: 3.5rem;
        padding: 0.5rem;
    }

    .TopIcons .icon-btn img {
        width: 32px;
        height: 32px;
    }

    .TopIcons .left-icons .sidebar-icon,
    .TopIcons .left-icons .aside-icon {
        font-size: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        padding: 0.5rem;
    }
}

/* ===== فوکوس برای دسترسی‌پذیری ===== */
.TopIcons .icon-btn:focus-visible,
.TopIcons .menu-icon:focus-visible,
.TopIcons .left-icons .sidebar-icon:focus-visible,
.TopIcons .left-icons .aside-icon:focus-visible {
    outline: var(--border-thick, 3px) solid var(--primary-blue, #4A90E2);
    outline-offset: var(--border-md, 2px);
}

/* ===== پشتیبانی از RTL ===== */
[dir="rtl"] .TopIcons .left-icons {
    flex-direction: row;
}

/* ===== کاهش انیمیشن برای کاربران حساس ===== */
@media (prefers-reduced-motion: reduce) {
    .TopIcons .menu-icon,
    .TopIcons .icon-btn,
    .TopIcons .left-icons .sidebar-icon,
    .TopIcons .left-icons .aside-icon {
        transition: none;
    }

    .TopIcons .menu-icon:hover,
    .TopIcons .icon-btn:hover,
    .TopIcons .left-icons .sidebar-icon:hover,
    .TopIcons .left-icons .aside-icon:hover {
        transform: none;
    }

    .TopIcons .brand-title {
        animation: none;
        background: none;
        -webkit-text-fill-color: var(--primary-dark, #1a2a3a);
        color: var(--primary-dark, #1a2a3a);
        opacity: 1;
        transform: none;
        filter: none;
        letter-spacing: 1px;
    }

    .TopIcons .brand-title::before,
    .TopIcons .brand-title::after {
        display: none;
    }
}