/* ============================================
   assets/css/style.css — Styles personnalisés
   ============================================ */

/* --- Reset & Base --- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: auto;
}

/* --- Transition mode sombre --- */
body, nav, section, footer, div, p, h1, h2, h3, h4, span, a {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.sidebar {
    transition: transform .3s ease;
    overflow-y: hidden !important;
}

.sidebar.open {
    transform: translateX(0);
}

/* --- Animations d'apparition --- */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Délais pour les animations en cascade */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* --- Hero --- */
.hero-gradient {
    background: linear-gradient(135deg, #7a6951 0%, #b1a697 40%, #685c4b 100%) !important;
}

.dark .hero-gradient {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%) !important;
}

.hero-pattern {
    background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
                       radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%),
                       radial-gradient(circle at 40% 80%, rgba(255,255,255,0.03) 0%, transparent 40%);
}

/* --- Avatar --- */
.avatar-ring {
    background: conic-gradient(from 0deg, #8a8175, #685c4b, #beaa8d);
    padding: 4px;
    border-radius: 50%;
}

.avatar-ring img {
    border-radius: 50%;
    border: 4px solid white;
}

/* --- Cartes --- */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.dark .card-hover:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* --- Portfolio lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active img {
    transform: scale(1);
}

/* --- Bouton retour en haut --- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0D9488;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(13,148,136,0.4);
}

.scroll-top.show {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top:hover {
    background: #0F766E;
}

/* --- Section titre --- */
.section-line {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #0D9488, #d94906);
}

/* --- Nav active link --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0D9488;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- Skill bar animation --- */
.skill-icon {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.skill-icon:hover {
    transform: scale(1.1);
}

/* --- Portfolio filter button --- */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #0D9488;
    color: white;
}

/* --- Portfolio item --- */
.portfolio-item {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.portfolio-item.hidden-item {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

/* --- Formulaire focus --- */
.form-field {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field:focus {
    border-color: #0D9488;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}

/* --- Loading spinner --- */
.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Testimonial card --- */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    font-family: Georgia, serif;
    color: #0D9488;
    opacity: 0.15;
    line-height: 1;
}

.dark .testimonial-card::before {
    color: #5EEAD4;
}

/* --- Mobile menu --- */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.mobile-menu.open {
    max-height: 400px;
}

/* --- Star rating --- */
.star-rating i {
    transition: transform 0.2s ease;
}

.star-rating:hover i {
    transform: scale(1.1);
}

/* --- Pulse animation for CTA --- */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: pulse-ring 2s ease-out infinite;
    z-index: -1;
}