/* Portfolio Page Styles - Ultimate Modern Design */

/* Hero Portfolio avec parallax et animations */
.portfolio-header {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px; /* Espace pour navbar fixe */
    padding-bottom: var(--space-16); /* Séparation avec les filtres */
    background: 
        radial-gradient(circle at top left, rgba(214, 148, 86, 0.15) 0%, transparent 30%),
        radial-gradient(circle at bottom right, rgba(109, 59, 7, 0.08) 0%, transparent 40%),
        linear-gradient(135deg, 
            rgba(248, 246, 240, 0.95) 0%, 
            rgba(255, 202, 153, 0.05) 30%,
            rgba(255, 255, 255, 0.98) 70%,
            rgba(214, 148, 86, 0.08) 100%
        );
    overflow: hidden;
    backdrop-filter: blur(1px);
    border-bottom: 1px solid rgba(214, 148, 86, 0.15);
}

/* Animated background elements */
.portfolio-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle, rgba(214, 148, 86, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: float-pattern 20s ease-in-out infinite;
    z-index: 1;
}

.portfolio-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(214, 148, 86, 0.02) 50%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(109, 59, 7, 0.02) 50%, transparent 51%);
    background-size: 120px 120px;
    animation: slide-pattern 15s linear infinite;
    z-index: 1;
}

@keyframes float-pattern {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -20px) rotate(1deg); }
    50% { transform: translate(-10px, 10px) rotate(-0.5deg); }
    75% { transform: translate(15px, 5px) rotate(0.8deg); }
}

@keyframes slide-pattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(120px, 120px); }
}

.portfolio-hero {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-8);
}

/* Mega title avec effets typographiques */
.portfolio-title {
    font-size: clamp(4.5rem, 12vw, 8rem);
    font-weight: 900;
    color: var(--color-primary);
    margin-bottom: var(--space-8);
    font-family: var(--font-display);
    letter-spacing: -0.04em;
    line-height: 0.9;
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        var(--color-gold) 30%,
        var(--color-bronze) 70%,
        var(--color-primary) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradient-shift 4s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

.portfolio-title::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, 
        rgba(214, 148, 86, 0.1) 0%, 
        rgba(109, 59, 7, 0.05) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: -1;
    transform: translate(4px, 4px);
    filter: blur(1px);
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.portfolio-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-gray-700);
    margin-bottom: var(--space-16);
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    letter-spacing: 0.01em;
    position: relative;
    animation: fade-up 0.6s ease-out 0.2s both;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats modernes avec glassmorphism */
.category-overview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-16);
    align-items: center;
    justify-content: center;
    margin-top: var(--space-12);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    animation: fade-up 0.5s ease-out 0.3s both;
}

.total-projects {
    position: relative;
    text-align: center;
    padding: var(--space-card-padding) var(--space-10);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 202, 153, 0.15) 30%,
        rgba(255, 255, 255, 0.9) 70%,
        rgba(214, 148, 86, 0.1) 100%
    );
    backdrop-filter: blur(1px); /* Reduced from 4px for better content visibility */
    border-radius: 2rem;
    border: 1px solid rgba(214, 148, 86, 0.15);
    box-shadow: 0 4px 12px rgba(109, 59, 7, 0.06); /* Much cleaner shadow */
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-width: 220px;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.total-projects::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, 
        rgba(214, 148, 86, 0.6) 0%, 
        rgba(255, 202, 153, 0.4) 25%,
        rgba(109, 59, 7, 0.5) 50%,
        rgba(214, 148, 86, 0.6) 75%,
        rgba(255, 202, 153, 0.4) 100%
    );
    border-radius: 2rem;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: rotate-border 3s linear infinite;
}

.total-projects:hover::before {
    opacity: 1;
}

