/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: rgba(156, 163, 175, 0.5); border-radius: 20px; }

/* Background Pattern */
body {
    background-color: #ffffff;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}
html.dark body { background-color: #000000; }

.bg-pattern {
    background-image: url('../../images/Background.webp');
    background-size: 400px;
    background-repeat: repeat;
    background-position: center;
    animation: bgMove 120s linear infinite;
}
@keyframes bgMove {
    0% { background-position: 0 0; }
    100% { background-position: 400px 400px; }
}
html:not(.dark) .bg-pattern { filter: opacity(0.06); }
html.dark .bg-pattern { filter: invert(1) opacity(0.11); }

/* Top Blur */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    z-index: 40;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.hide-top-blur::before {
    opacity: 0;
}

/* Text Shadow for Pattern Visibility (Light Mode) */
html:not(.dark) .pattern-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Glass Button Styles */
.link-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effects */
@media (hover: hover) {
    .link-card:hover {
        transform: scale(1.02) translateY(-2px);
    }
}

/* Theme Toggle Glow */
html:not(.dark) { --glow-color-start: rgba(0, 0, 0, 0.2); --glow-color-end: rgba(0, 0, 0, 0.4); }
html.dark { --glow-color-start: rgba(255, 255, 255, 0.4); --glow-color-end: rgba(255, 255, 255, 0.8); }

.theme-icon-glow { filter: none; }
html.dark .theme-icon-glow { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)); }

/* Ripple Effect */
.ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    animation: ripple 0.6s linear; background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none; z-index: 50;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* View Transitions */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Colored Cards - 3D & Glow */
.card-red {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), inset -15px 0 25px rgba(255,255,255,0.25), 0 4px 6px rgba(0,0,0,0.3);
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.1);
}
.card-red:hover {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), inset -15px 0 25px rgba(255,255,255,0.4), 0 6px 12px rgba(0,0,0,0.4);
}

.card-black {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), inset -15px 0 25px rgba(255,255,255,0.15), 0 4px 6px rgba(0,0,0,0.5);
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
}
.card-black:hover {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), inset -15px 0 25px rgba(255,255,255,0.25), 0 6px 12px rgba(0,0,0,0.6);
}

.card-green {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), inset -15px 0 25px rgba(255,255,255,0.25), 0 4px 6px rgba(0,0,0,0.3);
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.1);
}
.card-green:hover {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), inset -15px 0 25px rgba(255,255,255,0.4), 0 6px 12px rgba(0,0,0,0.4);
}

.card-sky {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), inset -15px 0 25px rgba(255,255,255,0.25), 0 4px 6px rgba(0,0,0,0.3);
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.1);
}
.card-sky:hover {
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), inset -15px 0 25px rgba(255,255,255,0.4), 0 6px 12px rgba(0,0,0,0.4);
}

/* Outlined Cards Inner Shadow */
.card-outline-green {
    box-shadow: inset 0 0 20px rgba(34, 197, 94, 0.5);
}
html.dark .card-outline-green {
    box-shadow: inset 0 0 20px rgba(34, 197, 94, 0.15);
}
.card-outline-green:hover {
    box-shadow: inset 0 0 30px rgba(34, 197, 94, 0.6);
}
html.dark .card-outline-green:hover {
    box-shadow: inset 0 0 30px rgba(34, 197, 94, 0.25);
}

.card-outline-sky {
    box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.5);
}
html.dark .card-outline-sky {
    box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.15);
}
.card-outline-sky:hover {
    box-shadow: inset 0 0 30px rgba(14, 165, 233, 0.6);
}
html.dark .card-outline-sky:hover {
    box-shadow: inset 0 0 30px rgba(14, 165, 233, 0.25);
}

/* New Outline Colors for Freebies */
.card-outline-purple {
    box-shadow: inset 0 0 20px rgba(168, 85, 247, 0.5);
}
html.dark .card-outline-purple {
    box-shadow: inset 0 0 20px rgba(168, 85, 247, 0.15);
}
.card-outline-purple:hover {
    box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.6);
}
html.dark .card-outline-purple:hover {
    box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.25);
}

