* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    background: linear-gradient(135deg, #8B0000 0%, #B22222 25%, #DC143C 50%, #B22222 75%, #8B0000 100%);
    background-size: 200% 200%;
    background-attachment: fixed;
    animation: gradientShift 8s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.4), 
                0 0 100px rgba(178, 34, 34, 0.3),
                0 0 200px rgba(139, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.preloader::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.preloader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shimmer {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translate(50%, 50%) rotate(180deg);
        opacity: 0.6;
    }
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    padding: 20px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.preloader-logo-img {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    animation: zoomInOut 1.5s ease-in-out infinite;
    will-change: transform;
    position: relative;
    z-index: 2;
}

@keyframes zoomInOut {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.6))
                drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.7))
                drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
    }
}

/* Optimisation mobile pour preloader */
@media (max-width: 768px) {
    .preloader {
        width: 100vw;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        min-height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .preloader::before,
    .preloader::after {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .preloader {
        width: 100vw;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        min-height: 100dvh;
    }
    
    .preloader-logo {
        max-width: 180px;
        padding: 20px;
        margin: 0 auto;
    }
    
    .preloader-logo-img {
        max-width: 140px;
    }
}

@media (max-width: 360px) {
    .preloader {
        width: 100vw;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        min-height: 100dvh;
    }
    
    .preloader-logo {
        max-width: 160px;
        padding: 15px;
        margin: 0 auto;
    }
    
    .preloader-logo-img {
        max-width: 120px;
    }
}

/* Support pour iOS Safari */
@supports (-webkit-touch-callout: none) {
    .preloader {
        min-height: -webkit-fill-available;
    }
    
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: -webkit-fill-available;
    }
}

.profile-container {
    max-width: 428px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* Bannière */
.banner {
    width: 100%;
    height: 200px;
    background-image: url('assets/banniere.JPG');
    background-size: cover;
    background-position: center 65%;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.qr-button {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background 0.3s;
}

.qr-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Photo de profil */
.profile-picture-container {
    display: flex;
    justify-content: center;
    margin-top: -60px;
    position: relative;
    z-index: 1;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 2px black;
    object-fit: cover;
    object-position: center;
    background: white;
}

/* Informations personnelles */
.profile-info {
    text-align: center;
    padding: 20px 20px 0;
}

.name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.title {
    font-size: 16px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.company {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 0 20px 24px;
    justify-content: center;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    width: 100%;
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
}

.btn-primary {
    background: #007AFF;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(0, 122, 255, 0);
    }
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    animation: none;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn svg {
    flex-shrink: 0;
}

/* Bio */
.bio {
    padding: 0 20px 24px;
    text-align: center;
}

.bio p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* Nos Services */
.services-section {
    padding: 0 20px 32px;
}

.services-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 24px;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.service-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007AFF;
}

.service-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.service-card-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.service-card-btn {
    width: 100%;
    padding: 12px 20px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.service-card-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.service-card-btn:active {
    transform: translateY(0);
}

/* Réseaux sociaux */
.social-media {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 0 20px 24px;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-icon:nth-child(1) {
    color: #0077b5;
}

.social-icon:nth-child(2) {
    color: #1877f2;
}

.social-icon:nth-child(3) {
    color: #e4405f;
}

.social-icon:nth-child(4) {
    color: #ff0000;
}

.social-icon:nth-child(5) {
    color: #5865f2;
}

/* Liens */
.links {
    padding: 0 20px 40px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    user-select: none;
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
}

.link-item:hover {
    background: #f9f9f9;
    border-color: #ccc;
    transform: translateX(4px);
}

.link-item svg:first-child {
    color: #666;
    flex-shrink: 0;
}

.link-item span {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.link-item svg:last-child {
    color: #999;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 428px) {
    .profile-container {
        max-width: 100%;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .btn {
        max-width: 100%;
    }
}

/* Pop-up de sélection de langue */
.language-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 20px;
    margin: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
}

.language-popup.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 10000 !important;
}

/* S'assurer que la pop-up est visible quand elle doit l'être */
.language-popup[style*="display: flex"] {
    display: flex !important;
}

/* Quand la pop-up n'est pas visible, elle ne doit pas bloquer les interactions */
.language-popup:not(.show) {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Quand la pop-up n'est pas visible, elle ne doit pas bloquer les interactions */
.language-popup:not(.show) {
    pointer-events: none !important;
    z-index: -1 !important;
}

.language-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B0000 0%, #B22222 25%, #DC143C 50%, #B22222 75%, #8B0000 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    opacity: 0.98;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
    z-index: 1;
}

.language-popup-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(178, 34, 34, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: popupSlideIn 0.5s ease-out;
    border: 2px solid rgba(178, 34, 34, 0.2);
    pointer-events: auto;
}

@keyframes popupSlideIn {
    0% {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.language-popup-header {
    text-align: center;
    margin-bottom: 32px;
}

.language-popup-logo {
    width: auto;
    height: 100px;
    max-width: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 4px 10px rgba(178, 34, 34, 0.3));
    object-fit: contain;
}

.language-popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.language-popup-subtitle {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.language-popup-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: left;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(178, 34, 34, 0.1), transparent);
    transition: left 0.5s ease;
}

.language-option:hover::before {
    left: 100%;
}

.language-option:hover {
    transform: translateY(-2px);
    border-color: #B22222;
    box-shadow: 0 8px 24px rgba(178, 34, 34, 0.2),
                0 0 0 1px rgba(178, 34, 34, 0.1);
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.language-option:active {
    transform: translateY(0);
}

.language-flag {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.language-name {
    flex: 1;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.language-option.selected {
    background: linear-gradient(135deg, #B22222 0%, #DC143C 100%);
    color: white;
    border-color: #8B0000;
    box-shadow: 0 8px 24px rgba(178, 34, 34, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.language-option.selected .language-name {
    color: white;
}

.language-option.selected::before {
    display: none;
}

/* Responsive pour la pop-up */
@media (max-width: 768px) {
    .language-popup {
        padding: 15px;
        align-items: center;
        justify-content: center;
    }
    
    .language-popup-content {
        padding: 32px 24px;
        border-radius: 20px;
        max-width: 95%;
        width: 100%;
        margin: auto;
    }
}

@media (max-width: 480px) {
    .language-popup {
        padding: 10px;
    }
    
    .language-popup-content {
        padding: 28px 20px;
        border-radius: 18px;
        max-width: 100%;
    }
    
    .language-popup-logo {
        width: auto;
        height: 80px;
        max-width: 80px;
        margin-bottom: 16px;
        object-fit: contain;
    }
    
    .language-popup-title {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .language-popup-subtitle {
        font-size: 14px;
    }
    
    .language-option {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .language-flag {
        font-size: 28px;
    }
    
    .language-popup-header {
        margin-bottom: 24px;
    }
}

@media (max-width: 360px) {
    .language-popup-content {
        padding: 24px 16px;
    }
    
    .language-popup-title {
        font-size: 20px;
    }
    
    .language-option {
        padding: 14px 18px;
        font-size: 15px;
    }
}

