/* Enhanced Tech Stack Styles - Harmonie avec le design SOS */

/* Page Hero Section */
.mxd-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b4181 0%, #1a5490 50%, #0b4181 100%);
    position: relative;
    overflow: hidden;
}

.mxd-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.mxd-hero__inner {
    text-align: center;
    z-index: 2;
    position: relative;
}

.mxd-hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mxd-hero__subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Main Content Section */
.mxd-section.padding-section {
    padding: 6rem 0;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

/* Category Sections */
.mxd-category-section {
    margin-bottom: 8rem;
    position: relative;
}

.mxd-category-section:last-child {
    margin-bottom: 0;
}

.mxd-category-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.mxd-category-title h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
}

.mxd-category-title h2::before,
.mxd-category-title h2::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0b4181, transparent);
}

.mxd-category-title h2::before {
    right: calc(100% + 2rem);
}

.mxd-category-title h2::after {
    left: calc(100% + 2rem);
}

.mxd-category-description {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #64748b;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-weight: 400;
}

/* Enhanced Tech Stack Grid */
.mxd-tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

/* Enhanced Card Design */
.mxd-tech-stack-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mxd-tech-stack-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0b4181 0%, #2563eb 50%, #0b4181 100%);
    transition: height 0.4s ease;
    border-radius: 3px 3px 0 0;
}

.mxd-tech-stack-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        transparent 0%, 
        rgba(11, 65, 129, 0.02) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.mxd-tech-stack-card:hover {
    transform: translateY(-15px) scale(1.02);
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    border-color: rgba(11, 65, 129, 0.15);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.12),
        0 8px 25px rgba(11, 65, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mxd-tech-stack-card:hover::before {
    height: 6px;
    box-shadow: 0 2px 10px rgba(11, 65, 129, 0.3);
}

.mxd-tech-stack-card:hover::after {
    opacity: 1;
}

.mxd-tech-stack-card__inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease;
}

.mxd-tech-stack-card:hover .mxd-tech-stack-card__inner {
    transform: translateY(-5px);
}

/* Enhanced Icon */
.mxd-tech-stack-card__icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--base-tint);
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mxd-tech-stack-card__icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(11, 65, 129, 0.1) 50%, 
        transparent 70%);
    transform: rotate(45deg);
    transition: all 0.8s ease;
    opacity: 0;
}

.mxd-tech-stack-card:hover .mxd-tech-stack-card__icon::before {
    animation: techShimmer 0.8s ease;
}

.mxd-tech-stack-card__icon svg,
.mxd-tech-stack-card__icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: grayscale(0.8) brightness(0.9) opacity(0.8);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

/* Mode dark : fond blanc pour voir les logos sombres */
[color-scheme="dark"] .mxd-tech-stack-card__icon {
    background: #ffffff !important;
}

[color-scheme="dark"] .mxd-tech-stack-card__icon svg,
[color-scheme="dark"] .mxd-tech-stack-card__icon img {
    filter: grayscale(0.6) brightness(0.8) opacity(0.85);
}

