/* CORRECTION MOBILE URGENTE */
header.vh-100 {
    min-height: auto !important;
    height: auto !important;
}

@media screen and (max-width: 768px) {
    header img.img-fluid.rounded-circle {
        width: 220px !important;
        height: 220px !important;
    }
    
    header .position-absolute {
        width: 240px !important;
        height: 240px !important;
    }
    
    header .d-flex.gap-3 {
        flex-direction: column !important;
    }
    
    header .d-flex.gap-3 .btn {
        width: 100% !important;
    }
}

/* =========================================
   PORTFOLIO PRINCE APOVO - CSS RESPONSIVE OPTIMISÉ
   Spécialement adapté pour iPhone SE & Galaxy S8
   ========================================= */

/* =========================================
   1. GLOBAL & RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #fff;
    background-color: #222;
    overflow-x: hidden;
}

main {
    padding: 0;
}

/* =========================================
   2. HEADER - ADAPTATION FLUIDE
   ========================================= */
header {
    background-color: #303030;
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 50px;
}

/* IMAGE DE PROFIL - FLUIDE ET CENTREE */
header .position-relative {
    width: 100%;
    max-width: 370px;
    margin: 0 auto;
}

/* Cercle de fond derrière l'image */
header .position-absolute {
    width: clamp(250px, 70vw, 370px) !important;
    height: clamp(250px, 70vw, 370px) !important;
}

/* Image de profil principale */
header img.img-fluid {
    width: clamp(230px, 65vw, 350px) !important;
    height: clamp(230px, 65vw, 350px) !important;
    max-width: 100% !important;
    object-fit: cover;
}

/* =========================================
   3. TYPOGRAPHIE RESPONSIVE
   ========================================= */
h1, .display-4 {
    font-size: clamp(1.75rem, 6vw, 3.5rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

h2 {
    font-size: clamp(1.4rem, 5vw, 2.5rem) !important;
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.1rem, 4vw, 2rem) !important;
}

h4 {
    font-size: clamp(1rem, 3.5vw, 1.5rem) !important;
}

p, .lead {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem) !important;
    line-height: 1.6;
    word-wrap: break-word;
}

p.small, .small {
    font-size: clamp(0.8rem, 2vw, 0.95rem) !important;
}

/* =========================================
   4. BOUTONS RESPONSIVE
   ========================================= */