.total-projects:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(109, 59, 7, 0.12),
        0 12px 24px rgba(214, 148, 86, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@keyframes rotate-border {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.big-number {
    display: block;
    font-size: clamp(4rem, 8vw, 6rem);
    font-weight: 900;
    background: linear-gradient(135deg, 
        var(--color-gold) 0%, 
        var(--color-bronze) 50%,
        var(--color-primary) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-display);
    line-height: 0.9;
    margin-bottom: 0.5rem;
    animation: number-pulse 2s ease-in-out infinite;
}

@keyframes number-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.label {
    display: block;
    font-size: 0.95rem;
    color: var(--color-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    font-family: var(--font-display);
}

.category-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-6);
    width: 100%;
}

.category-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-8) var(--space-6);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 202, 153, 0.08) 30%,
        rgba(255, 255, 255, 0.85) 70%,
        rgba(214, 148, 86, 0.06) 100%
    );
    backdrop-filter: blur(1px); /* Clean, minimal blur */
    border-radius: 1.5rem;
    border: 1px solid rgba(214, 148, 86, 0.18);
    box-shadow: 
        0 8px 24px rgba(109, 59, 7, 0.08),
        0 4px 12px rgba(214, 148, 86, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    overflow: hidden;
}

.category-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(214, 148, 86, 0.1), 
        transparent
    );
    transition: left 0.6s ease;
}

.category-stat:hover::before {
    left: 100%;
}

.category-stat:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(109, 59, 7, 0.1),
        0 8px 16px rgba(214, 148, 86, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: rgba(214, 148, 86, 0.25);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-gold);
    filter: drop-shadow(0 2px 4px rgba(214, 148, 86, 0.3));
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    font-family: var(--font-display);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    font-weight: 600;
    font-family: var(--font-display);
}

/* Système de filtres ultra-moderne */
.portfolio-filters {
    padding: var(--space-section-xl) 0 var(--space-section-lg) 0;
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.98) 0%, 
            rgba(248, 246, 240, 0.95) 50%,
            rgba(255, 255, 255, 0.98) 100%
        );
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-8);
    border-bottom: 1px solid rgba(214, 148, 86, 0.15);
}

.portfolio-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(214, 148, 86, 0.3) 20%,
        rgba(109, 59, 7, 0.2) 50%,
        rgba(214, 148, 86, 0.3) 80%,
        transparent 100%
    );
}

.portfolio-filters::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(214, 148, 86, 0.2) 50%, 
        transparent 100%
    );
}

.filters-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.filters-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        var(--color-gold) 50%,
        var(--color-bronze) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-display);
    margin-bottom: var(--space-12);
    letter-spacing: -0.02em;
    position: relative;
}

.filters-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--color-gold) 0%, 
        var(--color-bronze) 100%
    );
    border-radius: 2px;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    flex-wrap: wrap;
    position: relative;
}

.filter-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-button-padding-y) var(--space-button-padding-x);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 202, 153, 0.05) 30%,
        rgba(255, 255, 255, 0.85) 70%,
        rgba(214, 148, 86, 0.08) 100%
    );
    backdrop-filter: blur(2px); /* Reduced for better content visibility */
    color: var(--color-gray-700);
    text-decoration: none;
    border-radius: 2rem;
    border: 1px solid rgba(214, 148, 86, 0.2);
    font-weight: 600;
    font-family: var(--font-display);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    cursor: pointer;
    will-change: transform, box-shadow;
    box-shadow: 
        0 4px 16px rgba(109, 59, 7, 0.06),
        0 2px 8px rgba(214, 148, 86, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(214, 148, 86, 0.15) 25%,
        rgba(255, 202, 153, 0.1) 50%,
        rgba(214, 148, 86, 0.15) 75%,
        transparent 100%
    );
    transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.filter-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(214, 148, 86, 0.1) 0%, 
        rgba(255, 202, 153, 0.08) 50%,
        rgba(109, 59, 7, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
}

