/* ============================================
   NAVBAR STYLES
   Top navigation, logo, view counter,
   language toggle, tiktok toggle, cart icon
   ============================================ */

.top-nav {
    background: linear-gradient(135deg, #3b030d 0%, #5e0918 25%, #7c0f23 50%, #5e0918 75%, #3b030d 100%);
    color: white;
    padding: 10px 0;
    padding-top: calc(10px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(59, 3, 13, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: box-shadow 0.3s ease;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    overflow: visible;
}

/* Subtle shimmer effect on navbar */
.top-nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: navShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes navShimmer {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

/* ---- Logo ---- */
.logo {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.logo-icon {
    height: 40px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .logo-icon {
        height: 32px;
    }
}

/* ---- View Counter ---- */
.nav-view-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
}

.nav-view-counter .view-label {
    font-size: 9px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-view-counter .view-icon {
    font-size: 13px;
}

.nav-view-counter::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
    box-shadow: 0 0 4px #4ade80;
}

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

#view-count {
    color: #d4af37;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.nav-view-counter .view-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 8px 10px;
    background: rgba(12, 12, 12, 0.92);
    color: #ffffff;
    font-size: 11px;
    line-height: 1.3;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.nav-view-counter .view-tooltip::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent rgba(12, 12, 12, 0.92) transparent;
}

.nav-view-counter:hover .view-tooltip,
.nav-view-counter:focus-within .view-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-view-counter.is-open .view-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .nav-view-counter .view-tooltip {
        white-space: normal;
        width: 220px;
        text-align: center;
    }
}

/* ---- Cart Icon ---- */
.cart-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: auto;
    padding: 0 8px;
}

.cart-icon-mobile {
    display: none;
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(139,0,0,0.10);
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    z-index: 200;
    border: 2px solid #e9e9e9;
    flex-direction: column;
}

.cart-icon-mobile svg {
    display: block;
    margin: auto;
}

.top-nav .cart-icon svg path {
    stroke: #ffffff !important;
}

.top-nav .cart-icon {
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.top-nav .cart-icon:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

.cart-icon-mobile svg path {
    stroke: #8B0000;
}

@media (max-width: 768px) {
    #cart-icon-desktop {
        display: none !important;
    }
    .cart-icon-mobile {
        display: flex !important;
    }
}

/* ---- TikTok Toggle ---- */
.nav-tiktok-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-tiktok-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.nav-tiktok-toggle svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* ---- Language Toggle ---- */
.nav-language-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.nav-language-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.nav-language-toggle .language-text {
    color: #fff;
    font-weight: 700;
}

.nav-language-toggle .language-alt {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.nav-language-toggle svg {
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease;
}

.nav-language-toggle:hover svg {
    transform: rotate(90deg);
}

/* Arabic selected state */
.nav-language-toggle.arabic .language-text {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 400 !important;
}

.nav-language-toggle.arabic .language-alt {
    color: #fff !important;
    font-weight: 700 !important;
}

/* Dark mode */
body.dark-theme .nav-language-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

body.dark-theme .nav-language-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ---- About Icon ---- */
.nav-link[href="about.html"] {
    position: relative;
}

.nav-link[href="about.html"] .nav-icon {
    display: none;
}

.nav-link[href="about.html"]:before {
    content: "ℹ";
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 8px;
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    background: currentColor;
    color: white;
}

@media (max-width: 768px) {
    .nav-link[href="about.html"]:before {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 1.1em;
        margin-right: 6px;
    }
}
