/* Custom animations and styles */
:root {
    --night-blue: #0f172a;
    --blue-400: #60a5fa;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade in animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
}

.fade-in-delay-1 {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.2s forwards;
}

.fade-in-delay-2 {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.4s forwards;
}

.fade-in-delay-3 {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

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

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

.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
    transition: left 0.5s;
}

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

/* Project card hover effect */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Expertise card hover effect */
.expertise-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.expertise-card:hover {
    transform: translateY(-2px);
}

/* Navigation active state */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--blue-400);
    transition: width 0.3s ease;
}

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

/* Form focus states */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

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

::-webkit-scrollbar-track {
    background: var(--night-blue);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .fade-in,
    .fade-in-delay-1,
    .fade-in-delay-2,
    .fade-in-delay-3 {
        animation-delay: 0s;
    }
}

/* Loading animation for form submission */
.loading {
    position: relative;
    color: transparent;
}

.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 #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Section padding adjustments */
section {
    scroll-margin-top: 80px;
}

/* Hero section background effect */
#accueil {
    background: linear-gradient(135deg, var(--night-blue) 0%, #1e293b 100%);
}

/* Subtle parallax effect for hero section */
@media (min-width: 768px) {
    #accueil {
        background-attachment: fixed;
    }
}

/* Image placeholder styles */
.hero-image-placeholder,
.about-image-placeholder,
.project-image-placeholder {
    transition: all 0.3s ease;
    position: relative;
}

.hero-image-placeholder:hover,
.about-image-placeholder:hover,
.project-image-placeholder:hover {
    border-color: var(--blue-400);
    background-color: rgba(96, 165, 250, 0.05);
}

/* Hero image decorative effects */
.hero-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-image-placeholder:hover::before {
    opacity: 1;
}

/* About image decorative frames animation */
.about-image-placeholder + div {
    transition: transform 0.3s ease;
}

.about-image-placeholder:hover + div {
    transform: rotate(3deg);
}

.about-image-placeholder:hover + div + div {
    transform: rotate(-2deg);
}

/* Project image placeholder effects */
.project-image-placeholder {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.project-image-placeholder:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, #334155 100%);
}

/* Responsive image adjustments */
@media (max-width: 768px) {
    .hero-image-placeholder,
    .about-image-placeholder {
        aspect-ratio: 4/3;
    }
    
    .project-image-placeholder {
        aspect-ratio: 16/10;
    }
}

/* Hero Carousel Styles */
.hero-carousel-image {
    transition: opacity 1s ease-in-out;
}

#hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Carousel fade effect */
.hero-carousel-image {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-carousel-image:first-child {
    opacity: 1;
}

/* Carousel container hover effect */
#hero-carousel:hover .hero-carousel-image {
    transition: opacity 0.8s ease-in-out;
}

/* Ensure smooth transitions */
.hero-carousel-image {
    will-change: opacity;
}
