:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --accent-color: #ffc107;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Animations et transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Styles généraux */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* Padding-top solo per desktop per compensare navbar sticky */
@media (min-width: 992px) {
    .hero-section {
        padding-top: 120px;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/pattern.png');
    opacity: 0.1;
}

.min-vh-80 {
    min-height: 80vh;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

/* Cartes avec effets avancés */
.service-card, .project-card, .team-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
}

.service-card::before, .project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before, .project-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover, .project-card:hover, .team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Navigation améliorée */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(0, 86, 179, 0.95) !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    margin: 0 2px;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 80%;
}

/* Boutons améliorés */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #004494);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    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.2), transparent);
    transition: left 0.5s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,86,179,0.3);
}

/* Section QHSE/RSE avancée */
.qhse-organigramme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.qhse-organigramme::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/pattern.png');
    opacity: 0.1;
}

.qhse-level {
    margin-bottom: 30px;
}

.qhse-node {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.qhse-node:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
}

.qhse-arrow-down {
    text-align: center;
    color: white;
    font-size: 24px;
    margin: 20px 0;
}

.qhse-process {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.qhse-process:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* Timeline améliorée */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    animation: slideInLeft 0.6s ease-out;
}

.timeline-year {
    position: absolute;
    left: -3rem;
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-left: 2rem;
    border-left: 4px solid var(--primary-color);
}

/* Filtres projets */
.filter-btn {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 8px 20px;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Certifications */
.certification-badge {
    min-width: 120px;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

.certification-badge:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Footer amélioré */
footer {
    background: linear-gradient(135deg, var(--dark-color), #2c3e50);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/pattern.png');
    opacity: 0.05;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

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

.social-links a i {
    position: relative;
    z-index: 1;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Bouton retour en haut amélioré */
#backToTop {
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: none;
}

#backToTop:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .timeline {
        padding-left: 2rem;
    }
    
    .timeline-year {
        left: -2rem;
    }
    
    .qhse-organigramme {
        padding: 20px;
    }
    
    .navbar-nav .nav-link {
        margin: 2px 0;
        text-align: center;
    }
}

/* Animations au scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --accent-color: #ffc107;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Animations et transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Styles généraux */
/* Hero Section con immagine di sfondo */
.hero-section {
    min-height: 400px;
    display: flex;
    align-items: center;
    padding-top: 76px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transition: opacity 1s ease-in-out;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.8) 0%, rgba(0, 68, 148, 0.8) 100%);
}

.service-background {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 400px;
    border-radius: 15px;
    overflow: hidden;
}

.service-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.7) 0%, rgba(0, 68, 148, 0.7) 100%);
}

.project-background {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 300px;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 0;
}

.project-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
}

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

.min-vh-80 {
    min-height: 80vh;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

/* Cartes avec effets avancés */
.service-card, .project-card, .team-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
}

.service-card::before, .project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before, .project-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover, .project-card:hover, .team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Navigation améliorée */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(0, 86, 179, 0.95) !important;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    margin: 0 2px;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 80%;
}

/* Boutons améliorés */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #004494);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    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.2), transparent);
    transition: left 0.5s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,86,179,0.3);
}

.btn-light {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-light:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.3);
}

/* Section QHSE/RSE avancée */
.qhse-organigramme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.qhse-organigramme::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/pattern.png');
    opacity: 0.1;
}

.qhse-level {
    margin-bottom: 30px;
}

.qhse-node {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.qhse-node:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
}

.qhse-arrow-down {
    text-align: center;
    color: white;
    font-size: 24px;
    margin: 20px 0;
}

.qhse-process {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.qhse-process:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* Timeline améliorée */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    animation: slideInLeft 0.6s ease-out;
}

.timeline-year {
    position: absolute;
    left: -3rem;
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-left: 2rem;
    border-left: 4px solid var(--primary-color);
}

/* Filtres projets */
.filter-btn {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 8px 20px;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Galerie d'images */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Certifications */
.certification-badge {
    min-width: 120px;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

.certification-badge:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Footer amélioré */
footer {
    background: linear-gradient(135deg, var(--dark-color), #2c3e50);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/pattern.png');
    opacity: 0.05;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

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

.social-links a i {
    position: relative;
    z-index: 1;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Bouton retour en haut amélioré */
#backToTop {
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: none;
}

#backToTop:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        text-align: center;
        min-height: 60vh;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .service-background,
    .project-background {
        min-height: 250px;
    }
    
    .timeline {
        padding-left: 2rem;
    }
    
    .timeline-year {
        left: -2rem;
    }
    
    .qhse-organigramme {
        padding: 20px;
    }
    
    .navbar-nav .nav-link {
        margin: 2px 0;
        text-align: center;
    }
}

/* Animations au scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hero slider */
.hero-slider {
    position: relative;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    opacity: 1;
}