/* Preloader Styles */
#preloader {
    will-change: opacity;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevent body scroll when sidebar is open */
body.sidebar-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8a2be2;
}

/* Keyframe Animations */
@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-beam {

    0%,
    100% {
        opacity: 0.4;
        box-shadow: 0 0 10px #8a2be2;
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 30px #8a2be2, 0 0 60px #8a2be2;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Complex Effects with Animations */
.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #8a2be2 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease-in-out infinite;
}

.text-glow {
    text-shadow: 0 0 30px rgba(138, 43, 226, 0.8), 0 0 60px rgba(138, 43, 226, 0.4);
}

#announcement-bar svg {
    animation: sparkle 2s ease-in-out infinite;
}

#announcement-bar svg:nth-of-type(2) {
    animation-delay: 1s;
}

.pulse-beam {
    position: relative;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #8a2be2 50%, transparent 100%);
    animation: pulse-beam 3s ease-in-out infinite;
}

.pulse-beam::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent 0%, rgba(138, 43, 226, 0.1) 50%, transparent 100%);
    filter: blur(10px);
    animation: pulse-beam 3s ease-in-out infinite;
}

.pulse-beam::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(138, 43, 226, 0.3) 0%, transparent 70%);
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Pseudo-element effects */
#header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: #8a2be2;
    transition: width 0.3s ease;
    transform: translateX(-50%);
}

#header nav a:hover::after,
#header nav a:focus-visible::after {
    width: 80%;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #8a2be2;
    transition: width 0.3s ease;
}

.sidebar-link:hover::before,
.sidebar-link:focus-visible::before {
    width: 4px;
}

/* Stat hover effect with text-shadow */
.stat-item:hover .font-black {
    color: #8a2be2;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.6), 0 0 40px rgba(138, 43, 226, 0.4), 0 0 60px rgba(138, 43, 226, 0.2);
}

/* Responsive gradient text */
@media (max-width: 640px) {
    .gradient-text {
        background-size: 150% 150%;
    }
}

/* Service Row */
.service-row {
    contain: layout style;
}

.service-row:hover {
    contain: none;
}

.service-row:hover .service-row-inner {
    padding-left: 3rem;
    padding-right: 3rem;
}

@media (max-width: 1023px) {
    .service-row:hover .service-row-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Service Title with hover text-shadow */
.service-row:hover .service-title {
    color: #ffffff;
    text-shadow: 0 0 30px rgba(138, 43, 226, 0.4);
}

/* Service Title Period animation */
.service-row:hover .service-title-period {
    color: #8a2be2;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.8), 0 0 40px rgba(138, 43, 226, 0.4);
}

/* Service Description hover effect */
.service-row:hover .service-description {
    opacity: 1;
}

/* Service Icon hover effects */
.service-row:hover .service-icon {
    border-color: #8a2be2;
    color: #8a2be2;
    background: rgba(138, 43, 226, 0.1);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.3), 0 0 60px rgba(138, 43, 226, 0.1);
    transform: scale(1.1);
}

/* Cursor Image active state */
.service-cursor-image.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Hide scrollbar for horizontal scroll container */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Smooth scroll behavior for horizontal container */
@media (prefers-reduced-motion: no-preference) {
    .scrollbar-hide {
        scroll-behavior: smooth;
    }
}

/* Projects scroll container effects */
.projects-scroll {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.project-card {
    scroll-snap-align: center;
}

/* Adjust for smaller screens */
@media (max-width: 1023px) {
    .projects-scroll {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* FAQ Answer Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }

    to {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
}

/* CTA Gradient Animation */
@keyframes gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Blog Section Animations */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes float-delayed {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-40px, 30px) scale(1.05);
    }

    66% {
        transform: translate(25px, -25px) scale(0.95);
    }
}

.animate-float {
    animation: float 20s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 25s ease-in-out infinite;
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {

    .service-row-inner,
    .service-title,
    .service-description,
    .service-icon,
    .service-icon svg,
    .service-cursor-image {
        transition: none !important;
        animation: none !important;
    }

    .service-row:hover .service-title {
        transform: none;
    }

    .service-cursor-image {
        display: none !important;
    }

    /* Disable FAQ animations for reduced motion preference */
    @keyframes slideDown {

        from,
        to {
            opacity: 1;
            transform: scaleY(1);
        }
    }
}