/* Base Styles */
:root {
    --primary: #007bff;
    --secondary: #6c757d;
    --dark: #343a40;
    --light: #f8f9fa;
}
html,
body {
 overflow-x: hidden;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-arrow {
    0% {
        transform: translateY(-50%);
    }
    50% {
        transform: translateY(-50%) translateX(3px);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* Animation Classes */
.animate-fade-in {
    opacity: 0;
    animation: fade-in 0.8s ease-out forwards;
}

.animate-slide-in {
    opacity: 0;
    animation: slide-in 0.8s ease-out forwards;
}

.animate-scale-in {
    opacity: 0;
    animation: scale-in 0.8s ease-out forwards;
}

/* Animation Delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Utility Classes */
.bg-primary {
    background-color: var(--primary);
}

.text-primary {
    color: var(--primary);
}

.bg-light {
    background-color: var(--light);
}

/* Responsive section padding */
.section-padding {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

/* Section Animations */
.section-animate > * {
    opacity: 0;
    animation: fade-in 0.8s ease-out forwards;
}

.section-animate > *:nth-child(1) { animation-delay: 0.1s; }
.section-animate > *:nth-child(2) { animation-delay: 0.2s; }
.section-animate > *:nth-child(3) { animation-delay: 0.3s; }
.section-animate > *:nth-child(4) { animation-delay: 0.4s; }
.section-animate > *:nth-child(5) { animation-delay: 0.5s; }

/* Card Hover Effects */
.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Image Effects */
.image-gradient {
    position: relative;
}

.image-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 123, 255, 0.9), transparent);
    z-index: 1;
}

/* Contact Button Styles */
.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    width: 100%; /* Full width on mobile */
    white-space: nowrap;
    padding-right: 2.5rem; /* Added extra padding for the arrow */
    text-align: center;
    max-width: 100%; /* Ensure it doesn't overflow container */
}

.contact-btn span.btn-text {
    display: inline-block;
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease-in-out;
}

.contact-btn span.btn-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    z-index: 10;
    transition: opacity 0.3s ease-in-out;
}

.contact-btn:hover span.btn-text {
    transform: translateX(-10px);
}

.contact-btn:hover span.btn-arrow {
    opacity: 1;
    animation: pulse-arrow 1.2s infinite;
}

/* Responsive fixes for contact button */
@media (max-width: 640px) {
    .contact-btn {
        padding-right: 2rem;
        font-size: 0.875rem;
        min-width: 200px; /* Ensure minimum width for readability */
    }
    
    .contact-btn span.btn-arrow {
        right: 0.75rem;
    }
    
    .contact-btn:hover span.btn-text {
        transform: translateX(-5px);
    }
}

@media (min-width: 641px) {
    .contact-btn {
        width: auto; /* Auto width on larger screens */
    }
}

#portfolio-grid nav button {
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
}

#portfolio-grid nav button:hover {
    color: rgb(224 43 32);
    background-color: transparent;
    border: 1px solid rgb(224 43 32);
}

#portfolio-grid nav button:active {
    color: var(--light);
    background-color: rgb(224 43 32);
}