/* ========================================
   PORTAL PAGE STYLES
   Cinematic entrance to Neural Worlds
   ======================================== */

/* Portal Container */
.portal {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

/* Neural Canvas */
.portal-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#neural-canvas {
    width: 100%;
    height: 100%;
}

/* Overlay gradient */
.portal-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(5, 5, 8, 0.8) 100%);
    pointer-events: none;
}

/* Portal Content */
.portal-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    padding: var(--space-xl);
}

/* Avatar with hologram effect */
.portal-avatar {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto var(--space-2xl);
}

.portal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-glow-lg);
    animation: avatar-float 4s ease-in-out infinite;
}

@keyframes avatar-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Avatar rings */
.portal-avatar::before,
.portal-avatar::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: ring-pulse 3s ease-in-out infinite;
}

.portal-avatar::before {
    inset: -15px;
    border-color: var(--primary);
    opacity: 0.5;
}

.portal-avatar::after {
    inset: -30px;
    border-color: var(--secondary);
    opacity: 0.3;
    animation-delay: 0.5s;
}

@keyframes ring-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

/* Scan line over avatar */
.portal-avatar .scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: avatar-scan 2s linear infinite;
}

@keyframes avatar-scan {
    0% {
        top: 0;
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Name with glitch */
.portal-name {
    font-size: var(--text-6xl);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    position: relative;
}

.portal-name .name-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

/* Title */
.portal-title {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    color: var(--primary);
    margin-bottom: var(--space-lg);
    text-shadow: var(--shadow-glow-sm);
}

/* Tagline with typing effect */
.portal-tagline {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-3xl);
    min-height: 2em;
}

.portal-tagline .cursor {
    display: inline-block;
    width: 12px;
    height: 24px;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

/* CTA Buttons */
.portal-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-3xl);
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-2xl);
    font-family: var(--font-mono);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.portal-btn-primary {
    background: var(--primary);
    color: var(--bg-primary);
    border: none;
}

.portal-btn-primary:hover {
    box-shadow: var(--shadow-glow-lg);
    transform: scale(1.05);
}

.portal-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.portal-btn-primary:hover::before {
    transform: translateX(100%);
}

.portal-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.portal-btn-secondary:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: var(--shadow-glow-secondary);
}

/* Navigation hints */
.portal-nav-hints {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
    padding-bottom: 80px;
    /* Tránh bị scroll indicator che */
}

.nav-hint {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.nav-hint:hover {
    color: var(--primary);
}

.nav-hint-icon {
    font-size: var(--text-xl);
}

/* Scroll indicator - hidden to avoid overlapping nav */
.portal-scroll {
    display: none;
    /* Ẩn vì đã có nav-hints */
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.scroll-mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    animation: scroll-ball 2s ease-in-out infinite;
}

@keyframes scroll-ball {

    0%,
    100% {
        top: 8px;
        opacity: 1;
    }

    50% {
        top: 20px;
        opacity: 0.3;
    }
}

/* Corner decorations */
.portal-corner {
    position: absolute;
    width: 100px;
    height: 100px;
    z-index: 2;
    opacity: 0.5;
}

.portal-corner::before,
.portal-corner::after {
    content: '';
    position: absolute;
    background: var(--primary);
}

.portal-corner.top-left {
    top: var(--space-xl);
    left: var(--space-xl);
}

.portal-corner.top-left::before {
    width: 60px;
    height: 2px;
    top: 0;
    left: 0;
}

.portal-corner.top-left::after {
    width: 2px;
    height: 60px;
    top: 0;
    left: 0;
}

.portal-corner.top-right {
    top: var(--space-xl);
    right: var(--space-xl);
}

.portal-corner.top-right::before {
    width: 60px;
    height: 2px;
    top: 0;
    right: 0;
}

.portal-corner.top-right::after {
    width: 2px;
    height: 60px;
    top: 0;
    right: 0;
}

.portal-corner.bottom-left {
    bottom: var(--space-xl);
    left: var(--space-xl);
}

.portal-corner.bottom-left::before {
    width: 60px;
    height: 2px;
    bottom: 0;
    left: 0;
}

.portal-corner.bottom-left::after {
    width: 2px;
    height: 60px;
    bottom: 0;
    left: 0;
}

.portal-corner.bottom-right {
    bottom: var(--space-xl);
    right: var(--space-xl);
}

.portal-corner.bottom-right::before {
    width: 60px;
    height: 2px;
    bottom: 0;
    right: 0;
}

.portal-corner.bottom-right::after {
    width: 2px;
    height: 60px;
    bottom: 0;
    right: 0;
}

/* Status indicators */
.portal-status {
    position: absolute;
    top: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--accent);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--accent-glow);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px transparent;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .portal-avatar {
        width: 140px;
        height: 140px;
    }

    .portal-name {
        font-size: var(--text-4xl);
    }

    .portal-title {
        font-size: var(--text-lg);
    }

    .portal-cta {
        flex-direction: column;
    }

    .portal-btn {
        width: 100%;
        justify-content: center;
    }

    .portal-nav-hints {
        flex-direction: column;
        align-items: center;
    }

    .portal-corner {
        display: none;
    }
}