/* ==========================================================================
   SECTION RÉALISATIONS
   ========================================================================== */

.realisations-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
}

.realisations-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="10" cy="10" r="1" fill="%23667eea" opacity="0.05"/></svg>');
    background-size: 50px 50px;
    pointer-events: none;
}

/* Grille des réalisations */
.realisations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin: 60px 0;
    position: relative;
    z-index: 1;
}

@media (max-width: 1200px) {
    .realisations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .realisations-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Carte de réalisation */
.realisation-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.realisation-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

/* Image de réalisation */
.realisation-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.realisation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95) contrast(1.05);
}

.realisation-card:hover .realisation-image img {
    transform: scale(1.15);
    filter: brightness(1.05) contrast(1.1);
}

.realisation-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.realisation-category {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Contenu de réalisation */
.realisation-content {
    padding: 30px;
}

.realisation-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 15px;
    line-height: 1.3;
}

.realisation-description {
    color: #4a5568;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Tags */
.realisation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.realisation-tags .tag {
    background: #e0e7ff;
    color: #667eea;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.realisation-tags .tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Statistiques de réalisation */
.realisation-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.realisation-stats .stat {
    text-align: center;
}

.realisation-stats .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.realisation-stats .stat-label {
    display: block;
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Statistiques globales */
.realisations-stats-global {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 60px 0 50px;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

.stat-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    transition: transform 0.4s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-number {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-text {
    color: #4a5568;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* CTA Section */
.realisations-cta {
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

.realisations-cta .cta-text {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 25px;
}

/* Animation pour les compteurs */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter {
    animation: countUp 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .realisations-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .realisation-image {
        height: 200px;
    }

    .realisation-content {
        padding: 25px;
    }

    .realisation-title {
        font-size: 20px;
    }

    .realisation-description {
        font-size: 14px;
    }

    .realisations-stats-global {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-card {
        padding: 30px 15px;
    }

    .stat-number {
        font-size: 40px;
    }

    .stat-text {
        font-size: 14px;
    }

    .realisations-cta .cta-text {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .realisations-stats-global {
        grid-template-columns: 1fr;
    }

    .realisation-stats {
        flex-direction: column;
        gap: 15px;
    }

    .realisation-stats .stat {
        padding: 10px 0;
    }

    .realisation-stats .stat:not(:last-child) {
        border-bottom: 1px solid #e2e8f0;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .realisations-section {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }

    .realisation-card {
        background: #2d3748;
    }

    .realisation-title {
        color: #f7fafc;
    }

    .realisation-description {
        color: #cbd5e0;
    }

    .realisation-stats {
        border-top-color: #4a5568;
    }

    .stat-card {
        background: #2d3748;
    }

    .stat-text {
        color: #cbd5e0;
    }

    .realisations-cta .cta-text {
        color: #f7fafc;
    }
}

/* Images par défaut en cas d'absence */
.realisation-image img[src*="realisations/"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Fallback pour images manquantes */
.realisation-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
}

/* ==========================================================================
   BOUTONS D'ACTION DES CARTES
   ========================================================================== */

.realisation-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f7fafc;
}

.btn-view-details,
.btn-view-video {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view-details::before,
.btn-view-video::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-view-details:hover::before,
.btn-view-video:hover::before {
    width: 300px;
    height: 300px;
}

.btn-view-details {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-view-details:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-view-video {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.btn-view-video:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.5);
}

.btn-view-details i,
.btn-view-video i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-view-details:hover i {
    transform: scale(1.2) rotate(5deg);
}

.btn-view-video:hover i {
    transform: scale(1.3);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-realisation,
.modal-video {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-realisation-content,
.modal-video-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: sticky;
    top: 10px;
    right: 10px;
    float: right;
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg);
}

/* Contenu du modal réalisation */
#realisationModalBody {
    padding: 40px;
}

.modal-realisation-header {
    margin-bottom: 30px;
}

.modal-category {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-realisation-header h2 {
    font-size: 32px;
    color: #2d3748;
    margin: 15px 0;
}

.modal-client,
.modal-date {
    color: #718096;
    font-size: 14px;
    margin: 5px 0;
}

.modal-client i,
.modal-date i {
    color: #667eea;
    margin-right: 8px;
}

.modal-image-principale {
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
}

.modal-image-principale img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-description,
.modal-donnees-spec,
.modal-tags,
.modal-stats,
.modal-galerie {
    margin: 30px 0;
}

.modal-description h3,
.modal-donnees-spec h3,
.modal-tags h3,
.modal-stats h3,
.modal-galerie h3 {
    font-size: 20px;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-description h3 i,
.modal-donnees-spec h3 i,
.modal-tags h3 i,
.modal-stats h3 i,
.modal-galerie h3 i {
    color: #667eea;
}

.modal-description p {
    color: #4a5568;
    line-height: 1.8;
    font-size: 16px;
}

.specs-grid {
    display: grid;
    gap: 15px;
}

.spec-item {
    padding: 15px;
    background: #f7fafc;
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.spec-item strong {
    color: #2d3748;
    display: block;
    margin-bottom: 8px;
}

.spec-item ul {
    margin: 10px 0 0 20px;
    color: #4a5568;
}

.spec-item li {
    margin: 5px 0;
}

.modal-tags .tag {
    display: inline-block;
    padding: 8px 16px;
    background: #edf2f7;
    color: #667eea;
    border-radius: 20px;
    font-size: 14px;
    margin: 5px;
    transition: all 0.3s ease;
}

.modal-tags .tag:hover {
    background: #667eea;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.stat-item .stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-item .stat-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
}

.galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.galerie-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.galerie-grid img:hover {
    transform: scale(1.05);
}

/* Modal Vidéo */
.modal-video-content {
    max-width: 1200px;
    padding: 20px;
}

#videoModalBody h2 {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 20px;
    padding-left: 60px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 768px) {
    #realisationModalBody {
        padding: 20px;
    }

    .modal-realisation-header h2 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .galerie-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .realisation-actions {
        flex-direction: column;
    }

    .btn-view-details,
    .btn-view-video {
        width: 100%;
    }
}