.btn {
    padding: clamp(10px, 3vw, 14px) clamp(20px, 5vw, 30px);
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    white-space: nowrap;
    min-height: 44px; /* Taille minimale pour le touch */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lg {
    padding: clamp(12px, 3.5vw, 16px) clamp(24px, 6vw, 35px);
    font-size: clamp(0.9rem, 2.8vw, 1.1rem);
    min-height: 48px;
}

.btn-sm {
    padding: clamp(8px, 2.5vw, 12px) clamp(16px, 4vw, 24px);
    font-size: clamp(0.8rem, 2.2vw, 0.95rem);
    min-height: 40px;
}

/* Icônes dans les boutons */
.btn i {
    font-size: inherit;
}

/* =========================================
   5. ANIMATIONS
   ========================================= */
@keyframes rubber-arrow {
    0% { transform: scale3d(1, 1, 1); }
    30% { transform: scale3d(1.25, 0.75, 1); }
    40% { transform: scale3d(0.75, 1.25, 1); }
    50% { transform: scale3d(1.15, 0.85, 1); }
    65% { transform: scale3d(0.95, 1.05, 1); }
    75% { transform: scale3d(1.05, 0.95, 1); }
    100% { transform: scale3d(1, 1, 1); }
}

.animate-bounce {
    animation: rubber-arrow 2s infinite;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   6. COMPOSANTS - CARDS
   ========================================= */

/* Flip Cards (Compétences) */
.flip-card {
    background-color: transparent;
    width: 100%;
    height: clamp(280px, 40vw, 320px);
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 30px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus .flip-card-inner,
.flip-card:active .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.flip-card-front { 
    color: black; 
    z-index: 2; 
}

.flip-card-back {
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(15px, 4vw, 20px);
}

/* Cards Projets */
.project-img {
    width: 100%;
    height: clamp(180px, 35vw, 250px);
    object-fit: cover;
    object-position: top;
    display: block;
    border-bottom: 2px solid #444;
}

.project-card { 
    margin-bottom: 20px; 
    transition: transform 0.3s ease; 
}

.project-card:hover { 
    transform: translateY(-5px); 
}

/* Reference Cards */
.reference-card { 
    transition: transform 0.3s ease; 
}

.reference-card:hover {
    transform: rotate(1deg) scale(1.02);
    border-color: #333 !important;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.2) !important;
}

/* =========================================
   7. TIMELINE (PARCOURS SCOLAIRE)
   ========================================= */
.main-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #fff;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }

.timeline-item::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    right: -12px;
    background-color: #333;
    border: 4px solid #fff;
    top: 20px;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-item.right::after { left: -12px; }

.timeline-item:hover::after {
    background-color: #00bc8c;
    transform: scale(1.3);
}

.timeline-content {
    padding: clamp(15px, 4vw, 30px) clamp(20px, 5vw, 30px);
    position: relative;
    border-radius: 6px;
    box-shadow: 5px 5px 0px rgba(255,255,255, 0.2) !important;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 5px 5px 0px rgba(255,255,255, 0.4) !important;
}

.date-badge {
    display: inline-block;
    padding: 5px 15px;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    font-weight: bold;
    border-radius: 20px;
    position: absolute;
    top: -15px;
    right: 20px;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    background-color: #00bc8c;
    color: white;
}

/* Flèches Timeline */
.timeline-item.left .timeline-content::before {
    content: " "; 
    height: 0; 
    position: absolute; 
    top: 22px; 
    width: 0; 
    z-index: 1; 
    right: -10px;
    border: medium solid white; 
    border-width: 10px 0 10px 10px; 
    border-color: transparent transparent transparent #fff;
}

.timeline-item.right .timeline-content::before {
    content: " "; 
    height: 0; 
    position: absolute; 
    top: 22px; 
    width: 0; 
    z-index: 1; 
    left: -10px;
    border: medium solid white; 
    border-width: 10px 10px 10px 0; 
    border-color: transparent #fff transparent transparent;
}

/* =========================================
   8. SCROLL INFINI (HOBBIES)
   ========================================= */
.scroll-slider { 
    overflow: hidden; 
    width: 100%; 
    padding: 10px 0; 
    position: relative; 
}

.scroll-track {
    display: flex; 
    width: max-content; 
    gap: clamp(1rem, 4vw, 2rem);
    animation: scroll-left 40s linear infinite;
}

.scroll-track:hover { 
    animation-play-state: paused; 
}

.scroll-card {
    width: clamp(220px, 60vw, 300px); 
    flex-shrink: 0; 
    background-color: #303030;
    border: 1px solid rgba(0, 188, 140, 0.5);
    box-shadow: 0 0 10px rgba(0, 188, 140, 0.1);
    transition: all 0.3s ease;
}

.scroll-card:hover {
    transform: scale(1.02); 
    border-color: #00bc8c; 
    box-shadow: 0 0 20px rgba(0, 188, 140, 0.4);
}

/* =========================================
   9. FOOTER & SOCIAL
   ========================================= */
footer { 
    background-color: #222; 
    padding: 20px;
}

.hover-link { 
    transition: all 0.3s ease; 
}

.hover-link:hover { 
    color: #00bc8c !important; 
    padding-left: 5px; 
}

.social-btn { 
    transition: all 0.3s ease; 
    border-width: 2px;
    margin: 5px;
    width: 48px;
    height: 48px;
}

.social-btn:hover { 
    background-color: white; 
    color: black; 
    transform: translateY(-3px) rotate(5deg); 
}

/* =========================================
   10. BANDEAU COOKIES
   ========================================= */
.cookie-banner {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    z-index: 9999;
    display: none; 
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
    padding: 20px;
}

/* =========================================
   11. SECTIONS - ESPACEMENT
   ========================================= */
section {
    padding: clamp(40px, 8vw, 80px) 15px !important;
}

.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* =========================================
   12. RESPONSIVE - BREAKPOINTS
   ========================================= */

/* --- TABLETTES (Max 991px) --- */
@media screen and (max-width: 991px) {
    header {
        padding: 120px 20px 50px !important;
        text-align: center;
    }

    /* Correction formulaire Chat */
    #community .bg-secondary {
        transform: rotate(0deg) !important;
        margin: 0 15px;
    }
    
    .flip-card {
        height: 280px;
    }
}

/* --- MOBILES (Max 768px) --- */
@media screen and (max-width: 768px) {
    
    /* HEADER MOBILE */
    header {
        padding: 140px 15px 40px !important;
        min-height: auto;
    }

    /* Forcer l'ordre des colonnes */
    header .flex-column-reverse {
        flex-direction: column-reverse !important;
    }

    /* TIMELINE MOBILE : Une seule colonne */
    .main-timeline::after { 
        left: 31px; 
    }
    
    .timeline-item { 
        width: 100%; 
        padding-left: 70px; 
        padding-right: 15px; 
    }
    
    .timeline-item.right { 
        left: 0%; 
    }
    
    .timeline-item.left::after, 
    .timeline-item.right::after { 
        left: 19px; 
    }
    
    .timeline-item.left .timeline-content::before, 
    .timeline-item.right .timeline-content::before { 
        left: -10px; 
        border-width: 10px 10px 10px 0; 
        border-color: transparent #fff transparent transparent; 
    }
    
    .date-badge {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
    }

    /* COOKIES : Empilés verticalement */
    .cookie-banner {
        flex-direction: column; 
        text-align: center; 
        padding: 1.5rem;
    }
    
    .cookie-banner .d-flex {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .cookie-banner .btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* BOUTONS : Stack sur mobile si trop serrés */
    header .d-flex.gap-3 {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    header .d-flex.gap-3 .btn {
        width: 100%;
    }
}

/* --- PETITS MOBILES - iPhone SE / Galaxy S8 (Max 375px) --- */
@media screen and (max-width: 375px) {
    
    /* HEADER : Optimisé pour petits écrans */
    header {
        padding: 130px 10px 30px !important;
    }
    
    /* IMAGE : Taille adaptée */
    header .position-absolute {
        width: 260px !important;
        height: 260px !important;
    }
    
    header img.img-fluid {
        width: 240px !important;
        height: 240px !important;
    }
    
    /* TEXTES : Plus compacts */
    h1, .display-4 {
        font-size: 1.6rem !important;
        margin-bottom: 0.8rem;
    }
    
    p.lead {
        font-size: 0.9rem !important;
        padding: 0 10px;
    }
    
    /* BOUTONS : Ajustés */
    .btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 0.9rem;
    }
    
    /* CARDS : Hauteur réduite */
    .flip-card {
        height: 260px;
        margin-bottom: 20px;
    }
    
    /* PROJETS : Images plus petites */
    .project-img {
        height: 180px;
    }
    
    /* TIMELINE : Plus compacte */
    .timeline-item {
        padding-left: 60px;
        padding-right: 10px;
    }
    
    .timeline-content {
        padding: 12px 15px;
    }
    
    /* SCROLL CARDS : Plus petites */
    .scroll-card {
        width: 220px;
    }
    
    /* FOOTER : Compact */
    footer {
        padding: 15px 10px;
    }
    
    .social-btn {
        width: 44px;
        height: 44px;
    }
    
    /* SECTIONS : Moins d'espacement */
    section {
        padding: 35px 10px !important;
    }
}

@media screen and (max-width: 768px) {
    header .d-flex.gap-3.flex-wrap {
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 15px !important;
    }
    
    header .d-flex.gap-3 > a.btn {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    header .col-lg-7 {
        overflow: visible !important;
    }
}

/* --- TRÈS PETITS ÉCRANS - Galaxy Fold (Max 360px) --- */
@media screen and (max-width: 360px) {
    
    header {
        padding: 120px 8px 25px !important;
    }
    
    /* IMAGE : Encore plus petite */
    header .position-absolute {
        width: 240px !important;
        height: 240px !important;
    }
    
    header img.img-fluid {
        width: 220px !important;
        height: 220px !important;
    }
    
    h1, .display-4 {
        font-size: 1.4rem !important;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    
    .scroll-card {
        width: 200px;
    }
    
    .project-img {
        height: 160px;
    }
    
    /* Badge plus petit */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* =========================================
   13. OPTIMISATIONS PERFORMANCES
   ========================================= */

/* Réduction des animations  */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Amélioration contraste */
@media (prefers-contrast: high) {
    .timeline-content {
        border: 2px solid #fff;
    }
    
    .flip-card-front,
    .flip-card-back {
        border: 2px solid #fff;
    }
}

/* =========================================
   14. CORRECTIFS SPÉCIFIQUES
   ========================================= */

/* Éviter débordement du texte */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Éviter scroll horizontal */
body {
    max-width: 100vw;
    overflow-x: hidden;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Images responsives par défaut */
img {
    max-width: 100%;
    height: auto;
}

/* Badges responsive */
.badge {
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    padding: clamp(0.25rem, 1vw, 0.5rem) clamp(0.5rem, 2vw, 1rem);
    white-space: nowrap;
}

/* Progress bars responsive */
.progress {
    height: clamp(4px, 1.5vw, 6px);
}