.card-outline-orange {
    box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.5);
}
html.dark .card-outline-orange {
    box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.15);
}
.card-outline-orange:hover {
    box-shadow: inset 0 0 30px rgba(249, 115, 22, 0.6);
}
html.dark .card-outline-orange:hover {
    box-shadow: inset 0 0 30px rgba(249, 115, 22, 0.25);
}

.card-outline-blue {
    box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.5);
}
html.dark .card-outline-blue {
    box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.15);
}
.card-outline-blue:hover {
    box-shadow: inset 0 0 30px rgba(37, 99, 235, 0.6);
}
html.dark .card-outline-blue:hover {
    box-shadow: inset 0 0 30px rgba(37, 99, 235, 0.25);
}

.card-outline-red {
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.5);
}
html.dark .card-outline-red {
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.15);
}
.card-outline-red:hover {
    box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.6);
}
html.dark .card-outline-red:hover {
    box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.25);
}

/* --- 3D Profile Flip Animation --- */
:root {
    /* Light Mode Images */
    --profile-front: url('../images/avater-light.webp');
    --profile-back: url('../images/logo-light.webp');
}

html.dark {
    /* Dark Mode Images */
    --profile-front: url('../images/avater-dark.webp');
    --profile-back: url('../images/Logo-dark.webp');
}

.profile-flip-container {
    width: 7rem; /* w-28 */
    height: 7rem; /* h-28 */
    perspective: 1000px;
    border-radius: 50%;
    position: relative;
    z-index: 10;
    border: 4px solid white;
    background-color: #f5f5f5;
}

html.dark .profile-flip-container {
    border-color: #000000;
    background-color: #171717;
}

.profile-flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: profileFlip 8s infinite;
    border-radius: 50%;
}

/* Pause animation on hover */
.profile-flip-container:hover .profile-flip-card {
    animation-play-state: paused;
}

.profile-flip-front, .profile-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.profile-flip-front {
    background-image: var(--profile-front);
}

.profile-flip-back {
    background-image: var(--profile-back);
    transform: rotateY(180deg);
}

@keyframes profileFlip {
    0%, 45% {
        transform: rotateY(0deg);
        animation-timing-function: cubic-bezier(0.1, 0.7, 0.1, 1);
    }
    50%, 95% {
        transform: rotateY(180deg);
        animation-timing-function: cubic-bezier(0.1, 0.7, 0.1, 1);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* --- Orbit Loader --- */
.orbit-loader {
    position: relative;
    width: 64px;
    height: 64px;
}
.orbit-planet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ef4444, #7f1d1d);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}
.orbit-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: orbitSpin 0.8s linear infinite;
}
.orbit-ring::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 15px #ffffff;
    z-index: 2;
}
.orbit-ring::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, transparent 50%, rgba(255, 255, 255, 0.3) 80%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), black calc(100% - 10px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 10px), black calc(100% - 10px));
    z-index: 1;
}
@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Glare Animation */
.btn-glare {
    position: relative;
    overflow: hidden;
}
.btn-glare::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: glare 3s infinite;
    pointer-events: none;
}
/* Dark mode adjustment for white button (uses dark sheen) */
html.dark .btn-glare::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.25), transparent);
}
@keyframes glare {
    0% { left: -100%; }
    20% { left: 200%; } /* Fast sweep */
    100% { left: 200%; } /* Pause before next loop */
}

/* Hide Header on Mobile Footer Intersection */
.header-hidden-mobile {
    transform: translate(-50%, -200%) !important; /* Maintain X centering, move Y up */
    opacity: 0;
    pointer-events: none;
}

/* Hide Brevo Chat Launcher Bubble */
#brevo-conversations-widget-button,
#sib-conversations-widget-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
}
