/* Header / logo theme overrides (default | custom_blue | ramadan) */

/* --- Custom blue --- */
body.theme-custom_blue .admin-topbar,
body.theme-custom_blue header.navbar.bg-primary {
    background-color: #3a9be1 !important;
    background-image: none !important;
}

body.theme-custom_blue .navbar-brand-logo-rays,
body.theme-custom_blue .iri-sun-logo-rays {
    display: none !important;
    animation: none !important;
}

body.theme-custom_blue .navbar-brand-logo-disk {
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Auth / welcome / app-nav: circular plate (not rounded square) */
body.theme-custom_blue .iri-sun-logo--blue-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--iri-sun-size, 100px);
    height: var(--iri-sun-size, 100px);
    padding: 0.4rem;
    border-radius: 50%;
    background-color: #3a9be1;
    box-shadow: 0 8px 22px rgba(15, 80, 130, 0.28);
    overflow: hidden;
}

body.theme-custom_blue .auth-brand-logo-wrap.iri-sun-logo--blue-plate {
    --iri-sun-size: 100px;
    width: 100px;
    height: 100px;
    padding: 0.25rem;
}

body.theme-custom_blue .iri-sun-logo--blue-plate .iri-sun-logo-disk {
    width: 100%;
    height: 100%;
    background: transparent !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    animation: none !important;
    overflow: hidden;
}

body.theme-custom_blue .iri-sun-logo--blue-plate .iri-sun-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.theme-custom_blue .auth-brand-logo-wrap .iri-sun-logo-img {
    width: 100%;
    height: 100%;
    max-width: 100px;
    max-height: 100px;
}

/* Login/register top navbar: keep bar height, clip oversized 100px logo */
body.theme-custom_blue #app > nav.navbar,
body.theme-ramadan #app > nav.navbar {
    overflow: hidden;
    min-height: 3.25rem;
}

body.theme-custom_blue #app > nav.navbar .navbar-brand,
body.theme-ramadan #app > nav.navbar .navbar-brand {
    width: 2.5rem;
    height: 3.25rem;
    min-height: 3.25rem;
    overflow: visible;
}

body.theme-custom_blue .app-navbar-logo-wrap.iri-sun-logo,
body.theme-ramadan .app-navbar-logo-wrap.iri-sun-logo {
    width: 100px !important;
    height: 100px !important;
    position: absolute;
    inset-inline-start: 0.15rem;
    top: 50%;
    transform: translateY(-35%);
    margin: 0;
}

body.theme-custom_blue .app-navbar-logo-wrap .iri-sun-logo-img,
body.theme-ramadan .app-navbar-logo-wrap .iri-sun-logo-img {
    width: 100px !important;
    height: 100px !important;
    object-fit: contain;
}

/* --- Ramadan --- */
body.theme-ramadan .admin-topbar,
body.theme-ramadan header.navbar.bg-primary {
    background: linear-gradient(115deg, #1a2a6c 0%, #243b7a 42%, #8b3a1f 78%, #c9a227 100%) !important;
    background-image: none;
    position: relative;
    overflow: visible;
}

body.theme-ramadan .navbar-brand-logo-rays,
body.theme-ramadan .iri-sun-logo-rays {
    display: none !important;
    animation: none !important;
}

body.theme-ramadan .navbar-brand-logo-disk {
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    animation: none !important;
}

body.theme-ramadan .iri-sun-logo--ramadan-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: var(--iri-sun-size, 100px);
    height: var(--iri-sun-size, 100px);
    padding: 0.4rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a2a6c, #3d1f5c 55%, #8b3a1f);
    box-shadow: 0 8px 22px rgba(26, 42, 108, 0.35);
    overflow: visible;
}

body.theme-ramadan .auth-brand-logo-wrap.iri-sun-logo--ramadan-plate {
    --iri-sun-size: 100px;
    width: 100px;
    height: 100px;
    padding: 0.25rem;
}

body.theme-ramadan .iri-sun-logo--ramadan-plate .iri-sun-logo-disk {
    width: 100%;
    height: 100%;
    background: transparent !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    animation: none !important;
    overflow: hidden;
}

body.theme-ramadan .iri-sun-logo--ramadan-plate .iri-sun-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.theme-ramadan .auth-brand-logo-wrap .iri-sun-logo-img {
    width: 100%;
    height: 100%;
    max-width: 100px;
    max-height: 100px;
}

.header-ramadan-decor {
    display: none;
    pointer-events: none;
}

body.theme-ramadan .header-ramadan-decor {
    display: block;
    position: absolute;
    inset-inline-end: -0.15rem;
    top: -0.35rem;
    width: 72px;
    height: 52px;
    z-index: 2;
}

body.theme-ramadan .navbar-brand-logo-wrap {
    position: absolute;
    top: 40%;
}

body.theme-ramadan .header-ramadan-crescent {
    position: absolute;
    inset-inline-end: 0;
    top: 0;
    filter: drop-shadow(0 0 6px rgba(246, 217, 138, 0.55));
    animation: ramadan-float 3.5s ease-in-out infinite alternate;
}

