/* Custom CSS for enhanced styling and animations */

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Animation classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Intersection Observer classes for scroll animations */
.fade-in-up,
.fade-in-left,
.fade-in-right {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease-out;
}

.fade-in-left {
    transform: translateX(0);
}

.fade-in-right {
    transform: translateX(0);
}

.animate-in {
    opacity: 1 !important;
    transform: translate(0, 0) !important;
}

/* Custom button styles */
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before,
.btn-secondary::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;
    z-index: -1;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    left: 100%;
}

/* Service card hover effects */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* Portfolio card animations */
.portfolio-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
}

/* Testimonial card styling */
.testimonial-card {
    position: relative;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

/* Navigation enhancements */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* Form enhancements */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Loading animation for buttons */
.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 #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .fade-in-left,
    .fade-in-right {
        animation: fadeInUp 0.8s ease-out;
    }

    .service-card,
    .portfolio-card,
    .testimonial-card {
        margin-bottom: 1rem;
    }
}

/* Parallax effect for hero section */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Success/Error message styling */
.message-success {
    background-color: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.message-error {
    background-color: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Navbar scroll effect */
.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Typing effect for hero text */
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
}

/* Sequential typing animation for two lines */
.typing-line-1 {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    border-right: 1px solid #6366f1;
    animation: typing-line1 2s steps(20, end) forwards, blink-small-cursor 0.75s step-end infinite;
}

.typing-line-2 {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typing-line2 2s steps(25, end) 2.2s forwards;
}

@keyframes typing-line1 {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes typing-line2 {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #6366f1;
    }
}

@keyframes cursor-hide {
    to {
        border-color: transparent;
    }
}

@keyframes cursor-show {
    from {
        border-color: transparent;
    }
    to {
        border-color: #6366f1;
    }
}

@keyframes blink-small-cursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #6366f1;
    }
}

/* Portfolio image styling */
.portfolio-image {
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.02);
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Gallery Modal */
#galleryModal {
    animation: fadeIn 0.3s ease-out;
}

#galleryModal .bg-white {
    animation: slideInUp 0.3s ease-out;
}

.gallery-image-container {
    transition: transform 0.3s ease;
}

.gallery-image-container:hover {
    transform: scale(1.02);
}

.gallery-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lightbox Modal */
#lightboxModal {
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

#lightboxModal button {
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightboxModal button:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

#lightboxImageContainer {
    transition: opacity 0.3s ease;
}

#lightboxImageContainer img {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#imageCounter {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Enhanced hover effects for social icons */
.social-icon {
    transition: all 0.3s ease;
    position: relative;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-icon:hover::before {
    opacity: 1;
}

/* Custom selection color */
::selection {
    background-color: #6366f1;
    color: white;
}

::-moz-selection {
    background-color: #6366f1;
    color: white;
}
