/* ============================================
   Portfolio Raphaël FRANCO - Custom Styles
   ============================================ */

/* Base Styles */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --hover-color: #cccccc;
    --transition-speed: 0.4s;
    --project-card-height: 300px; /* Fixed height for aspect-ratio calculation */
}

* {
    box-sizing: border-box;
}

/* Body Reset */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Montserrat', 'Helvetica', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    line-height: 1.6;
    padding-top: 80px;
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Scroll margin for navigation */
section[id] {
    scroll-margin-top: 80px;
}

/* ============================================
   Header & Navigation
   ============================================ */

.fixed-top {
    background-color: var(--bg-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    will-change: transform;
    transform: translateZ(0);
}

.navbar {
    padding: 0.5rem 1rem;
    min-height: 80px;
}

.navbar-brand {
    padding: 0;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.navbar-toggler {
    border: none;
    outline: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-nav .nav-link {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 400;
    padding: 0.5rem 1rem;
    transition: color var(--transition-speed) ease;
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transition: transform var(--transition-speed) ease;
}

.navbar-nav .nav-link:hover {
    color: var(--hover-color);
}

.navbar-nav .nav-link:hover::after {
    transform: scaleX(1);
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 0;
    margin-top: 0;
    min-height: calc(100vh - 80px);
}

.title-container {
    padding: 2rem 0;
}

.main-title {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: 0.1em;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    letter-spacing: 0.2em;
}

/* Reduce title and subtitle font sizes by 15% */
@media (min-width: 0px) {
    .main-title { font-size: calc(clamp(2.5rem, 8vw, 6rem) * 0.85); }
    .subtitle { font-size: calc(clamp(1.2rem, 3vw, 2rem) * 0.85); }
}

/* Showreel Container */
.showreel-container {
    margin-top: 1rem;
    margin-bottom: 4rem;
}

.video-wrapper {
    position: relative;
    max-width: 1100px;
    width: 90%;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background-color: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.showreel-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

/* ============================================
   Projects Section
   ============================================ */

.projects-section {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 2rem 0 4rem;
}

/* Filter Menu */
.filter-menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.btn-filter {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 0;
    transition: all var(--transition-speed) ease;
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
}

.btn-filter:hover {
    color: var(--hover-color);
}

.btn-filter.active {
    color: var(--text-color);
    font-weight: 600;
    transform: scale(1.05);
}

.btn-filter:focus {
    outline: none;
    box-shadow: none;
}

/* Projects Grid - Custom CSS Grid for smooth animations */
.projects-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
    margin: 0 auto;
    max-width: 1400px;
}

.project-item-wrapper {
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.project-item-wrapper.hidden {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
    /* Pas de max-height: 0 pour permettre le repositionnement */
}

.project-card {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #111;
    width: 100%;
    height: 100%;
}

.project-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.95));
    padding: 1.5rem;
    color: var(--text-color);
    transition: bottom 0.3s ease;
    opacity: 0;
}

.project-card:hover .project-overlay {
    bottom: 0;
    opacity: 1;
}

.project-overlay h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.project-overlay p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.project-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-bottom: 0;
}

/* ============================================
   About Section
   ============================================ */

.about-section {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 6rem 0 4rem;
}

.about-photo {
    max-height: 500px;
    width: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
}

.about-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.about-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.contact-info {
    margin-top: 2rem;
}

.contact-item {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contact-item i {
    font-size: 1.2rem;
    color: var(--hover-color);
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
    word-break: break-all;
}

.contact-link:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.btn-download-cv {
    background-color: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-download-cv:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.btn-download-cv i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: var(--bg-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 2rem 0;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 1400px) {
    .projects-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .projects-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .projects-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-filter {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .project-card {
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
    }

    .project-img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .project-overlay {
        position: static;
        bottom: auto;
        left: auto;
        right: auto;
        background: #111;
        opacity: 1;
        transition: none;
        padding: 1rem;
    }

    .project-card:hover .project-overlay {
        bottom: auto;
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .navbar {
        min-height: 60px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    section[id] {
        scroll-margin-top: 60px;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .video-wrapper {
        aspect-ratio: 16/9;
    }
    
    .showreel-container {
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .hero-section {
        margin-top: 60px;
    }
    
    .projects-grid-container {
        grid-template-columns: repeat(1, 1fr);
        gap: 0.75rem;
    }

    .project-card {
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
    }

    .project-img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .project-overlay {
        position: static;
        bottom: auto;
        left: auto;
        right: auto;
        background: #111;
        opacity: 1;
        transition: none;
        padding: 1rem;
    }

    .project-card:hover .project-overlay {
        bottom: auto;
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .navbar {
        min-height: 56px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    section[id] {
        scroll-margin-top: 56px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .filter-menu {
        gap: 0.25rem;
    }
    
    .btn-filter {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-section {
        margin-top: 56px;
    }
    
    .projects-grid-container {
        grid-template-columns: repeat(1, 1fr);
        gap: 0.5rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-white {
    color: var(--text-color) !important;
}

.bg-black {
    background-color: var(--bg-color) !important;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}
