/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #e2e8f0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    filter: brightness(0.4) contrast(1.2);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Even darker overlay with very high alpha values */
    background: linear-gradient(
        135deg,
        rgba(88, 28, 135, 0.9) 0%,
        rgba(157, 23, 77, 0.85) 50%,
        rgba(120, 53, 15, 0.9) 100%
    );
    mix-blend-mode: multiply;
}

/* Allow the video overlay gradient to soften when revealing so background feels lighter */
.video-overlay {
    transition: opacity 900ms ease-in-out;
    opacity: 1;
}

body.revealing .video-overlay {
    opacity: 0.35; /* soften the gradient when revealing */
}

/* Floating Bubbles trên video */
.floating-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15), transparent);
    animation: float 8s ease-in-out infinite;
    filter: blur(1px);
}

.bubble-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 5%;
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.3), transparent);
    animation-delay: 0s;
}

.bubble-2 {
    width: 80px;
    height: 80px;
    top: 20%;
    right: 10%;
    background: radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.3), transparent);
    animation-delay: 2s;
}

.bubble-3 {
    width: 100px;
    height: 100px;
    bottom: 30%;
    left: 15%;
    background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.3), transparent);
    animation-delay: 4s;
}

.bubble-4 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    right: 5%;
    background: radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.3), transparent);
    animation-delay: 6s;
}

/* Animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    50% { 
        transform: translateY(-30px) rotate(180deg) scale(1.1);
    }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 20px currentColor;
    }
    50% { 
        box-shadow: 0 0 40px currentColor, 0 0 60px currentColor;
    }
}

@keyframes purple-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    }
    50% { 
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.7), 0 0 60px rgba(139, 92, 246, 0.4);
    }
}

/* Gradient Text - Giống home page */
.gradient-text {
    background: linear-gradient(90deg, #8b5cf6, #ec4899, #f59e0b);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
}

/* Glass Cards - Màu chủ đạo purple/pink */
.glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.6s ease;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 
        0 20px 40px rgba(139, 92, 246, 0.2),
        0 0 80px rgba(139, 92, 246, 0.1);
    animation: purple-glow 2s ease-in-out infinite;
}

/* Contact Info Items */
.contact-info-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.hover-lift:hover {
    transform: translateY(-5px);
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

.contact-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

/* Màu icon giống home page */
.bg-email { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.bg-phone { 
    background: linear-gradient(135deg, #ec4899, #db2777);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}
.bg-location { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.bg-discord { 
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.contact-label {
    color: #94a3b8;
    font-size: 0.875rem;
}

.contact-value {
    color: #f1f5f9;
    font-weight: 600;
}

/* Social Icons - Màu chủ đạo */
.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.hover-scale:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-icon:hover::before {
    left: 100%;
}

/* Màu social icons phù hợp với theme */
.twitter { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: rgba(139, 92, 246, 0.3);
}
.instagram { 
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: rgba(236, 72, 153, 0.3);
}
.github { 
    background: linear-gradient(135deg, #475569, #334155);
    border-color: rgba(71, 85, 105, 0.3);
}
.youtube { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: rgba(245, 158, 11, 0.3);
}

/* Quick Contact Buttons */
.quick-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.hover-glow:hover {
    animation: glow 1s ease-in-out;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.3);
}

.quick-contact-btn::after {
    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: all 0.3s ease;
}

.quick-contact-btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Màu quick contact buttons */
.quick-contact-btn.bg-email {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: rgba(139, 92, 246, 0.3);
}
.quick-contact-btn.bg-phone {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: rgba(236, 72, 153, 0.3);
}
.quick-contact-btn.bg-discord {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-color: rgba(139, 92, 246, 0.3);
}

/* Availability */
.availability-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.availability-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(5px);
}

.availability-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 1rem;
    position: relative;
}

.availability-status.available {
    background: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    animation: beat 2s infinite;
}

/* Message Bubbles */
.message-bubble {
    position: relative;
    background: rgba(30, 41, 59, 0.7);
    border-radius: 20px;
    padding: 1rem;
    margin: 0.5rem 0;
    animation: slideIn 0.5s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

.message-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: rgba(139, 92, 246, 0.3) transparent transparent;
}

.message-bubble.response {
    margin-left: 2rem;
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.message-bubble.response::after {
    left: auto;
    right: 20px;
    border-color: rgba(139, 92, 246, 0.2) transparent transparent;
}

/* Floating Character */
.floating-character {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 20;
    cursor: pointer;
}

.character-body {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 4s ease-in-out infinite;
    box-shadow: 
        0 10px 25px rgba(139, 92, 246, 0.4),
        0 0 50px rgba(139, 92, 246, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hover-bounce:hover {
    animation: bounce 0.5s ease;
}

.character-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6rem;
    height: 6rem;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
    border-radius: 50%;
    animation: beat 2s infinite;
}

.beat {
    animation: beat 2s infinite;
    display: inline-block;
}

/* Text colors giống home page */
.text-white {
    color: #f1f5f9;
}

.text-gray-300 {
    color: #cbd5e1;
}

.text-gray-400 {
    color: #94a3b8;
}

/* Background overlay giống home page */
.video-overlay {
    /* Almost opaque dark gradient overlay */
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(30, 41, 59, 0.9) 50%,
        rgba(15, 23, 42, 0.95) 100%
    );
}

/* Responsive Design */
@media (max-width: 768px) {
    .text-5xl {
        font-size: 2.5rem;
    }
    
    .text-7xl {
        font-size: 3rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .floating-character {
        bottom: 1rem;
        right: 1rem;
    }
    
    .character-body {
        width: 4rem;
        height: 4rem;
    }
    
    .video-bg {
        filter: brightness(0.3) contrast(1.2);
    }
}

/* Loading state cho video */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
}

/* Additional home-like styles */
.contact-card {
    background: rgba(15, 23, 42, 0.8);
}

.contact-info-item:hover .contact-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Purple focus states */
.form-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Selection color */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.8);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #db2777);
}

/* Loading overlay styles for kome page */
#loading-overlay, .loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45); /* semi-transparent so video can be visible underneath */
    z-index: 9999;
    pointer-events: all;
    opacity: 1;
    transition: opacity 900ms ease-in-out;
}

.loading-text, #loading-text {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

/* Hide everything while page is loading; allow only the overlay */
/* Keep the background video visible during loading by excluding its container (.video-background)
   Hide everything else while loading */
body.page-loading > *:not(#loading-overlay):not(.video-background) {
    display: none !important;
}

/* Fade-in video for kome page when overlay removed */
.video-background .video-bg,
.video-background video {
    transition: opacity 900ms ease-in-out;
    opacity: 0.12; /* dim during loading */
}

/* When revealing, fade to full visibility */
body.revealing .video-background .video-bg,
body.revealing .video-background video,
body:not(.page-loading) .video-background .video-bg,
body:not(.page-loading) .video-background video {
    opacity: 1; /* visible once loading ends */
}

/* Revealing state for kome: fade overlay out and show video */
body.revealing #loading-overlay,
body.revealing .loading-overlay {
    opacity: 0;
    pointer-events: none;
}

body.revealing .video-background .video-bg,
body.revealing .video-background video {
    opacity: 1;
}

/* Soften the main page's video overlay when revealing */
#video-background > div {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 900ms ease, background 900ms ease;
    opacity: 1;
    /* lighten the gradient tint so the video reads brighter after reveal */
    background: linear-gradient(
        90deg,
        rgba(65, 65, 65, 0.28) 0%,
        rgba(65, 65, 65, 0.28) 100%
    );
}

body.revealing #video-background > div {
    opacity: 0.35;
}