/* ============================================
   DUYURU WISECP - GALAXY THEME
   Enhanced with premium features integration
   ============================================ */

.popup.galaxy {
    /* full-screen translucent backdrop */
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 10%, rgba(30, 10, 50, 0.34), rgba(5, 3, 10, 0.78));
    backdrop-filter: blur(6px) saturate(1.05);
    transition: opacity 240ms ease, visibility 240ms ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999999;
}

.popup.galaxy.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

:root {
    --dw-bg1: #0c081e;
    --dw-bg2: #140a28;
    --dw-accent: linear-gradient(90deg, rgba(120, 80, 255, 1) 0%, rgba(0, 200, 255, 1) 100%);
    --dw-shadow: 0 12px 60px rgba(2, 6, 20, 0.7);
    --dw-radius: 18px;
    --dw-contrast: rgba(255, 255, 255, 0.92);
}

.contentBox.galaxy {
    position: relative;
    display: flex;
    background: linear-gradient(135deg, var(--dw-bg1) 0%, var(--dw-bg2) 100%);
    width: 700px;
    max-width: calc(100% - 40px);
    border-radius: var(--dw-radius);
    height: 420px;
    box-shadow: var(--dw-shadow), inset 0 0 40px rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transform: translateY(6px) scale(.985);
    transition: transform 260ms cubic-bezier(.2, .9, .1, 1), opacity 220ms ease;
    opacity: 0;
    will-change: transform, opacity;
}

.contentBox.galaxy,
.contentBox.galaxy h1,
.contentBox.galaxy p,
.contentBox.galaxy h2 {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.popup.galaxy.show .contentBox.galaxy {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* star canvas overlay */
.contentBox.galaxy .stars-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.contentBox.galaxy .imgBx {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.contentBox.galaxy .imgBx::before {
    content: '';
    position: absolute;
    height: 300px;
    width: 300px;
    background: radial-gradient(circle at 30% 30%, rgba(120, 80, 255, 0.12) 0%, rgba(0, 0, 0, 0) 45%);
    border-radius: 50%;
    z-index: 1;
    animation: glow-pulse-slow 4s ease-in-out infinite;
}

@keyframes glow-pulse-slow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.contentBox.galaxy .imgBx img {
    position: relative;
    max-width: 230px;
    z-index: 2;
    filter: drop-shadow(0 8px 20px rgba(80, 0, 180, 0.3));
    pointer-events: auto;
    transition: transform 0.3s ease;
}

.contentBox.galaxy .imgBx a:hover img {
    transform: scale(1.05) rotate(2deg);
}

.contentBox.galaxy .content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 64%;
    height: 100%;
    z-index: 2;
    padding: 30px;
}

.contentBox.galaxy h1 {
    color: #fff;
    font-weight: 600;
    font-size: 1.6rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.contentBox.galaxy h2 {
    font-size: 2.2rem;
    color: #a7f3ff;
    text-shadow:
        0 4px 20px rgba(0, 255, 255, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.8);
    margin: 12px 0;
}

.contentBox.galaxy h2 sup {
    font-size: 1.4rem;
    vertical-align: super;
}

.contentBox.galaxy h2 span {
    font-size: 1.2rem;
    margin-left: 8px;
    opacity: 0.9;
}

.contentBox.galaxy p {
    color: #d1d6ff;
    font-weight: 300;
    line-height: 1.6;
    margin: 12px 0;
}

.contentBox.galaxy .cta-btn {
    display: inline-block;
    padding: 12px 28px;
    margin-top: 18px;
    background: var(--dw-accent);
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
    position: relative;
    overflow: hidden;
}

.contentBox.galaxy .cta-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.contentBox.galaxy .cta-btn:hover::before {
    width: 300px;
    height: 300px;
}

.contentBox.galaxy .cta-btn:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 8px 30px rgba(0, 200, 255, 0.25));
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

.contentBox.galaxy .cta-btn:active {
    transform: translateY(-1px);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--dw-contrast);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
}

.close-modal svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2.4;
}

/* Responsive Design */
@media(max-width : 660px) {
    .contentBox.galaxy {
        width: calc(100% - 32px);
        height: auto;
        flex-direction: column;
        padding-bottom: 18px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .contentBox.galaxy .content {
        width: 100%;
        height: auto;
        padding: 20px;
    }

    .contentBox.galaxy .imgBx {
        height: 220px;
        width: 100%;
    }

    .contentBox.galaxy .imgBx img {
        max-width: 180px;
    }

    .contentBox.galaxy h1 {
        font-size: 1.3rem;
    }

    .contentBox.galaxy h2 {
        font-size: 1.8rem;
    }
}

.contentBox.galaxy .content h1,
.contentBox.galaxy .content p {
    text-wrap: balance;
}

/* ============================================
   TOPBAR DISPLAY MODE
   ============================================ */

.popup.topbar-mode {
    align-items: flex-start;
    background: none;
    backdrop-filter: none;
}

.topbar.galaxy {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    width: calc(100% - 40px);
    max-width: 1100px;
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(90deg, rgba(8, 6, 20, 0.95), rgba(20, 10, 40, 0.95));
    backdrop-filter: blur(20px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 200ms ease, transform 220ms cubic-bezier(.2, .9, .1, 1);
}

.topbar.galaxy h1 {
    color: #fff;
    margin: 0;
    font-size: 1.1em;
    flex: 1;
}

.topbar.galaxy p {
    color: rgba(255, 255, 255, 0.8);
    margin: 4px 0 0 0;
    font-size: 0.9em;
}

.topbar.galaxy .actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar.galaxy .cta-btn {
    margin: 0;
    padding: 10px 20px;
    background: var(--dw-accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.topbar.galaxy .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 255, 0.3);
}

.popup.show .topbar.galaxy {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .topbar.galaxy {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .topbar.galaxy h1 {
        font-size: 1rem;
        width: 100%;
    }

    .topbar.galaxy .actions {
        width: 100%;
        justify-content: stretch;
        margin-top: 8px;
    }

    .topbar.galaxy .cta-btn {
        flex: 1;
    }
}

/* ============================================
   TOAST DISPLAY MODE
   ============================================ */

.toast.galaxy {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(20, 10, 40, 0.98), rgba(5, 4, 20, 0.98));
    backdrop-filter: blur(20px);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px) translateX(20px);
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.2, .9, .1, 1);
}

.toast.galaxy h1 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0 6px 0;
    font-weight: 600;
}

.toast.galaxy p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0;
}

.popup.show .toast.galaxy {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

@media (max-width: 768px) {
    .toast.galaxy {
        left: 20px;
        right: 20px;
        max-width: calc(100% - 40px);
    }
}

/* ============================================
   SUBTLE EFFECTS
   ============================================ */

/* subtle starfield effect for content */
.contentBox.galaxy .twinkle {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20% 10%, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0) 40%),
        radial-gradient(2px 2px at 60% 30%, rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0) 40%),
        radial-gradient(1px 1px at 80% 70%, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0) 30%);
    opacity: 0.4;
    mix-blend-mode: screen;
    animation: twinkle-drift 20s linear infinite;
}

@keyframes twinkle-drift {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

/* Smooth scroll for modal content */
.contentBox.galaxy {
    scroll-behavior: smooth;
}

/* Better focus visibility */
.contentBox.galaxy *:focus-visible {
    outline: 2px solid rgba(0, 212, 255, 0.6);
    outline-offset: 3px;
    border-radius: 4px;
}