.mxd-tech-stack-card:hover .mxd-tech-stack-card__icon {
    transform: scale(1.15) rotate(5deg);
    background: var(--base);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mxd-tech-stack-card:hover .mxd-tech-stack-card__icon svg,
.mxd-tech-stack-card:hover .mxd-tech-stack-card__icon img {
    filter: grayscale(0) brightness(1) opacity(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    transform: scale(1.1);
}

/* Mode dark hover : fond blanc et logos en couleur */
[color-scheme="dark"] .mxd-tech-stack-card:hover .mxd-tech-stack-card__icon {
    background: #ffffff !important;
}

[color-scheme="dark"] .mxd-tech-stack-card:hover .mxd-tech-stack-card__icon svg,
[color-scheme="dark"] .mxd-tech-stack-card:hover .mxd-tech-stack-card__icon img {
    filter: grayscale(0) brightness(1) opacity(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

/* Enhanced Content */
.mxd-tech-stack-card__content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mxd-tech-stack-card__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.mxd-tech-stack-card:hover .mxd-tech-stack-card__title {
    color: #0b4181;
    transform: translateY(-2px);
}

.mxd-tech-stack-card__description {
    font-size: 1rem;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
    transition: color 0.3s ease;
    flex: 1;
}

.mxd-tech-stack-card:hover .mxd-tech-stack-card__description {
    color: #475569;
}

/* Animations */
@keyframes techShimmer {
    0% {
        transform: rotate(45deg) translateX(-150%);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        transform: rotate(45deg) translateX(150%);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
        filter: blur(10px);
    }
    50% {
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.animate-card-4 {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
}

.animate-card-4:nth-child(1) { animation-delay: 0.1s; }
.animate-card-4:nth-child(2) { animation-delay: 0.2s; }
.animate-card-4:nth-child(3) { animation-delay: 0.3s; }
.animate-card-4:nth-child(4) { animation-delay: 0.4s; }
.animate-card-4:nth-child(5) { animation-delay: 0.5s; }
.animate-card-4:nth-child(6) { animation-delay: 0.6s; }
.animate-card-4:nth-child(7) { animation-delay: 0.7s; }
.animate-card-4:nth-child(8) { animation-delay: 0.8s; }

/* Responsive Design */
@media only screen and (max-width: 1200px) {
    .mxd-tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }
    
    .mxd-tech-stack-card {
        padding: 2rem;
    }
    
    .mxd-tech-stack-card__icon {
        width: 70px;
        height: 70px;
    }
    
    .mxd-tech-stack-card__icon svg,
    .mxd-tech-stack-card__icon img {
        width: 40px;
        height: 40px;
    }
}

@media only screen and (max-width: 768px) {
    .mxd-hero {
        min-height: 50vh;
    }
    
    .mxd-hero__title {
        font-size: clamp(2rem, 6vw, 3rem);
    }
    
    .mxd-hero__subtitle {
        font-size: 1.1rem;
    }
    
    .mxd-category-section {
        margin-bottom: 5rem;
    }
    
    .mxd-category-title {
        margin-bottom: 3rem;
    }
    
    .mxd-category-title h2::before,
    .mxd-category-title h2::after {
        display: none;
    }
    
    .mxd-tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .mxd-tech-stack-card {
        padding: 1.8rem;
        border-radius: 20px;
    }
    
    .mxd-tech-stack-card:hover {
        transform: translateY(-10px) scale(1.01);
    }
    
    .mxd-tech-stack-card__icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }
    
    .mxd-tech-stack-card__icon svg,
    .mxd-tech-stack-card__icon img {
        width: 35px;
        height: 35px;
    }
    
    .mxd-tech-stack-card__title {
        font-size: 1.4rem;
    }
    
    .mxd-tech-stack-card__description {
        font-size: 0.95rem;
    }
    
    .mxd-category-description {
        font-size: 1.1rem;
    }
}

@media only screen and (max-width: 480px) {
    .mxd-tech-stack-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .mxd-tech-stack-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .mxd-tech-stack-card__icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
    
    .mxd-tech-stack-card__icon svg,
    .mxd-tech-stack-card__icon img {
        width: 30px;
        height: 30px;
    }
    
    .mxd-tech-stack-card__title {
        font-size: 1.3rem;
    }
    
    .mxd-tech-stack-card__description {
        font-size: 0.9rem;
    }
}

/* Performance optimizations */
.mxd-tech-stack-card {
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.mxd-tech-stack-card__icon {
    will-change: transform;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mxd-tech-stack-card {
        background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .mxd-tech-stack-card:hover {
        background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
        border-color: rgba(11, 65, 129, 0.3);
    }
    
    .mxd-tech-stack-card__title {
        color: #f8fafc;
    }
    
    .mxd-tech-stack-card__description {
        color: #cbd5e1;
    }
    
    .mxd-tech-stack-card__icon {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    }
}
