/* Forcer les cartes à rester plates même au hover */
.service-card:hover .card-3d-container {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}:root {
    --primary-color: #590036;
    --secondary-color: #8E1165;
    --background-color: #f9e9f1;
    --card-bg-color: #ffffff;
    --text-color: #333333;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-color: #D8ABBD;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Conteneur pour les particules connectées */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Canvas des particules */
.particles canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Animation background subtile */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(142, 17, 101, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(106, 27, 154, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(89, 0, 54, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

header {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: var(--shadow);
}

.header-title {
    font-size: 2.2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1rem;
    flex: 1;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    padding: 0 1rem;
}

.welcome-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.welcome-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.services {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
    padding: 0 0.5rem;
}

/* Carte de service avec perspective 3D */
.service-card {
    perspective: 1000px;
    width: 100%;
    max-width: 450px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Conteneur 3D pour l'effet de rotation SANS ENFONCEMENT */
.card-3d-container {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-style: preserve-3d;
    background-color: var(--card-bg-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.card-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.edt-bg {
    background-image: linear-gradient(135deg, #8E1165 0%, #D81B60 100%);
}

.absence-bg {
    background-image: linear-gradient(135deg, #8E1165 0%, #6A1B9A 100%);
}

.moodle-bg {
    background-image: linear-gradient(135deg, #FF6F00 0%, #FF8F00 100%);
}

/* Particules interactives au hover */
.service-card {
    position: relative;
    overflow: visible;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
    border-radius: 20px;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover .card-header-bg {
    transform: scale(1.1);
}

.card-icon {
    font-size: 5rem;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s ease;
}

.service-card:hover .card-icon {
    transform: rotate(10deg);
}

.card-content {
    padding: 2rem;
}

.card-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
}

.service-card:hover .card-title::after {
    width: 100%;
}

.card-description {
    margin-bottom: 2rem;
    color: #555;
    line-height: 1.7;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(142, 17, 101, 0.3);
    width: 100%;
    text-align: center;
}

.btn::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: 0.5s;
}

.btn:hover::before,
.btn:active::before {
    left: 100%;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 17, 101, 0.4);
}

.btn:active {
    transform: translateY(1px);
}

/* Applications Section */
.applications-section {
    margin-top: 4rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: bold;
}

.dropdown-section {
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.dropdown-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1.5rem 2rem;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    user-select: none;
}

.dropdown-header:hover {
    background: #6B0044;
}

.dropdown-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.dropdown-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.dropdown-section.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.dropdown-section.active .dropdown-content {
    padding: 2rem;
    max-height: 1000px;
}

.subsection {
    margin-bottom: 2rem;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.app-link {
    text-decoration: none;
    color: inherit;
}

.app-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.app-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.app-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.3;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 1.5rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--primary-color);
    color: #f8f8f8;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #f8f8f8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #f0f0f0;
    text-decoration: underline;
}

/* Animation pour effet d'onde */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Optimisation mobile */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.8rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .services {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .service-card {
        max-width: 100%;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .card-title {
        font-size: 1.6rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .footer-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    /* Applications section mobile */
    .applications-section {
        margin-top: 3rem;
    }
    
    .section-title {
        font-size: 1.7rem;
        margin-bottom: 1.5rem;
    }
    
    .dropdown-header {
        padding: 1.2rem 1.5rem;
    }
    
    .dropdown-title {
        font-size: 1.1rem;
    }
    
    .dropdown-section.active .dropdown-content {
        padding: 1.5rem;
    }
    
    .app-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .app-card {
        padding: 1.2rem;
    }
    
    .app-icon {
        font-size: 2rem;
    }
    
    .app-name {
        font-size: 0.85rem;
    }
    
    .subsection-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.7rem;
    }
    
    .welcome-subtitle {
        font-size: 0.9rem;
    }
    
    .card-header {
        height: 150px;
    }
    
    .card-icon {
        font-size: 4rem;
    }
    
    .card-content {
        padding: 1.2rem;
    }
    
    .card-title {
        font-size: 1.4rem;
    }
    
    .card-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    
    main {
        padding: 2rem 0.8rem;
    }
}

/* Désactiver les effets 3D sur mobile */
@media (hover: none) {
    .card-3d-container {
        transform: none !important;
    }
    
    .service-card:hover .card-header-bg {
        transform: none;
    }
    
    .service-card:hover .card-icon {
        transform: none;
    }
}

/* Styles pour appareils tactiles */
.touch-device .btn:active {
    background-color: var(--secondary-color);
}

.touch-device .service-card:active .card-title::after {
    width: 100%;
}

.touch-device .card-3d-container:active {
    transform: none !important;
    box-shadow: var(--shadow);
}

/* Optimisation des animations au scroll */
.is-scrolling .particle,
.is-scrolling .service-card {
    animation-play-state: paused;
}