body.theme-ramadan .header-ramadan-fanoos {
    position: absolute;
    inset-inline-end: 28px;
    top: 2px;
    transform-origin: top center;
    filter: drop-shadow(0 0 5px rgba(246, 217, 138, 0.4));
    animation: ramadan-fanoos-swing 3s ease-in-out infinite alternate;
}

body.theme-ramadan .header-ramadan-star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f6d98a;
    box-shadow: 0 0 6px #f6d98a;
    animation: ramadan-star-twinkle 2.2s ease-in-out infinite;
}

body.theme-ramadan .header-ramadan-star--a {
    inset-inline-end: 18px;
    top: 28px;
    animation-delay: 0.2s;
}

body.theme-ramadan .header-ramadan-star--b {
    inset-inline-end: 42px;
    top: 8px;
    width: 3px;
    height: 3px;
    animation-delay: 0.8s;
}

body.theme-ramadan .header-ramadan-star--c {
    inset-inline-end: 8px;
    top: 22px;
    width: 3px;
    height: 3px;
    animation-delay: 1.4s;
}

/* Portal navbar: larger themed logo + float */
body.theme-custom_blue .navbar-brand,
body.theme-ramadan .navbar-brand {
    overflow: visible !important;
}

body.theme-custom_blue .navbar-brand-logo-wrap,
body.theme-ramadan .navbar-brand-logo-wrap {
    width: 100px !important;
    height: 100px !important;
    inset-inline-start: 0.55rem;
    animation: themed-navbar-logo-float 3.2s ease-in-out infinite;
}

body.theme-ramadan .navbar-brand-logo-wrap {
    top: 40% !important;
}

body.theme-custom_blue .navbar-brand-logo-disk,
body.theme-ramadan .navbar-brand-logo-disk {
    width: 100px !important;
    height: 100px !important;
}

body.theme-custom_blue .navbar-brand.has-logo-dust,
body.theme-ramadan .navbar-brand.has-logo-dust {
    overflow: visible;
}

.navbar-brand.has-logo-dust .logo-dust-mote {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--dust-size, 5px);
    height: var(--dust-size, 5px);
    margin: calc(var(--dust-size, 5px) / -2) 0 0 calc(var(--dust-size, 5px) / -2);
    border-radius: 50%;
    background: var(--dust-color, #ffffff);
    box-shadow:
        0 0 6px var(--dust-glow, rgba(255, 255, 255, 0.95)),
        0 0 12px var(--dust-glow, rgba(255, 255, 255, 0.75));
    animation: logo-dust-puff 0.55s ease-out forwards;
    animation-delay: var(--dust-delay, 0ms);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.navbar-brand.has-logo-dust .logo-dust-mote.is-white {
    --dust-color: #ffffff;
    --dust-glow: rgba(255, 255, 255, 0.95);
}

.navbar-brand.has-logo-dust .logo-dust-mote.is-blue {
    --dust-color: #5eb8f2;
    --dust-glow: rgba(58, 155, 225, 0.95);
}

.navbar-brand.has-logo-dust .logo-dust-mote.is-gold {
    --dust-color: #ffd76a;
    --dust-glow: rgba(255, 196, 54, 0.95);
}

.navbar-brand.has-logo-dust .logo-dust-mote.is-sky {
    --dust-color: #7dd3fc;
    --dust-glow: rgba(56, 189, 248, 0.9);
}

@keyframes logo-dust-puff {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1.15);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.4);
    }
}

body.theme-custom_blue .navbar-brand-logo,
body.theme-ramadan .navbar-brand-logo {
    width: 100px !important;
    height: 100px !important;
    max-height: none;
    object-fit: contain;
}

body.theme-ramadan .iri-sun-logo {
    position: relative;
}

body.theme-ramadan .auth-brand-logo-wrap .header-ramadan-decor,
body.theme-ramadan .welcome-logo .header-ramadan-decor,
body.theme-ramadan .app-navbar-logo-wrap .header-ramadan-decor {
    inset-inline-end: -8px;
    top: -8px;
    width: 80px;
    height: 58px;
}

@keyframes themed-navbar-logo-float {
    0%, 100% { transform: translateY(-35%); }
    50% { transform: translateY(calc(-35% - 7px)); }
}

@keyframes ramadan-fanoos-swing {
    0% { transform: rotate(-6deg); }
    100% { transform: rotate(6deg); }
}

@keyframes ramadan-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes ramadan-star-twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    body.theme-custom_blue .navbar-brand-logo-wrap,
    body.theme-ramadan .navbar-brand-logo-wrap,
    body.theme-ramadan .header-ramadan-crescent,
    body.theme-ramadan .header-ramadan-fanoos,
    body.theme-ramadan .header-ramadan-star {
        animation: none !important;
    }

    body.theme-custom_blue .navbar-brand-logo-wrap,
    body.theme-ramadan .navbar-brand-logo-wrap {
        transform: translateY(-35%);
    }
}

/* Notification bell dropdowns: stay within viewport */
.notifications-dropdown {
    max-height: 70vh; /* 100vh - 30% */
    overflow: hidden;
}

.notifications-dropdown .notifications-dropdown-body {
    max-height: calc(70vh - 6rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
