:root {
    --primary-color: #6b2b89;
    --secondary-color: #4a90e2;
    --accent-color: #e74c3c;
    --light-purple: #8e44ad;
    --dark-purple: #4a235a;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Global image responsiveness */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container modifications for better mobile experience */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    transition: transform 0.3s ease;
}

.navbar-brand img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: var(--dark-purple);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--white) !important;
    border-radius: 25px;
    padding: 0.5rem 1.5rem !important;
    margin-left: 0;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--dark-purple);
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(
        135deg,
        var(--primary-color) 0%,
        var(--secondary-color) 100%
    );
    color: var(--white);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(107, 43, 137, 0.3) 0%,
        rgba(74, 144, 226, 0.3) 100%
    );
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h2 {
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-image {
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    width: 100%;
}

.cta-group {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--primary-color) 0%,
        var(--secondary-color) 100%
    );
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(107, 43, 137, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--white);
    color: var(--white);
    background: transparent;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-outline-primary:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* Stats Section */
.stats {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.stat-item {
    text-align: center;
    padding: 2rem 1rem;
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-item h3 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--dark-purple);
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #666;
}

/* Formations */
.formations {
    padding: 80px 0;
}

.formations h2 {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 3rem;
    color: var(--dark-purple);
}

.formation-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.formation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.formation-card img {
    border-radius: 10px;
    margin-bottom: 1rem;
    object-fit: cover;
    width: 100%;
    height: 200px;
}

.formation-card h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
    color: var(--dark-purple);
}

.formation-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: #666;
}

/* Portes Ouvertes */
.open-day {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
}

.open-day h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: var(--dark-purple);
}

.open-day h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.open-day-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.event-details p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-details i {
    color: var(--primary-color);
    width: 20px;
}

.event-highlights {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.event-highlights li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.event-highlights li i {
    color: var(--primary-color);
    margin-right: 1rem;
    width: 20px;
}

/* Carousel Styles */
.carousel {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.carousel-item {
    height: 400px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-indicators button {
    background-color: var(--primary-color);
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
}

/* Contact */
.contact {
    padding: 80px 0;
}

.contact h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 2rem;
    color: var(--dark-purple);
}

.contact-info {
    margin-bottom: 2rem;
}

.contact-info p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-info i {
    color: var(--primary-color);
    width: 20px;
}

.map-container {
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 2rem;
    background: #f8f9fa;
}

/* Form Styling */
.contact-form .form-control,
#inscriptionForm .form-control,
#reservationForm .form-control {
    border-radius: 25px;
    padding: 0.8rem 1.2rem;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.contact-form .form-control:focus,
#inscriptionForm .form-control:focus,
#reservationForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(107, 43, 137, 0.25);
}

button.btn-primary.w-100 {
    border-radius: 25px;
    padding: 0.8rem;
    font-weight: bold;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Footer */
footer {
    background-color: var(--dark-purple);
    color: var(--white);
    padding: 40px 0 20px;
}

footer h4 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    margin-bottom: 1rem;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--white);
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-color);
}

.social-links a {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-right: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.2);
}

/* Modal Improvements */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem;
}

.modal-title {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: var(--dark-purple);
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 992px) {
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }

    .hero .row {
        flex-direction: column-reverse;
    }

    .hero-image {
        height: 300px;
        margin-bottom: 2rem;
    }

    .formations,
    .open-day,
    .contact {
        padding: 60px 0;
    }

    .carousel-item {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand img {
        height: 40px;
    }

    .navbar-collapse {
        text-align: center;
        margin-top: 1rem;
    }

    .navbar-nav .nav-item {
        margin: 0.5rem 0;
    }

    .cta-button {
        margin-left: 0;
        margin-top: 1rem;
    }

    .hero {
        padding: 80px 0 40px;
        text-align: center;
    }

    .hero-image {
        height: 250px;
    }

    .cta-group {
        flex-direction: column;
        align-items: center;
    }

    .cta-group .btn {
        width: 100%;
        max-width: 300px;
    }

    .formation-card {
        padding: 1rem;
    }

    .formation-card img {
        height: 180px;
    }

    .open-day-content {
        padding: 1.5rem;
    }

    .carousel-item {
        height: 250px;
    }

    .contact-info p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .map-container {
        height: 250px;
    }

    .stats {
        padding: 60px 0;
    }

    .stat-item {
        padding: 1.5rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero-image {
        height: 200px;
    }

    .formation-card img {
        height: 160px;
    }

    .carousel-item {
        height: 200px;
    }

    .open-day-content {
        padding: 1rem;
    }

    .event-highlights li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .hero-image {
        height: 180px;
    }

    .formation-card img {
        height: 140px;
    }

    .carousel-item {
        height: 180px;
    }

    .cta-group .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Utility classes for better mobile experience */
.text-center-mobile {
    text-align: center;
}

.mb-mobile {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .text-center-mobile {
        text-align: left;
    }
}

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

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .cta-group,
    .carousel-control-prev,
    .carousel-control-next,
    .social-links {
        display: none;
    }

    .hero {
        background: none;
        color: #333;
    }
}
