/* 
   --------------------------------------------------------------
   STYLE INDEX - Yacine Sehli Portfolio
   --------------------------------------------------------------
   Requires: Tailwind CSS pre-loaded
   Focus: Animations, Typography overrides, Advanced Components
   --------------------------------------------------------------
*/

:root {
    --color-primary: #1e40af; /* Royal Blue */
    --color-accent: #6b21a8; /* Royal Lavender */
    --color-text: #0f172a; /* Deep Ocean */
}

.dark:root {
    --color-primary: #84cc16; /* Lime Green */
    --color-accent: #3f6212; /* Moss Green */
    --color-text: #fffff0; /* Ivory Standard */
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #1e40af, #6b21a8);
    border-radius: 6px;
    border: 3px solid #f1f5f9;
}

.dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #84cc16, #3f6212);
    border: 3px solid #0f172a;
}

::-webkit-scrollbar-thumb:hover {
    background: #4338ca;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #65a30d;
}

/* --- General Typography Utilities --- */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

.text-justify {
    text-align: justify;
    text-justify: inter-word;
}

/* --- Animation Classes --- */

/* Pulse Slow */
@keyframes pulseSlow {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.1);
    }
}

.animate-pulse-slow {
    animation: pulseSlow 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade In Up */
.fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Reveal on Scroll Class (controlled by JS) */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Button Styles */
.btn-primary {
    background-image: linear-gradient(135deg, #1e40af 0%, #6b21a8 100%);
    color: white;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary:hover {
    background-image: linear-gradient(135deg, #1e3a8a 0%, #581c87 100%);
    box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.3);
}

.dark .btn-primary {
    background-image: linear-gradient(135deg, #84cc16 0%, #3f6212 100%);
    color: #0f172a;
}

.dark .btn-primary:hover {
    background-image: linear-gradient(135deg, #a3e635 0%, #4d7c0f 100%);
    box-shadow: 0 10px 15px -3px rgba(132, 204, 22, 0.3);
}

/* Navigation Links */
.nav-link {
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #6b21a8;
    transition: width 0.3s ease;
}

.dark .nav-link::after {
    background-color: #84cc16;
}

.nav-link:hover::after {
    width: 100%;
}

/* Perspective Container for Hero Image */
.perspective-container {
    perspective: 1000px;
}

/* Background Grid Pattern */
.bg-grid-pattern {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(30, 64, 175, 0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(30, 64, 175, 0.05) 1px, transparent 1px);
}
.dark .bg-grid-pattern {
    background-image: linear-gradient(to right, rgba(132, 204, 22, 0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(132, 204, 22, 0.05) 1px, transparent 1px);
}

/* Skill Tags */
.skill-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #e0f2fe;
    color: #1e40af;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #bfdbfe;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .skill-tag {
    background-color: #1f2937;
    color: #84cc16;
    border-color: #374151;
}

/* Cert Card Hover Effects */
.cert-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cert-card:hover {
    transform: translateY(-5px);
}

/* Loading Animation */
.loading-bar {
    width: 0;
    animation: loadBar 1.5s ease-in-out forwards;
}

@keyframes loadBar {
    0% { width: 0; }
    100% { width: 100px; }
}

/* Form Styling */
input:focus, textarea:focus {
    box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.5);
}

/* Contact Section Background */
#contact {
    overflow: hidden;
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Additional specific overrides to guarantee extensive CSS */
.section-title {
    position: relative;
    display: inline-block;
}

/* Hover Card Effect */
.hover-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hover-card:hover {
    transform: scale(1.02);
}

/* 3D Float Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating-icon {
    animation: float 4s ease-in-out infinite;
}

/* Timeline Customization */
.timeline-dot {
    box-shadow: 0 0 0 4px #fff;
}
.dark .timeline-dot {
    box-shadow: 0 0 0 4px #1f2937;
}

/* Ensure images cover */
img {
    max-width: 100%;
}
.project-detail {
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.project-detail {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

/* Premiere modification */
/* Infinite Marquee Animation */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Gradients pour cacher les bords */
.mask-gradient {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* STOP les transitions pendant le changement de thème */
.disable-transitions * {
    transition: none !important;
}

/* Infinite Marquee Animation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.animate-marquee {
    animation: marquee 20s linear infinite;
}