/* Environment-specific image display */
.ide-image {
    display: none;
}

.spring-image {
    display: block;
}

/* When served from IDE live server */
.ide .ide-image {
    display: block;
}

.ide .spring-image {
    display: none;
}

:root {
    --primary-color: rgb(252, 210, 5);
    --primary-color-dark: rgb(216, 181, 4);
    --text-color: #333;
    --white: #fff;
    --black: #000;
    --border-radius: 12px;
    --transition-speed: 0.5s;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header styles */
header {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    padding: 0;
}

.header-container {
    width: 90%;
    max-width: 1800px;
    background-color: var(--primary-color);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    height: 200px;
}

.logo-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 190px;
}

.logo {
    width: 190px;
    border-radius: var(--border-radius);
    transition: transform var(--transition-speed);
}

.logo:hover {
    transform: scale(1.03);
}

/* Carousel styles */
#carousel {
    position: relative;
    width: 550px;
    height: 190px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-image {
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Navigation styles */
nav {
    padding: 1rem;
}

.nav-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
}

nav a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--primary-color);
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition-speed);
}

nav a:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    cursor: pointer;
}

nav a.active {
    background-color: var(--black);
    border-color: var(--black);
    color: var(--primary-color);
}

/* Gradient divider */
.header-bottom-gradient {
    width: 100%;
    height: 5vh;
    background: linear-gradient(180deg, var(--primary-color) 0%, transparent 100%);
}

/* Main content */
main {
    width: 90%;
    max-width: 1800px;
    margin: 2rem auto;
    padding: 2rem 1rem;
}