.filter-btn > * {
    position: relative;
    z-index: 2;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover::after {
    opacity: 1;
}

.filter-btn:hover {
    transform: translateY(-6px) scale(1.03);
    color: var(--color-primary);
    border-color: rgba(214, 148, 86, 0.25);
    box-shadow: 
        0 12px 32px rgba(109, 59, 7, 0.08),
        0 6px 16px rgba(214, 148, 86, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.filter-btn.active {
    background: linear-gradient(135deg, 
        var(--color-gold) 0%, 
        rgba(214, 148, 86, 0.95) 30%,
        var(--color-bronze) 70%,
        var(--color-primary) 100%
    );
    color: var(--color-white);
    border-color: var(--color-gold);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 16px 40px rgba(109, 59, 7, 0.15),
        0 8px 20px rgba(214, 148, 86, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.filter-btn.active::before,
.filter-btn.active::after {
    display: none;
}

.filter-btn.active:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 
        0 20px 50px rgba(109, 59, 7, 0.2),
        0 10px 25px rgba(214, 148, 86, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.filter-icon {
    font-size: 1.2rem;
}

.filter-text {
    font-weight: 500;
}

.filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Section projets avec fond dynamique */
.portfolio-projects {
    padding: var(--space-section-md) 0 var(--space-section-xl) 0;
    background: 
        radial-gradient(circle at top right, rgba(214, 148, 86, 0.08) 0%, transparent 50%),
        radial-gradient(circle at bottom left, rgba(109, 59, 7, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, 
            rgba(248, 246, 240, 0.3) 0%, 
            rgba(255, 255, 255, 0.95) 30%,
            rgba(248, 246, 240, 0.8) 70%,
            rgba(255, 202, 153, 0.1) 100%
        );
    position: relative;
    min-height: 100vh;
}

.portfolio-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(214, 148, 86, 0.01) 50%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(109, 59, 7, 0.01) 50%, transparent 51%);
    background-size: 200px 200px;
    animation: subtle-move 30s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes subtle-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(200px, 200px); }
}

.portfolio-projects .container {
    position: relative;
    z-index: 2;
}

.projects-grid.modern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-grid-gap);
    margin-bottom: var(--space-24);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch; /* Ensure all cards stretch to same height */
    justify-items: stretch; /* Ensure all cards stretch to same width */
}

/* Glassmorphism Project Cards - Visibilité améliorée */
.project-card.enhanced {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 600px; /* Fixed height for consistent sizing */
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 202, 153, 0.15) 30%, 
        rgba(255, 255, 255, 0.92) 70%, 
        rgba(214, 148, 86, 0.12) 100%
    );
    backdrop-filter: blur(2px); /* Reduced for better content visibility */
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(214, 148, 86, 0.25);
    box-shadow: 
        0 8px 32px rgba(109, 59, 7, 0.12),
        0 4px 16px rgba(214, 148, 86, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow, border-color;
}

/* Project link layout fix */
.project-card.enhanced .project-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    min-height: 0; /* Allow flex children to shrink */
}

.project-card.enhanced:hover {
    transform: translateY(-8px) translateZ(0) scale(1.02);
    box-shadow: 
        0 15px 30px rgba(109, 59, 7, 0.08),
        0 8px 16px rgba(214, 148, 86, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(214, 148, 86, 0.2);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 202, 153, 0.08) 30%, 
        rgba(255, 255, 255, 0.92) 70%, 
        rgba(214, 148, 86, 0.1) 100%
    );
}

/* Dark theme support for project cards - Visibilité améliorée */
[data-theme="dark"] .project-card.enhanced {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.95) 0%, 
        rgba(109, 59, 7, 0.30) 30%, 
        rgba(43, 26, 15, 0.92) 70%, 
        rgba(214, 148, 86, 0.15) 100%
    );
    border-color: rgba(255, 202, 153, 0.25);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(109, 59, 7, 0.3),
        inset 0 1px 0 rgba(255, 202, 153, 0.2);
}

/* Dark theme project link */
[data-theme="dark"] .project-card.enhanced .project-link {
    color: inherit;
}

