/* Animation de fond */
@keyframes changeBg {
    0% { background-color: #ff4d4d; }
    33% { background-color: #ffff66; }
    66% { background-color: #66ffcc; }
    100% { background-color: #ff4d4d; }
}

body {
    margin: 0;
    padding: 0;
    animation: changeBg 3s infinite;
    font-family: Arial, sans-serif;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow-x: hidden;
}

h1 {
    margin-top: 20px;
    font-size: 36px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

/* Boutons de langue */
.lang-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.lang-buttons button {
    border: none;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lang-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.fr { background-color: #0055A4; }
.es { background-color: #C60B1E; }
.ar { background-color: #007A3D; }
.it { background-color: #008C45; }
.ru { background-color: #D52B1E; }
.tr { background-color: #E30A17; }
.zh { background-color: #DE2910; }
.hi { background-color: #FF9933; }
.en { background-color: #00247D; }
.pt { background-color: #006600; }

/* Logo animé */
.rotating-square {
    width: 150px;
    height: 150px;
    margin: 20px 0;
    border: 5px solid white;
    background: linear-gradient(45deg, red, orange, yellow, green, blue, purple);
    animation: rotateSquare 5s linear infinite, colorShift 10s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
}

@keyframes rotateSquare {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes colorShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.rotating-square span {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
}

/* Boutons principaux */
.video-btn, .info-btn, .help-btn, .contact-btn {
    border: none;
    padding: 12px 24px;
    margin: 10px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.video-btn { 
    background: linear-gradient(135deg, #3366FF, #00BFFF);
}

.info-btn { 
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.help-btn { 
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.contact-btn {
    background: linear-gradient(135deg, #9370db, #8e44ad);
}

.video-btn:hover, .info-btn:hover, .help-btn:hover, .contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.video-btn:active, .info-btn:active, .help-btn:active, .contact-btn:active {
    transform: translateY(1px);
}

/* Conteneur de la vidéo */
.video-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Wrapper pour positionner la vidéo et l'overlay */
.video-wrapper {
    position: relative;
    display: inline-block;
    width: 90%;
    max-width: 800px;
}

video {
    width: 100%;
    max-height: 70vh;
    border-radius: 15px;
    display: block;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
    /* Empêcher le plein écran sur iOS */
    object-fit: contain;
    -webkit-object-fit: contain;
}

/* Contrôles vidéo intégrés */
.video-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    z-index: 1001;
}

.video-control-btn {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.9), rgba(142, 68, 173, 0.9));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
    min-width: 140px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.video-control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.video-control-btn:active {
    transform: translateY(1px);
}

/* Overlay placé au-dessus de la vidéo */
.info-overlay {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    max-width: 80%;
    display: none;
    z-index: 1002;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    animation: fadeIn 0.5s ease-out;
    text-align: center;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.price-overlay {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 0.9));
    font-weight: bold;
    font-size: 24px;
}

.desc-overlay {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9), rgba(41, 128, 185, 0.9));
    line-height: 1.5;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    z-index: 1003;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

/* Formulaire amélioré */
.formulaire {
    display: none;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    color: white;
    width: 85%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    animation: slideDown 0.4s ease-out;
    border: 2px solid rgba(255,255,255,0.2);
}

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.formulaire h2 {
    margin-top: 0;
    color: white;
    margin-bottom: 25px;
    font-size: 26px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.formulaire input, .formulaire textarea {
    margin: 12px 0;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-family: Arial, sans-serif;
}

.formulaire input:focus, .formulaire textarea:focus {
    border-color: #ffeb3b;
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.6);
    outline: none;
    background: white;
    transform: scale(1.02);
}

.formulaire textarea {
    height: 120px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}

.formulaire button {
    padding: 14px 25px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s;
    flex: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.submit-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.5);
}

.close-form-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.close-form-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.5);
}

/* Modale de choix pour la vidéo */
#choiceModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#choiceModalContent {
    background: #fff;
    color: #000;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 80%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: popIn 0.4s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    80% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

#choiceModalContent p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #333;
}

#choiceModalContent button {
    border: none;
    padding: 12px 25px;
    margin: 10px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    min-width: 180px;
}

.choice-btn { 
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.close-choice-btn { 
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.close-choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    z-index: 1100;
    display: none;
    animation: slideIn 0.5s ease-out;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-50px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.notification.error {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.9));
}

.notification.success {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 0.9));
}

/* Modales d'information */
.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.info-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    position: relative;
    color: #333;
    line-height: 1.6;
    font-size: 18px;
}

.info-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.emojis {
    font-size: 24px;
    margin: 10px 0;
}

/* Style spécifique pour la modale de contact */
#appContactText {
    font-size: 18px;
    line-height: 1.8;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #9370db;
}

/* Bouton de téléchargement */
.download-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 140px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-size: 14px;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.download-btn:active {
    transform: translateY(1px);
}

/* Media query pour iPhone */
@media screen and (max-width: 768px) {
    .video-wrapper {
        width: 95%;
    }
    
    video {
        max-height: 60vh;
    }
    
    .video-controls {
        bottom: 10px;
        gap: 8px;
    }
    
    .video-control-btn, .download-btn {
        padding: 10px 15px;
        font-size: 12px;
        min-width: 120px;
    }
    
    .formulaire {
        width: 90%;
        padding: 20px;
    }
    
    .info-overlay {
        bottom: 140px;
        font-size: 16px;
        padding: 12px 20px;
    }
}

/* Empêcher le plein écran sur iOS */
video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

video {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}