/* Advanced Animations */

/* Preloader Animations */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: white;
}

.tech-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 2rem;
    animation: fade-in-out 2s ease-in-out infinite;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.8));
    border-radius: 2px;
    animation: loading-progress 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
}

@keyframes fade-in-out {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes loading-progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200px);
    }
}

/* Hero Section Animations */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background: none;
    animation: none;
}

.hero-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: none;
    background-size: auto;
    animation: none;
}

@keyframes float-particles {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Gradient Text removed; use primary color text */
.gradient-text {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
    color: var(--primary-color) !important;
}

/* Remove gradient-shift animation entirely */
@keyframes gradient-shift { from { opacity: 1; } to { opacity: 1; } }

/* Hero Badge Animation */
.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    animation: badge-glow 3s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
    }
}

/* Floating Cards Animation */
.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    animation: float-card 6s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 20%;
    right: -10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 50%;
    left: -15%;
    animation-delay: 2s;
}

.floating-card.card-3 {
    bottom: 20%;
    right: -5%;
    animation-delay: 4s;
}


.floating-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgb(0, 0, 0);
    background: var(--primary-color);
}

.floating-card .card-content h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.floating-card .card-content p {
    margin: 0;
    font-size: 0.75rem;
    color: #666;
}

@keyframes float-card {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* Scroll Indicator Animation */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    animation: bounce-scroll 2s ease-in-out infinite;
}

.scroll-text {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.scroll-arrow {
    font-size: 1.2rem;
}

@keyframes bounce-scroll {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Service Cards Hover Animation */
.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Portfolio Filter Animation */
.filter-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-btn::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;
}

.filter-btn:hover::before {
    left: 100%;
}

/* Portfolio Item Reveal Animation */
.portfolio-item {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Team Member Card Animation */
.team-member {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.team-member:hover {
    transform: translateY(-15px);
}

.team-member:hover .member-image img {
    transform: scale(1.1);
}

.member-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.team-member:hover .member-overlay {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.team-member:hover .social-links a {
    transform: translateY(0);
}

.social-links a:nth-child(1) { transition-delay: 0.1s; }
.social-links a:nth-child(2) { transition-delay: 0.2s; }
.social-links a:nth-child(3) { transition-delay: 0.3s; }

.social-links a:hover {
    background: white;
    color: #a7a7a7;
    transform: translateY(-5px) scale(1.1);
}

/* Testimonial Slider Animation */
.testimonials-slider {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 1rem 0;
}

.testimonial-card {
    flex: 0 0 350px;
    scroll-snap-align: start;
    animation: slide-in-testimonial 0.6s ease-out;
}

@keyframes slide-in-testimonial {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Counter Animation */
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: #000000;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat .stat-number {
    font-size: 3rem;
    font-weight: 700;
     background: linear-gradient(45deg, #a7a7a7, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::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.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Back to Top Button Animation */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #a7a7a7, #764ba2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Navbar Animation */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-toggler {
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
}

.navbar-toggler span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
    transform-origin: center;
}

.navbar-toggler[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggler[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Form Animation */
.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Animations */
@media (max-width: 768px) {
    .floating-card {
        display: none;
    }

    .hero-particles,
    .hero-grid {
        opacity: 0.5;
    }

    .gradient-text {
        background-size: 200% 200%;
    }

    .testimonials-slider {
        flex-direction: column;
        align-items: center;
    }

    .testimonial-card {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-particles,
    .hero-grid,
    .gradient-text {
        animation: none;
    }
}

/* Particle Animation */
@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Form Focus Effects */
.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-control {
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2348bb78' d='m2.3 6.73.94-.94 1.44 1.44L7.4 4.5l.94.94L4.66 9.17z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23f56565'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-check-input.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: block;
}

/* Modal Animations */
.modal.fade .modal-dialog {
    transform: scale(0.8) translateY(-50px);
    transition: all 0.3s ease;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Search Modal Specific */
#searchModal .modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-xl);
}

.search-suggestions {
    margin-top: 2rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-tag {
    background: var(--light-color);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Portfolio Modal */
.portfolio-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-image {
    width: 100%;
    border-radius: var(--border-radius-lg);
}

.modal-info h4 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.project-category {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.project-features h6,
.project-tech h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.project-features ul {
    list-style: none;
    padding: 0;
}

.project-features li {
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: var(--secondary-color);
}

.project-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Navbar Enhancements */
.navbar-brand {
    font-family: var(--font-family-secondary);
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    transition: var(--transition);
}

.navbar.scrolled .navbar-brand {
    color: var(--dark-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: #000 !important;
    padding: 0.75rem 1rem !important;
    transition: var(--transition);
    position: relative;
}

.navbar.scrolled .navbar-nav .nav-link {
    color: var(--dark-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: white;
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar.scrolled .navbar-nav .nav-link::after {
    background: var(--primary-color);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects for Images */
.hero-main-image,
.about-main-image,
.portfolio-image img {
    transition: var(--transition-slow);
}

.hero-main-image:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.05);
}

.about-main-image:hover {
    transform: scale(1.02);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Selection Styling */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Focus Visible */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .floating-card {
        background: rgba(30, 30, 30, 0.95);
        color: white;
    }

    .floating-card .card-content h6 {
        color: white;
    }

    .floating-card .card-content p {
        color: #ccc;
    }

    .form-control {
        background: #2d3748;
        border-color: #4a5568;
        color: white;
    }

    .form-control:focus {
        background: #2d3748;
        border-color: var(--primary-color);
    }
}

/* Print Styles */
@media print {
    .preloader,
    .navbar,
    .back-to-top,
    .floating-card,
    .hero-particles,
    .hero-grid {
        display: none !important;
    }

    .hero-section {
        background: none !important;
        color: black !important;
        min-height: auto !important;
        padding: 2rem 0 !important;
    }

    .gradient-text {
        background: none !important;
        -webkit-text-fill-color: black !important;
        color: black !important;
    }

    .section-title,
    .hero-title {
        color: black !important;
    }
}