[data-theme="dark"] .project-card.enhanced:hover {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.98) 0%, 
        rgba(109, 59, 7, 0.25) 30%, 
        rgba(43, 26, 15, 0.95) 70%, 
        rgba(214, 148, 86, 0.15) 100%
    );
    border-color: rgba(255, 202, 153, 0.25);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 12px 24px rgba(109, 59, 7, 0.3),
        inset 0 1px 0 rgba(255, 202, 153, 0.15);
}

/* Image container avec effets modernes */
.project-image {
    position: relative;
    height: 320px; /* Fixed height for consistency */
    flex-shrink: 0; /* Prevent shrinking */
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-gray-200) 100%);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, filter;
}

.project-card.enhanced:hover .project-image img {
    transform: scale(1.05) rotate(0.5deg);
    filter: brightness(1.02) contrast(1.01) saturate(1.03);
}

/* Overlay moderne avec glassmorphism */
.project-overlay.modern-overlay {
    position: absolute;
    inset: 0;
    background: none;
    pointer-events: none;
}

.overlay-gradient {
    position: absolute;
    inset: 0;
    /* Removed dark gradient background that was hiding project images */
    background: transparent;
    opacity: 0.4;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(1px);
}

.project-card.enhanced:hover .overlay-gradient {
    opacity: 0.8;
    backdrop-filter: blur(2px);
}

/* Dark theme overlay - removed dark background that was hiding images */
[data-theme="dark"] .overlay-gradient {
    background: transparent;
}

/* Contenu superposé avec animations sophistiquées */
.project-overlay-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-8);
    opacity: 0.85;
    transform: translateY(12px) scale(0.99);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.project-card.enhanced:hover .project-overlay-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Badge de catégorie modernisé */
