/* ════════════════════════════════════════════════════════
   TRANSITIONS.CSS — Global Page Transition Overlay & Initial Loader
   ════════════════════════════════════════════════════════ */

.global-transition-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 99999;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Initially visible to hide unstyled content, JS will fade it out */
}

/* ─── COMPLEX INITIAL LOADER ─── */
.initial-loader-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    overflow: hidden;
}

/* Atmospheric blurred background elements */
.loader-glow-1 {
    position: absolute;
    width: 70vw;
    height: 70vh;
    background: radial-gradient(circle, rgba(16, 212, 118, 0.12) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    filter: blur(80px);
    opacity: 0;
}

.loader-glow-2 {
    position: absolute;
    width: 50vw;
    height: 50vh;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    filter: blur(50px);
    opacity: 0;
}

/* Elegant Logo container */
.loader-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.loader-title-wrapper {
    position: relative;
    font-family: var(--font-logo);
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 15px;
    margin-right: -15px;
    /* compensate tracking */
}

.loader-title-outline {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.15);
}

.loader-title-fill {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--text-main);
    overflow: hidden;
    width: 0%;
    /* GSAP animates this */
    white-space: nowrap;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.loader-subtitle {
    font-family: var(--font-logo);
    font-size: 1.1rem;
    color: var(--accent-color);
    letter-spacing: 12px;
    margin-right: -12px;
    margin-top: 25px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
}

.loader-line {
    position: absolute;
    bottom: -40px;
    left: 50%;
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(16, 212, 118, 0.6);
}

/* ─── THEMED PAGE TRANSITION ICONS ─── */
.nav-transition-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    opacity: 0;
}

.nav-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    font-family: var(--font-logo);
    font-size: 1.5rem;
    color: var(--text-main);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Theme: Home */
.theme-home .nav-icon {
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(16, 212, 118, 0.4);
}

.theme-home .nav-icon::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 50%;
    filter: blur(5px);
    animation: pulse 1s infinite alternate;
}

/* Theme: About */
.theme-about .nav-icon {
    background: transparent;
}

.theme-about .nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--accent-color);
    fill: none;
    stroke-width: 2;
    animation: spin 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(16, 212, 118, 0.5));
}

/* Theme: Services */
.theme-services .nav-icon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.theme-services .nav-icon div {
    background: rgba(16, 212, 118, 0.2);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(16, 212, 118, 0.2);
    animation: pulse 1s infinite alternate;
}

.theme-services .nav-icon div:nth-child(2) {
    animation-delay: 0.2s;
}

.theme-services .nav-icon div:nth-child(3) {
    animation-delay: 0.4s;
}

.theme-services .nav-icon div:nth-child(4) {
    animation-delay: 0.6s;
}

/* Theme: Projects */
.theme-projects .nav-icon {
    border: 2px solid var(--text-main);
    border-radius: 4px;
}

.theme-projects .nav-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
    animation: morph 2s infinite alternate;
}

/* Theme: Contact */
.theme-contact .nav-icon {
    border: 2px dashed var(--accent-color);
    border-radius: 50%;
    animation: spin 4s linear infinite;
}

.theme-contact .nav-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--text-main);
    border-radius: 50%;
    box-shadow: 0 0 30px var(--text-main);
}

/* Utilities */
@keyframes pulse {
    from {
        transform: scale(0.8);
        opacity: 0.5;
    }

    to {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes morph {
    0% {
        border-radius: 0%;
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        border-radius: 50%;
        transform: translate(-50%, -50%) rotate(180deg);
    }
}