h1 {
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* Cards grid */
.cartes-accueil {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    justify-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.carte {
    width: 100%;
    max-width: 400px;
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-speed);
}

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

.carte-image {
    width: 100%;
    height: 250px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.carte-image .ide-image,
.carte-image .spring-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.carte-titre {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    background-color: var(--primary-color);
    padding: 0.5rem;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

/* Enhanced responsive design */
@media (max-width: 1200px) {
    .cartes-accueil {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    main {
        width: 95%;
        padding: 1.5rem 1rem;
    }
}

/* Burger menu styles */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 6;
}

.burger-line {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all var(--transition-speed);
    z-index: 6;
}

/* Mobile nav overlay with blur */
.nav-overlay {
    display: none;  /* Hide by default on all screens */
}

/* Menu label styles */
.menu-label {
    display: none;
    font-weight: 500;
    color: var(--text-color);
    margin-right: 1rem;
    opacity: 1;
    transition: opacity var(--transition-speed);
}

/* Update header and navigation styles */
@media (max-width: 768px) {
    body {
        padding-top: 80px; /* Height of the header */
    }

    header {
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        justify-content: center;
        background: none;
        transition: margin-top 0.3s ease;
        width: 100%;
        z-index: 5;
    }

    header.scrolled {
        margin-top: 1rem;
    }

    .header-container {
        width: 100%;
        margin-inline: 12px;
        border-bottom-left-radius: var(--border-radius);
        border-bottom-right-radius: var(--border-radius);
        transition: border-radius 0.3s ease;
        background-color: rgba(252, 210, 5, 0.85);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .header-container.scrolled {
        border-radius: var(--border-radius);
    }

    .cartes-accueil {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .banner {
        height: auto;
        min-height: 80px;
        gap: 1rem;
        padding: 1rem 1.5rem;
        justify-content: space-between;
    }

    .logo-link {
        height: auto;
        display: flex;
        align-items: center;
    }

    .logo {
        width: 95px;
        display: block;
    }

    #carousel {
        display: none;
    }

    .menu-container {
        display: flex;
        align-items: center;
    }

    .menu-label {
        display: block;
    }

    .burger-menu {
        display: flex;
        position: relative;
        top: 0;
        right: 0;
    }

    .menu-container.active .menu-label {
        opacity: 0;
    }

    .menu-container {
        display: flex;
        align-items: center;
    }

    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        z-index: 5;
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity var(--transition-speed), visibility var(--transition-speed);
    }

    nav.active {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .nav-overlay {
        position: fixed;
        top: -1rem;
        left: -1rem;
        width: 110%;
        height: 110vh;
        background-color: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(8px) brightness(0.7);
        -webkit-backdrop-filter: blur(8px) brightness(0.7);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity var(--transition-speed), visibility var(--transition-speed);
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .nav-list {
        position: relative;
        z-index: 10;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        padding: 0 2rem;
    }

    nav a {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
        background-color: var(--primary-color);
        border: 3px solid var(--primary-color);
        opacity: 0;
        transform: translateY(20px);
        transition: all var(--transition-speed);
    }

    nav.active a {
        opacity: 1;
        transform: translateY(0);
    }

    /* Reduce delays for nav items to start appearing immediately */
    nav.active a:nth-child(1) { transition-delay: 0s; }
    nav.active a:nth-child(2) { transition-delay: 0.05s; }
    nav.active a:nth-child(3) { transition-delay: 0.1s; }
    nav.active a:nth-child(4) { transition-delay: 0.15s; }
    nav.active a:nth-child(5) { transition-delay: 0.2s; }
    nav.active a:nth-child(6) { transition-delay: 0.25s; }
    nav.active a:nth-child(7) { transition-delay: 0.3s; }
    nav.active a:nth-child(8) { transition-delay: 0.35s; }

    /* Reset delays when menu closes */
    nav a:nth-child(n) {
        transition-delay: 0s;
    }

    /* Burger menu animation */
    .burger-menu.active .burger-line:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .burger-menu.active .burger-line:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active .burger-line:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    main {
        width: 100%;
        padding: 1rem 0.75rem;
        margin: 1.5rem auto;
        margin-top: calc(80px + 2rem); /* header height + original margin */
    }

    .carte {
        max-width: 100%;
    }

    .carte-image {
        height: 200px;
    }

    .header-bottom-gradient {
        height: 3vh;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
    }

    .burger-menu.active + .menu-label {
        opacity: 0;
    }

    .header-container {
        width: 100%;
        border-bottom-left-radius: var(--border-radius);
        border-bottom-right-radius: var(--border-radius);
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 70px; /* Slightly smaller header on mobile */
    }

    .header-container {
        width: 100%;
        margin-inline: 12px;
    }

    .banner {
        padding: 0.75rem 1rem;
        min-height: 70px;
    }

    .logo {
        width: 80px;
    }

    .menu-label {
        font-size: 0.9rem;
        margin-right: 0.75rem;
    }

    nav {
        padding: 0;
    }

    nav a {
        padding: 0.6rem 1.25rem;
        font-size: 1rem;
    }

    main {
        padding: 0.75rem 0.5rem;
        margin: 1rem auto;
    }

    .carte-image {
        height: 180px;
    }

    .carte-titre {
        font-size: 1.1rem;
        padding: 0.4rem;
    }

    .nav-list {
        padding: 0;
    }
}

/* Add fluid typography and spacing */
h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.carte-titre {
    font-size: clamp(1rem, 3vw, 1.2rem);
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    margin-bottom: 4rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
}

.hero-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    color: white;
}

.page-content .hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    padding-inline: 3rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: white;
}

.page-content .hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    max-width: 800px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Responsive styles for Hero */
@media (max-width: 768px) {
    .page-content .hero-content h1 {
        padding-inline: 0;
    }
}

/* Features Section */
.features-section {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-bottom: 4rem;
}

.feature-card {
    display: flex;
    gap: 4rem;
    align-items: center;
    padding: 2rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed);
}

.feature-card.reverse {
    flex-direction: row-reverse;
}

.feature-content {
    flex: 1;
    padding: 2rem;
}

.feature-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

.feature-image {
    flex: 1;
    height: 400px;
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.feature-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition-speed);
}

.feature-button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

/* Update responsive styles for feature cards */
@media (max-width: 768px) {
    .feature-card,
    .feature-card.reverse {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }

    .feature-content {
        order: 2;
    }

    .feature-image {
        order: 1;
        width: 100%;
        height: 300px;
    }

    .feature-button {
        margin-top: 1rem;
    }

    
}

/* CTA Section */
.cta-section {
    display: flex;
    align-items: stretch;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 4rem;
    overflow: hidden;
}

.cta-images-wrapper {
    position: relative;
    flex: 0 0 45%;
    padding: 3rem;
}

.cta-images {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.cta-image-top,
.cta-image-bottom {
    position: absolute;
    width: 75%;
    height: 280px;
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform var(--transition-speed);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cta-image-top {
    top: 0;
    left: 0;
    z-index: 2;
}

.cta-image-bottom {
    bottom: 0;
    right: 0;
    z-index: 1;
}

.cta-image-top:hover,
.cta-image-bottom:hover {
    transform: translateY(-5px);
    z-index: 3;
}

.cta-content {
    flex: 1;
    padding: 3rem;
    background-color: white;
}

.cta-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 2rem;
    color: var(--text-color);
}

.cta-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.cta-button {
    display: inline-block;
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-speed);
}

.cta-button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cta-images-wrapper {
        padding: 2rem;
    }

    .cta-content {
        padding: 2rem;
    }

    .cta-image-top,
    .cta-image-bottom {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .cta-section {
        flex-direction: column;
    }

    .cta-images-wrapper {
        flex: 0 0 auto;
        width: 100%;
        padding: 2rem 2rem 0;
    }

    .cta-images {
        min-height: 400px;
    }

    .cta-image-top,
    .cta-image-bottom {
        height: 220px;
        width: 80%;
    }

    .cta-content {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .cta-images-wrapper {
        padding: 1.5rem 1.5rem 0;
    }

    .cta-images {
        min-height: 350px;
    }

    .cta-image-top,
    .cta-image-bottom {
        height: 180px;
    }

    .cta-content {
        padding: 1.5rem;
    }

    .cta-buttons {
        grid-template-columns: 1fr;
    }
}

/* Stacked Images Section */
.stacked-section {
    display: flex;
    align-items: stretch;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 4rem;
    overflow: hidden;
}

.stacked-images-wrapper {
    position: relative;
    flex: 0 0 40%;
    padding: 3rem;
}

.stacked-images-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.stacked-image-top,
.stacked-image-bottom {
    position: absolute;
    width: 75%;
    height: 280px;
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.15s ease-in-out, z-index 0s, rotate 0.15s ease-in-out;
    transform: translate(0, 0);
    cursor: pointer;
}

.stacked-image-top {
    top: 10%;
    left: 0;
    z-index: 2;
}

.stacked-image-bottom {
    bottom: 10%;
    right: 0;
    z-index: 1;
}

.stacked-content {
    flex: 1;
    padding: 3rem;
    margin-left: 10%;  /* Add space between images and content */
    background-color: white;
    display: grid;
}

.stacked-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 2rem;
    color: var(--text-color);
}

.stacked-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
}