.project-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, 
        rgba(214, 148, 86, 0.98) 0%, 
        rgba(109, 59, 7, 0.95) 100%
    );
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: var(--font-display);
    align-self: flex-start;
    backdrop-filter: blur(2px); /* Reduced for better content visibility */
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 4px 16px rgba(109, 59, 7, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(8px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.project-card.enhanced:hover .project-category-badge {
    transform: translateY(0);
    box-shadow: 
        0 6px 20px rgba(109, 59, 7, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Badge de statut élégant */
.project-status-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    backdrop-filter: blur(1px); /* Reduced blur for cleaner content */
    border: 1px solid rgba(214, 148, 86, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card.enhanced:hover .project-status-badge {
    transform: translateY(0) scale(1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Dark theme badges */
[data-theme="dark"] .project-category-badge {
    background: linear-gradient(135deg, 
        rgba(255, 202, 153, 0.9) 0%, 
        rgba(214, 148, 86, 0.85) 100%
    );
    color: var(--color-amber-900);
}

[data-theme="dark"] .project-status-badge {
    background: rgba(43, 26, 15, 0.95);
    color: var(--color-amber-300);
    border-color: rgba(255, 202, 153, 0.2);
}

/* Actions CTA sophistiquées */
.project-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.18) 100%
    );
    backdrop-filter: blur(1px); /* Clean, minimal blur */
    padding: 1.25rem 1.75rem;
    border-radius: 1.5rem;
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(12px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card.enhanced:hover .project-actions {
    transform: translateY(0);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.12) 100%
    );
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.action-text {
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: var(--font-display);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.action-arrow {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.project-card.enhanced:hover .action-arrow {
    transform: translateX(8px) scale(1.1);
}

/* Dark theme actions */
[data-theme="dark"] .project-actions {
    background: linear-gradient(135deg, 
        rgba(109, 59, 7, 0.2) 0%, 
        rgba(57, 28, 11, 0.15) 100%
    );
    border-color: rgba(255, 202, 153, 0.15);
}

[data-theme="dark"] .project-card.enhanced:hover .project-actions {
    background: linear-gradient(135deg, 
        rgba(109, 59, 7, 0.3) 0%, 
        rgba(57, 28, 11, 0.25) 100%
    );
}

/* Section d'informations modernisée */
.project-info.enhanced-info {
    display: flex;
    flex-direction: column;
    flex: 1; /* Take remaining space */
    padding: var(--space-card-padding);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.96) 0%, 
        rgba(255, 202, 153, 0.12) 30%,
        rgba(255, 255, 255, 0.94) 70%,
        rgba(248, 246, 240, 0.88) 100%
    );
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden; /* Prevent content overflow */
}

.project-info.enhanced-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(214, 148, 86, 0.3) 50%, 
        transparent 100%
    );
}

.project-title {
    font-size: 1.375rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
    /* Ensure title doesn't grow too much */
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Fallback for browsers that don't support line-clamp */
    max-height: 3.6em; /* 2 lines * 1.3 line-height * 1.375rem font-size */
}

.project-card.enhanced:hover .project-title {
    color: var(--color-bronze);
}

.project-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0; /* Don't shrink meta tags */
}

.project-location,
.project-year {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: rgba(214, 148, 86, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(214, 148, 86, 0.1);
    transition: all 0.3s ease;
}

.project-card.enhanced:hover .project-location,
.project-card.enhanced:hover .project-year {
    background: rgba(214, 148, 86, 0.1);
    border-color: rgba(214, 148, 86, 0.2);
    transform: translateY(-1px);
}

.meta-icon {
    font-size: 1rem;
    color: var(--color-gold);
}

.project-excerpt {
    color: var(--color-gray-600);
    line-height: 1.6;
    font-size: 0.925rem;
    font-weight: 400;
    flex: 1; /* Take remaining space */
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Limit to 4 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0; /* Remove default margins */
}

/* Dark theme comprehensive styling */
[data-theme="dark"] .portfolio-header {
    background: 
        radial-gradient(circle at top left, rgba(255, 202, 153, 0.08) 0%, transparent 30%),
        radial-gradient(circle at bottom right, rgba(214, 148, 86, 0.05) 0%, transparent 40%),
        linear-gradient(135deg, 
            rgba(26, 15, 7, 0.98) 0%, 
            rgba(57, 28, 11, 0.95) 30%,
            rgba(43, 26, 15, 0.98) 70%,
            rgba(109, 59, 7, 0.1) 100%
        );
}

[data-theme="dark"] .portfolio-title {
    background: linear-gradient(135deg, 
        var(--color-amber-300) 0%, 
        var(--color-amber-400) 30%,
        var(--color-amber-200) 70%,
        var(--color-amber-300) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .portfolio-subtitle {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .portfolio-filters {
    background: 
        linear-gradient(135deg, 
            rgba(43, 26, 15, 0.98) 0%, 
            rgba(26, 15, 7, 0.95) 50%,
            rgba(57, 28, 11, 0.98) 100%
        );
}

[data-theme="dark"] .filters-title {
    background: linear-gradient(135deg, 
        var(--color-amber-300) 0%, 
        var(--color-amber-400) 50%,
        var(--color-amber-200) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .portfolio-projects {
    background: 
        radial-gradient(circle at top right, rgba(255, 202, 153, 0.05) 0%, transparent 50%),
        radial-gradient(circle at bottom left, rgba(214, 148, 86, 0.03) 0%, transparent 40%),
        linear-gradient(180deg, 
            rgba(26, 15, 7, 0.8) 0%, 
            rgba(43, 26, 15, 0.95) 30%,
            rgba(57, 28, 11, 0.9) 70%,
            rgba(109, 59, 7, 0.08) 100%
        );
}

[data-theme="dark"] .filter-btn {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.9) 0%, 
        rgba(109, 59, 7, 0.08) 30%,
        rgba(43, 26, 15, 0.85) 70%,
        rgba(214, 148, 86, 0.05) 100%
    );
    color: var(--dark-text-secondary);
    border-color: rgba(255, 202, 153, 0.12);
}

[data-theme="dark"] .filter-btn:hover {
    color: var(--color-amber-300);
    border-color: rgba(255, 202, 153, 0.2);
}

[data-theme="dark"] .filter-btn.active {
    background: linear-gradient(135deg, 
        var(--color-amber-400) 0%, 
        rgba(255, 202, 153, 0.95) 30%,
        var(--color-amber-300) 70%,
        var(--color-amber-400) 100%
    );
    color: var(--color-amber-900);
}

[data-theme="dark"] .total-projects {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.95) 0%, 
        rgba(109, 59, 7, 0.12) 30%,
        rgba(43, 26, 15, 0.9) 70%,
        rgba(255, 202, 153, 0.08) 100%
    );
    border-color: rgba(255, 202, 153, 0.15);
}

[data-theme="dark"] .category-stat {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.9) 0%, 
        rgba(109, 59, 7, 0.08) 30%,
        rgba(43, 26, 15, 0.85) 70%,
        rgba(255, 202, 153, 0.05) 100%
    );
    border-color: rgba(255, 202, 153, 0.12);
}

[data-theme="dark"] .big-number {
    background: linear-gradient(135deg, 
        var(--color-amber-400) 0%, 
        var(--color-amber-300) 50%,
        var(--color-amber-400) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .label,
[data-theme="dark"] .stat-label {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .stat-number {
    color: var(--color-amber-300);
}

[data-theme="dark"] .project-info.enhanced-info {
    background: linear-gradient(135deg, 
        rgba(43, 26, 15, 0.98) 0%, 
        rgba(109, 59, 7, 0.20) 30%,
        rgba(57, 28, 11, 0.95) 70%,
        rgba(26, 15, 7, 0.92) 100%
    );
}

[data-theme="dark"] .project-info.enhanced-info::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 202, 153, 0.2) 50%, 
        transparent 100%
    );
}

[data-theme="dark"] .project-title {
    color: var(--color-amber-300);
}

[data-theme="dark"] .project-card.enhanced:hover .project-title {
    color: var(--color-amber-400);
}

[data-theme="dark"] .project-location,
[data-theme="dark"] .project-year {
    color: var(--dark-text-secondary);
    background: rgba(255, 202, 153, 0.08);
    border-color: rgba(255, 202, 153, 0.12);
}

[data-theme="dark"] .project-card.enhanced:hover .project-location,
[data-theme="dark"] .project-card.enhanced:hover .project-year {
    background: rgba(255, 202, 153, 0.12);
    border-color: rgba(255, 202, 153, 0.2);
}

[data-theme="dark"] .project-excerpt {
    color: var(--dark-text-secondary);
}

/* Project Placeholder */
.project-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(248, 246, 240, 0.95) 0%, 
        rgba(255, 202, 153, 0.1) 30%,
        rgba(255, 255, 255, 0.9) 70%,
        rgba(214, 148, 86, 0.08) 100%
    );
    backdrop-filter: blur(2px);
    border: 2px dashed rgba(214, 148, 86, 0.3);
    border-radius: 1rem;
    margin: 1rem;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.project-placeholder:hover {
    background: linear-gradient(135deg, 
        rgba(248, 246, 240, 0.98) 0%, 
        rgba(255, 202, 153, 0.15) 30%,
        rgba(255, 255, 255, 0.95) 70%,
        rgba(214, 148, 86, 0.12) 100%
    );
    border-color: rgba(214, 148, 86, 0.4);
    transform: scale(1.02);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--color-gold);
    filter: drop-shadow(0 2px 4px rgba(214, 148, 86, 0.2));
}

