:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --accent-primary: #64ffda;
    --accent-secondary: #00bfa5;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --nav-height: 80px;
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: linear-gradient(to bottom, rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.95)),
                    url('../assets/images/bg-pattern.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}



.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 50px;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 50px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 50px;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-primary);
    transition: var(--transition);
}

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

.hero {
    min-height: 100vh;
    padding-top: var(--nav-height);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text {
    z-index: 2;
}

.hero-image img {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    animation: float 6s ease-in-out infinite;
}

.hero-subtitle {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--accent-primary);
    background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(100, 255, 218, 0.2);
}

/* Section Spacing */


/* Section Titles */
.section {
    padding: 100px 0;
    margin: 0 auto;
    max-width: 1200px;
    width: 90%;
}

/* Section Titles */
.section h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2rem;
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: turquoise;
    margin: 1rem auto;
    border-radius: 2px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: turquoise;
    margin: 1rem auto;
    border-radius: 2px;
}

/* Skills Grid */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(100, 255, 218, 0.1);
}

.skill-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-card ul {
    list-style: none;
}

.skill-card li {
    color: var(--text-secondary);
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.skill-card li::before {
    content: '▹';
    color: var(--accent-primary);
    margin-right: 1rem;
}

/* Projects Section */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
/* 1. Main card container: Handles 3D space, hover effect, and dimensions. */
.project-card-container {
    background-color: transparent;
    height: 600px; /* Adjust height to fit your content */
    perspective: 1200px;
    cursor: pointer;
    transition: var(--transition);
}


/* 2. Inner element: Performs the actual flip animation. */
.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d; /* <--- CORRECTED LINE */
}

/* 3. Flipped state: Rotates the inner element when the container has the 'is-flipped' class. */
.project-card-container.is-flipped .project-card-inner {
    transform: rotateY(180deg);
}

/* 4. Common styles for both front and back faces. */
.project-card-front, .project-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Prevents flickering in Safari */
    backface-visibility: hidden;
    
    /* Applying your original card styles */
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    
    /* Added for better content alignment */
    display: flex;
    flex-direction: column;
}

/* 5. Styles specific to the back face. */
.project-card-back {
    transform: rotateY(180deg);
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 1rem; /* Less padding to maximize image size */
}

.project-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Add this new rule right below it */
.project-card-back video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the video fill the space nicely */
    border-radius: 8px;
}

/* Find the existing rules for img and video */
.project-card-back img,
.project-card-back video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This remains the default */
    border-radius: 8px;
}

/* ADD THIS NEW RULE for our special mockup cards */
.project-card-back.media-contain img,
.project-card-back.media-contain video {
    object-fit: contain; /* This overrides the default for mockups */
    /* Optional: Add some padding if the mockup touches the edges */
    width: 90%;
    height: 90%;
}
.project-card-back .view-prompt {
    position: absolute;
    bottom: 15px;
    font-size: 0.8rem;
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 5px;
}

/* 6. Styles for the front face content (adapted from your original .project-card). */
.project-card-front h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.project-card-front .project-year {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-card-front .project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-card-front .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: auto; /* Pushes this to the bottom */
}

.tech-tag {
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.project-card-front .project-highlights {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
    flex-grow: 1;       /* Allows the list to expand and fill space */
    overflow-y: auto;   /* Adds a scrollbar ONLY when content overflows */
    min-height: 0;      /* Important for flexbox overflow behavior */
}

.project-card-front .project-highlights li {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    padding-left: 1.5rem;
    position: relative;
}

.project-card-front .project-highlights li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}
/* Custom Scrollbar Styling */
.project-card-front .project-highlights::-webkit-scrollbar {
  width: 8px;
}

.project-card-front .project-highlights::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.project-card-front .project-highlights::-webkit-scrollbar-thumb {
  background-color: var(--accent-primary);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0); /* Creates a little padding */
  background-clip: content-box;
}

.project-card-front .project-highlights::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-secondary);
}

.project-card-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(100, 255, 218, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(100, 255, 218, 0.1);
}

.project-card h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.project-year {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.project-links a:hover {
    color: var(--accent-primary);
}

/* Contact Container Spacing */
.contact-container {
    margin-top: 3rem;
    padding: 0 2rem;
}

.contact-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .main-container {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 3rem;
    }

    .project-card,
    .skill-card {
        padding: 1.5rem;
    }
}
 
@media (max-width: 768px) {
    /* Hero Section Mobile */
  .hero-content {
        display: flex;
        flex-direction: column-reverse; /* image puis texte */
        align-items: center; /* centre tout horizontalement */
        padding: 20px;
        gap: 1rem;
        text-align: center; /* centre le texte */
    }
    
    .hero-image {
        width: 240px;
        height: 240px;
        border-radius: 50%;
        border: 3px solid var(--accent-primary);
        overflow: hidden;
         display: flex;
        justify-content: center;
        align-items: center;
     }

    .hero-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;   /* ✅ garde l’image entière sans zoom */
        display: block;
    }




    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 5px;
        justify-content: center;
        padding-left: -10px; /* Ajoute un padding à gauche pour le texte */
    }
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin: 10px 27px 5px 0;
        width: auto; /* Ajustez la largeur selon vos besoins */
    }

    .typing-text {
        font-size: 1.1rem;
        line-height: 1.4;
        margin: 10px 30px 5px 0;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.4;
        margin: 10px 30px 5px 0;
        max-width: 100%;}
 
    
    .hero-buttons {
        display: flex;
        gap: 12px;
        margin-top: 15px;
        margin-left: -20px; /* Ajoute un padding à gauche pour les boutons */
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
         width: 170px;
    }
   
}

/* Ajustements pour très petits écrans */
@media screen and (max-width: 300px) {
    .hero-title {
        font-size: 1.5rem;
        padding-left: -1px; /* Ajoute un padding à gauche pour le texte */

    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 80%;
        margin: 5px 0;
    }
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 10px 20px;
    border-radius: 5px;
}

.filter-btn.active,
.filter-btn:hover {
    color: var(--accent-primary);
    background: rgba(100, 255, 218, 0.1);
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-content {
    padding: 30px;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.1rem;
}

.contact-info-item i {
    color: var(--accent-primary);
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.contact-info-item span {
    color: var(--text-secondary);
    font-size: 1rem;
}

.contact-info-item span a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info-item span a:hover {
    color: var(--accent-primary);
}

.contact-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

input,
textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
}

textarea {
    height: 150px;
    resize: vertical;
}

/* Contact Form */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.2);
}

.form-error {
    color: #ff6b6b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ff6b6b;
}

.form-group.error .form-error {
    display: block;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading .btn-text {
    visibility: hidden;
}

.btn.loading .btn-loader {
    display: inline-block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Success Message */
.success-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 1rem 2rem;
    border-radius: 5px;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.success-message.show {
    transform: translateY(0);
    opacity: 1;
}

/* Contact Section Styles */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    height: 100%;
}

.contact-card h3 {
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.contact-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(100, 255, 218, 0.2);
}

.contact-item i {
    color: var(--accent-primary);
    font-size: 1.8rem;
    margin-top: 0.25rem;
}

.contact-text h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.contact-text a,
.contact-text p {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 1rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

.social-link i {
    font-size: 1.2rem;
}

/* Responsive Design for Contact Section */
@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        margin-bottom: 2rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        padding: 0 30px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-image img {
        width: 300px;
        height: 300px;
        margin: 0 auto;
    }
    
    .nav {
        padding: 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    .section-title.h2 {
      margin-bottom: 3rem;  
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .contact-form {
        padding: 20px;
    }
}
