/* Frontend */

html {
    scroll-behavior: smooth;
}

.cyber-border {
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.matrix-bg {
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.code-rain {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: rgba(0, 212, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
}

/* Centrage pour toutes les sections */
#experiences, #formations, #competences, #projets, #contact {
    margin-left: 320px;
    padding: 3rem;
    width: calc(100% - 320px);
    box-sizing: border-box;
}

#experiences .max-w-6xl,
#formations .max-w-6xl,
#competences .max-w-6xl,
#projets .max-w-6xl,
#contact .max-w-6xl {
    margin-left: auto;
    margin-right: auto;
}

/* Arrière-plan sombre */
.bg-dark {
    background: linear-gradient(135deg, #0d1929 0%, #1a2332 50%, #0d1929 100%);
}

/* Responsive Mobile */
@media (max-width: 768px) {
    /* Masquer la sidebar par défaut sur mobile */
    aside {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1050;
    }
    
    /* Afficher la sidebar quand elle est active */
    aside.active {
        transform: translateX(0);
    }
    
    /* Ajuster le contenu principal */
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: 0 !important;
    }
    
    /* Ajuster les sections */
    #experiences, #formations, #competences, #projets, #contact {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem !important;
    }
    
    /* Ajustements des titres */
    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
    }
    
    /* Ajustements des textes de contenu */
    p, .text-lg {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
    
    .text-sm {
        font-size: 0.85rem !important;
    }
    
    .text-xs {
        font-size: 0.75rem !important;
    }
    
    /* Ajustements des icônes */
    .fas, .fab {
        font-size: 1rem !important;
    }
    
    /* Icônes dans les cartes */
    .w-16.h-16 i {
        font-size: 1.5rem !important;
    }
    
    .w-8.h-8 i {
        font-size: 0.9rem !important;
    }
    
    /* Ajustements des grilles */
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .md\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    /* Ajustements des espacements */
    .space-y-12 > * + * {
        margin-top: 2rem !important;
    }
    
    .space-y-6 > * + * {
        margin-top: 1rem !important;
    }
    
    .gap-6 {
        gap: 1rem !important;
    }
    
    .gap-8 {
        gap: 1.5rem !important;
    }
    
    /* Ajustements des paddings */
    .p-12 {
        padding: 1.5rem !important;
    }
    
    .p-8 {
        padding: 1rem !important;
    }
    
    .p-6 {
        padding: 0.75rem !important;
    }
    
    /* Ajustements des marges */
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    .mb-12 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    /* Ajustements des images de profil */
    .w-32.h-32 {
        width: 6rem !important;
        height: 6rem !important;
    }
    
    /* Ajustements des boutons et liens */
    .rounded-2xl, .rounded-3xl {
        border-radius: 1rem !important;
    }
    
    /* Ajustements des cartes d'expérience/formation */
    .lg\:col-span-2 {
        grid-column: span 1 / span 1 !important;
    }
    
    /* Overlay fermer la sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 320px;
        width: calc(100% - 320px);
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Bouton hamburger */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1060;
    background: rgba(13, 25, 43, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.5);
}

.hamburger span {
    display: block;
    width: 1.5rem;
    height: 2px;
    background: #00d4ff;
    margin: 4px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    
    .nav-link {
        position: relative;
        z-index: 1051;
        pointer-events: auto;
    }

    nav {
        position: relative;
        z-index: 1051;
    }
}

/* Responsive pour très petits écrans */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    .p-12 {
        padding: 1rem !important;
    }
    
    .p-8 {
        padding: 0.75rem !important;
    }
    
    .p-6 {
        padding: 0.5rem !important;
    }
    
    /* Ajustements des sections */
    #experiences, #formations, #competences, #projets, #contact {
        padding: 0.75rem !important;
    }
    
    /* Réduction des marges */
    .mb-16 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-12 {
        margin-bottom: 1rem !important;
    }
    
    /* Ajustements des cartes de contact - garder en ligne */
    .flex.justify-center.space-x-6 {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.75rem !important;
        flex-wrap: wrap !important;
    }
    
    .flex.justify-center.space-x-6 > * {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    
    /* Ajustements des icônes sociales */
    .cyber-border.rounded-2xl.p-4 {
        padding: 0.75rem !important;
    }
    
    /* Amélioration de la lisibilité des textes longs */
    .font-mono {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* Ajustements des éléments de timeline */
    .space-y-12 > * + * {
        margin-top: 1.5rem !important;
    }
}

/* Responsive générale */
@media (max-width: 768px) {
    .text-primary\/60 {
        color: rgba(0, 212, 255, 0.8) !important;
    }
    
    .text-primary\/70 {
        color: rgba(0, 212, 255, 0.85) !important;
    }
    
    .text-primary\/80 {
        color: rgba(0, 212, 255, 0.9) !important;
    }
    
    /* Amélioration des bordures cyber */
    .cyber-border {
        border-width: 1.5px !important;
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.15) !important;
    }
    
    /* Ajustements des animations */
    .animate-pulse {
        animation-duration: 3s !important;
    }
    
    .animate-spin {
        animation-duration: 20s !important;
    }
    
    .nav-link {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Ajustements formulaires de contact */
    input, textarea, button {
        min-height: 44px !important;
        font-size: 16px !important;
    }
    
    /* Correction spécifique pour les icônes sociales */
    .flex.justify-center.space-x-6 {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-direction: row !important;
        gap: 1rem !important;
        margin: 0 !important;
    }
    
    .flex.justify-center.space-x-6 a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
}

/* Bouton Retour */
.scroll-to-top {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-top.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    animation: pulse-glow 3s ease-in-out infinite;
}

.scroll-to-top:hover {
    box-shadow: 
        0 0 30px rgba(64, 224, 208, 0.5), 
        0 0 60px rgba(64, 224, 208, 0.3),
        inset 0 0 20px rgba(64, 224, 208, 0.1);
}

.scroll-to-top:active {
    transform: scale(0.95) translateY(0) !important;
}

/* Animation de pulsation pour le bouton */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(64, 224, 208, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(64, 224, 208, 0.6);
    }
}

/* Responsive pour le bouton */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 3.5rem !important;
        height: 3.5rem !important;
        bottom: 1.5rem !important;
        right: 1.5rem !important;
    }
    
    .scroll-to-top .w-8 {
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
    
    .scroll-to-top i {
        font-size: 1rem !important;
    }
}

/* Effet curseur terminal clignotant */
.terminal-cursor {
    animation: blink 1s infinite;
    color: rgb(0 153 204 / var(--tw-text-opacity, 1));
    font-weight:bold;
    font-size: 30px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}