/* css/animations.css */

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s cubic-bezier(0.85, 0, 0.15, 1);
}

.loader-content {
    text-align: center;
    overflow: hidden;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    opacity: 0;
    animation: loaderTextFade 1s forwards 0.2s;
    display: block;
}

.loader-progress {
    width: 0;
    height: 2px;
    background: var(--text-primary);
    margin-top: 20px;
    border-radius: 2px;
    transition: width 1.5s cubic-bezier(0.85, 0, 0.15, 1);
}

@keyframes loaderTextFade {
    to {
        opacity: 1;
    }
}

/* Custom Cursor */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background 0.3s;
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
}

.cursor.hover-link {
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    mix-blend-mode: difference;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cursor-follower.hover-link {
    opacity: 0;
    width: 80px;
    height: 80px;
}

/* Dynamic Island Navbar */
.dynamic-island {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 12px 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dynamic-island.scrolled {
    padding: 8px 16px;
    background: rgba(10, 10, 10, 0.85);
    border-color: rgba(255, 255, 255, 0.05);
}

.island-content {
    display: flex;
    gap: 28px;
    position: relative;
    z-index: 2;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s;
    position: relative;
    padding: 4px 6px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.island-indicator {
    position: absolute;
    bottom: -6px;
    height: 4px;
    width: 4px;
    border-radius: 50%;
    background: var(--text-primary);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.dynamic-island.scrolled .island-indicator {
    bottom: -4px;
}

.nav-link.active~.island-indicator {
    opacity: 1;
}

/* Micro-interactions */
.hover-glow {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-glow:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 240, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.typing-cursor {
    display: inline-block;
    width: 6px;
    height: 1.1em;
    background: var(--accent-electric);
    margin-left: 6px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    display: inline-block;
}

/* Success Message */
.success-message {
    margin-top: 20px;
    padding: 16px;
    background: rgba(30, 255, 100, 0.1);
    border: 1px solid rgba(30, 255, 100, 0.3);
    border-radius: 12px;
    color: #a7ffb1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.4s;
}

.success-message.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

/* Base Keyframes added for Orbs */
@keyframes breathingOrb {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1) translate(20px, -20px);
        opacity: 0.5;
    }

    100% {
        transform: scale(0.9) translate(-20px, 20px);
        opacity: 0.3;
    }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .dynamic-island {
        width: 92%;
        padding: 10px 15px;
        top: 20px;
    }

    .island-content {
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        width: 100%;
        scrollbar-width: none;
        /* Firefox */
    }

    .island-content::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .nav-link {
        font-size: 0.85rem;
        white-space: nowrap;
    }
}