.placeholder-text {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--color-primary);
    text-align: center;
    letter-spacing: 0.02em;
}

/* Dark theme placeholder support */
[data-theme="dark"] .project-placeholder {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.95) 0%, 
        rgba(109, 59, 7, 0.15) 30%,
        rgba(43, 26, 15, 0.9) 70%,
        rgba(255, 202, 153, 0.05) 100%
    );
    border-color: rgba(255, 202, 153, 0.2);
    color: var(--color-amber-300);
}

[data-theme="dark"] .project-placeholder:hover {
    background: linear-gradient(135deg, 
        rgba(57, 28, 11, 0.98) 0%, 
        rgba(109, 59, 7, 0.2) 30%,
        rgba(43, 26, 15, 0.95) 70%,
        rgba(255, 202, 153, 0.08) 100%
    );
    border-color: rgba(255, 202, 153, 0.3);
}

[data-theme="dark"] .placeholder-icon {
    color: var(--color-amber-400);
    filter: drop-shadow(0 2px 4px rgba(255, 202, 153, 0.2));
}

[data-theme="dark"] .placeholder-text {
    color: var(--color-amber-300);
}

/* No Projects State */
.no-projects {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.no-projects-content {
    text-align: center;
    max-width: 400px;
}

.no-projects-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.no-projects-content h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.no-projects-content p {
    color: var(--color-gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Portfolio Actions */
.portfolio-actions {
    text-align: center;
    margin-top: 4rem;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-top .arrow {
    transition: transform var(--transition-base);
}

.back-to-top:hover .arrow {
    transform: translateY(-4px);
}

/* Performance optimizations */
.project-card.enhanced {
    contain: layout style paint;
    transform: translateZ(0); /* Force hardware acceleration */
}

.project-image img {
    will-change: transform, filter;
    backface-visibility: hidden;
}

/* Browser compatibility */
.project-card.enhanced {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(2px); /* Reduced for better content visibility */
}

.filter-btn {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(2px); /* Reduced for better content visibility */
}

.total-projects {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(4px);
}

.category-stat {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(1px); /* Clean, minimal blur */
}

/* AOS Animation Fallbacks - Force visibility of all cards */
.project-card[data-aos] {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: all 0.6s ease;
}

/* Override AOS initialization to keep cards visible */
body.aos-initialized .project-card[data-aos] {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

body.aos-initialized .project-card[data-aos].aos-animate {
    opacity: 1 !important;
    transform: translateY(0) !important;
}


/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .project-card.enhanced,
    .filter-btn,
    .total-projects,
    .category-stat,
    .project-overlay-content,
    .project-category-badge,
    .project-status-badge,
    .project-actions {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
    
    .project-card[data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Performance hints for browsers */
.portfolio-projects {
    isolation: isolate;
}

.projects-grid.modern-grid {
    will-change: contents;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .projects-grid.modern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    .portfolio-header {
        padding: 100px 0 var(--space-section-sm);
    }
    
    .portfolio-title {
        font-size: 2.5rem;
    }
    
    .category-overview {
        flex-direction: column;
        gap: var(--space-8);
    }
    
    .category-breakdown {
        gap: var(--space-4);
    }
    
    .projects-grid.modern-grid {
        grid-template-columns: 1fr;
        gap: var(--space-grid-gap);
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        min-width: 200px;
        justify-content: center;
    }
    
    /* Mobile card height adjustments */
    .project-card.enhanced {
        height: 550px; /* Slightly smaller for mobile */
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .project-image {
        height: 280px; /* Reduce image height on mobile */
    }
    
    .total-projects {
        backdrop-filter: blur(1px); /* Reduced blur for cleaner content */
        -webkit-backdrop-filter: blur(1px); /* Reduced blur for cleaner content */
    }
}

@media (max-width: 480px) {
    .portfolio-header {
        padding: 80px 0 var(--space-section-sm);
    }
    
    /* Very small screen card adjustments */
    .project-card.enhanced {
        height: 520px; /* Even smaller for very small screens */
    }
    
    .project-image {
        height: 260px; /* Further reduce image height */
    }
    
    .project-info.enhanced-info {
        padding: var(--space-card-padding);
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-title {
        font-size: 1.25rem; /* Smaller title on very small screens */
        margin-bottom: 0.75rem;
    }
    
    .project-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 3; /* Fewer lines on small screens */
    }
}