/* ==========================================
   COMPONENTS - Tái sử dụng các thành phần
   ========================================== */

/* ==========================================
   GLASSMORPHISM EFFECT
   ========================================== */

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 0, 110, 0.3);
    box-shadow: 0 8px 32px rgba(255, 0, 110, 0.2);
    transform: translateY(-5px);
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-block;
    padding: 15px 45px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-glow {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 0 20px var(--secondary-gradient), inset 0 0 20px var(--secondary-gradient);
    border: 1px solid rgba(58, 134, 255, 0.3);
    font-weight: 700;
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 61, 61, 0.5);
    color: var(--secondary-gradient);
    text-shadow: 0 0 10px var(--secondary-gradient);
}

.btn-submit {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 0 20px var(--primary-gradient), inset 0 0 20px var(--primary-gradient);
    border: 1px solid rgba(58, 134, 255, 0.3);
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(58, 134, 255, 0.5);
}

/* ==========================================
   PLANET BACKGROUND ELEMENT
   ========================================== */

.planet-container {
    position: fixed;
    top: 54%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1100px;
    height: 1100px;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.planet-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: floatPlanet 4.5s ease-in-out infinite;
}

.planet-container.fade-out {
    opacity: 0;
}

/* ==========================================
   ANIMATIONS (Keyframes)
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatAvatar {

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

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

@keyframes floatPlanet {

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

    50% {
        transform: translateY(-25px) scale(1.05);
    }
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.7);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-50%) translateY(-50%) rotate(45deg) scaleX(0.2) scaleY(1.5);
        opacity: 0.5;
    }

    100% {
        transform: translateX(50%) translateY(50%) rotate(45deg) scale(0.2) scaleY(1.5);
        opacity: 0.5;
    }
}

@keyframes shooting-star {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-1000px, -1000px);
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 0, 110, 0.6);
    }
}

/* ==========================================
   TIMELINE IMAGES
   ========================================== */

.timeline-image {
    width: calc(50% - 40px);
    display: flex;
    align-items: center;
    border-radius: 10px;
    overflow: hidden;
}

.timeline-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    transition: var(--transition);
}

.timeline-image img:hover {
    transform: scale(1.05);
}

/* ==========================================
   FIXED SIDEBARS
   ========================================== */

.sidebar {
    position: fixed;
    display: flex;
    gap: 0;
    z-index: 500;
    flex-direction: column;
}

.sidebar-right {
    right: 2rem;
    bottom: 100px;
    gap: 0.8rem;
}

.sidebar-left {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.3rem;
}

.sidebar-icon i {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.sidebar-icon:hover {
    background: var(--primary-gradient);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(47, 127, 254, 0.6);
    transform: scale(1.15) translateY(-3px);
}

.sidebar-icon:hover i {
    background: none;
    -webkit-text-fill-color: initial;
    color: white;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1rem;
    background: rgba(255, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    white-space: nowrap;
    transition: var(--transition);
    writing-mode: horizontal-tb;
}

.sidebar-link span {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.sidebar-link:hover {
    background: var(--primary-gradient);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(47, 127, 254, 0.6);
    transform: scale(1.15) translateY(-3px);
}

.sidebar-link:hover span {
    background: none;
    -webkit-text-fill-color: initial;
    color: white;
}

/* ==========================================
   SCROLL TO TOP BUTTON
   ========================================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--secondary-gradient);
    cursor: pointer;
    transition: var(--transition);
    z-index: 550;
    opacity: 0;
    visibility: hidden;
    font-size: 1.5rem;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #bdd8ff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1.15) translateY(-3px);
}

/* ==========================================
   PROJECT CARD AS LINK
   ========================================== */

a.project-card {
    display: grid;
    grid-template-columns: 1fr;
    text-decoration: none;
    color: inherit;
}

/* ==========================================
   MUSIC PLAYER TOGGLE BUTTON
   ========================================== */

.music-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.05);
    /* Same as your sidebar icons */
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    z-index: 550;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.music-toggle i {
    font-size: 1.3rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
    z-index: 2;
}

.music-toggle:hover {
    background: var(--primary-gradient);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(47, 127, 254, 0.6);
    transform: scale(1.15) translateY(-3px);
}

.music-toggle:hover i {
    background: none;
    -webkit-text-fill-color: initial;
    color: white;
}

/* Music Playing State */
.music-toggle.playing {
    border-color: rgba(255, 0, 110, 0.6);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.4);
}

.music-toggle.playing i {
    background: linear-gradient(135deg, #ff006e, #8338ec);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.music-toggle.playing:hover i {
    background: none;
    -webkit-text-fill-color: initial;
    color: white;
}

/* Equalizer Waves Effect */
.music-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1;
}

.music-toggle.playing .music-waves {
    opacity: 1;
    visibility: visible;
}

.music-toggle.playing i {
    opacity: 0;
    /* Hide icon when playing to show waves */
}

/* Hide waves on hover to show icon again so user knows they can click to pause */
.music-toggle.playing:hover .music-waves {
    opacity: 0.2;
}

.music-toggle.playing:hover i {
    opacity: 1;
}

.music-waves span {
    display: block;
    width: 3px;
    height: 15px;
    background: var(--secondary-gradient);
    border-radius: 3px;
    animation: bounce 1s infinite ease-in-out alternate;
}

.music-waves span:nth-child(1) {
    animation-delay: 0.1s;
}

.music-waves span:nth-child(2) {
    animation-delay: 0.5s;
    height: 25px;
}

.music-waves span:nth-child(3) {
    animation-delay: 0.3s;
}

.music-toggle:hover .music-waves span {
    background: white;
}

@keyframes bounce {
    10% {
        transform: scaleY(0.3);
    }

    100% {
        transform: scaleY(1);
    }
}