.stacked-button {
    display: inline-block;
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-speed);
}

.stacked-button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

/* Feature Cards */
.feature-card {
    display: flex;
    gap: 4rem;
    align-items: center;
    padding: 2rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed);
}

.feature-image {
    flex: 1;
    height: 400px;
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


/* Responsive styles */
@media (max-width: 1024px) {
    .stacked-images-wrapper {
        padding: 2rem;
    }

    .stacked-content {
        padding: 2rem;
        margin-left: 8%;  /* Slightly reduce space on smaller screens */
    }

    .stacked-image-top,
    .stacked-image-bottom {
        height: 240px;
    }

    .stacked-content-item {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .feature-card,
    .feature-card.reverse {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }

    .feature-content {
        order: 2;
        width: 100%;
    }

    .feature-image {
        order: 1;
        width: 100%;
        height: 250px;
        flex: none;  /* Remove flex to ensure proper sizing */
    }

    .stacked-section {
        flex-direction: column;
    }

    .stacked-images-wrapper {
        flex: 0 0 auto;
        width: 100%;
        padding: 2rem 2rem 0;
    }

    .stacked-images-container {
        min-height: 400px;
    }

    .stacked-image-top,
    .stacked-image-bottom {
        height: 220px;
        width: 80%;
    }

    .stacked-content {
        margin-left: 0;  /* Remove margin on mobile */
        width: 100%;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .features-section {
        gap: 2rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-image {
        height: 200px;
    }

    .feature-content {
        padding: 1rem 0;
    }

    .stacked-images-wrapper {
        padding: 1.5rem 1.5rem 0;
    }

    .stacked-images-container {
        min-height: 350px;
    }

    .stacked-image-top,
    .stacked-image-bottom {
        height: 180px;
    }

    .stacked-content {
        padding: 1.5rem;
    }

    .stacked-buttons {
        display: block;
        padding-top: 0;
    }
}