/**
 * Styles spécifiques pour la page Portfolio
 * Optimisé pour les performances
 */

/* ========== HERO PORTFOLIO ========== */
.hero-portfolio {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 12rem 0 6rem;
    position: relative;
    background: linear-gradient(135deg, rgba(234, 93, 111, 0.03) 0%, transparent 40%, rgba(0, 161, 77, 0.03) 100%);
    overflow: hidden;
}

.hero-portfolio::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(234, 93, 111, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.hero-portfolio .hero-content {
    position: relative;
    z-index: 2;
}

.hero-portfolio .hero-title {
    font-size: clamp(3.2rem, 5vw, 5.6rem);
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-portfolio .hero-description {
    font-size: 1.8rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ========== FILTRES PORTFOLIO ========== */
.portfolio-filters-section {
    padding: 4rem 0 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.portfolio-filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Barre de recherche */
.portfolio-search {
    max-width: 500px;
    margin: 0 auto 2rem;
    width: 100%;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 1.2rem 5rem 1.2rem 2rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 5rem;
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(234, 93, 111, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    background: var(--accent-red);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(234, 93, 111, 0.3);
}

/* Filtres par catégorie */
.portfolio-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 2rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 5rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.filter-tab svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .portfolio-filter-tabs {
        gap: 0.5rem;
    }
    
    .filter-tab {
        padding: 0.6rem 1.5rem;
        font-size: 1.4rem;
    }
}

/* Meta information */
.portfolio-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
}

.portfolio-count {
    font-size: 1.6rem;
    color: var(--text-muted);
}

.portfolio-count span {
    font-weight: 700;
    color: var(--text);
}

.portfolio-sort {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-label {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.sort-select {
    padding: 0.8rem 3rem 0.8rem 1.5rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 0.8rem;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23737373' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-red);
}

@media (max-width: 768px) {
    .portfolio-meta {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }
}

/* ========== GRILLE PORTFOLIO ========== */
.portfolio-grid-section {
    padding: 6rem 0 8rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 6rem;
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Card portfolio */
.portfolio-card {
    background: var(--surface);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* Image avec overlay */
.portfolio-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 10, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.overlay-link {
    width: 60px;
    height: 60px;
    background: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transform: scale(0);
    transition: transform 0.3s ease 0.1s;
}

.portfolio-card:hover .overlay-link {
    transform: scale(1);
}

.overlay-link:hover {
    background: var(--accent-green);
    transform: scale(1.1);
}

/* Contenu de la card */
.portfolio-content {
    padding: 2.5rem;
}

.portfolio-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.portfolio-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.portfolio-title a:hover {
    color: var(--accent-red);
}

/* Tags */
.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.tag {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--bg);
    border-radius: 2rem;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.tag-web {
    background: rgba(234, 93, 111, 0.1);
    color: var(--accent-red);
    border-color: rgba(234, 93, 111, 0.2);
}

.tag-design {
    background: rgba(251, 204, 64, 0.1);
    color: var(--accent-yellow);
    border-color: rgba(251, 204, 64, 0.2);
}

.tag-communication,
.tag-comm {
    background: rgba(0, 161, 77, 0.1);
    color: var(--accent-green);
    border-color: rgba(0, 161, 77, 0.2);
}

.tag-data {
    background: rgba(234, 93, 111, 0.1);
    color: var(--accent-red);
    border-color: rgba(234, 93, 111, 0.2);
}

.portfolio-desc {
    font-size: 1.5rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Footer de la card */
.portfolio-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.portfolio-details-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--accent-red);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.portfolio-details-link:hover {
    gap: 1.2rem;
    color: var(--accent-green);
}

.portfolio-details-link svg {
    transition: transform 0.3s ease;
}

.portfolio-details-link:hover svg {
    transform: translateX(5px);
}

/* ========== MESSAGE AUCUN RÉSULTAT ========== */
.no-results-message {
    text-align: center;
    padding: 8rem 0;
}

.no-results-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-results-content svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 2rem;
    opacity: 0.5;
}

.no-results-content h3 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.no-results-content p {
    font-size: 1.6rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.no-results-content .btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

/* ========== PAGINATION ========== */
.portfolio-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 6rem;
}

.pagination-prev,
.pagination-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
}

.pagination-prev:hover:not(:disabled),
.pagination-next:hover:not(:disabled) {
    border-color: var(--accent-red);
    color: var(--accent-red);
    transform: scale(1.1);
}

.pagination-prev:disabled,
.pagination-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text);
}

.pagination-number:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    transform: scale(1.1);
}

.pagination-number.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

/* ========== ANIMATIONS ========== */
.portfolio-item {
    animation: fadeInUp 0.6s ease both;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.15s; }
.portfolio-item:nth-child(3) { animation-delay: 0.2s; }
.portfolio-item:nth-child(4) { animation-delay: 0.25s; }
.portfolio-item:nth-child(5) { animation-delay: 0.3s; }
.portfolio-item:nth-child(6) { animation-delay: 0.35s; }
.portfolio-item:nth-child(7) { animation-delay: 0.4s; }
.portfolio-item:nth-child(8) { animation-delay: 0.45s; }
.portfolio-item:nth-child(9) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-portfolio {
        padding: 10rem 0 5rem;
        min-height: 50vh;
    }
    
    .hero-portfolio .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-portfolio .hero-description {
        font-size: 1.6rem;
    }
    
    .portfolio-filters-section {
        padding: 3rem 0 1.5rem;
    }
    
    .portfolio-grid-section {
        padding: 4rem 0 6rem;
    }
    
    .portfolio-content {
        padding: 2rem;
    }
    
    .portfolio-title {
        font-size: 1.9rem;
    }
    
    .portfolio-desc {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .portfolio-filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
    
    .portfolio-meta {
        align-items: center;
        text-align: center;
    }
    
    .portfolio-sort {
        width: 100%;
        justify-content: center;
    }
    
    .portfolio-grid {
        gap: 1.5rem;
    }
}

/* CTA moderne */
.cta-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-yellow));
    border-radius: 2rem;
    padding: 5rem 4rem;
    overflow: hidden;
    color: white;
}

@media (max-width: 768px) {
    .cta-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.cta-content h2 {
    font-size: clamp(2.8rem, 4vw, 4.2rem);
    color: white;
    margin-bottom: 2rem;
}

.cta-content p {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .cta-buttons {
        justify-content: center;
    }
}

.btn-light {
    background: white;
    color: var(--accent-red);
}

.btn-light:hover {
    background: #f5f5f5;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-light:hover {
    background: white;
    color: var(--accent-red);
}


/* ========== DARK MODE ========== */
[data-theme="dark"] .portfolio-filters-section {
    background: var(--surface);
}

[data-theme="dark"] .search-input {
    background: var(--surface);
}

[data-theme="dark"] .filter-tab {
    background: var(--surface);
}

[data-theme="dark"] .filter-tab:hover {
    background: rgba(234, 93, 111, 0.1);
}

[data-theme="dark"] .sort-select {
    background: var(--surface);
}

[data-theme="dark"] .portfolio-card {
    background: var(--surface);
}

[data-theme="dark"] .portfolio-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .portfolio-overlay {
    background: rgba(9, 10, 10, 0.9);
}

[data-theme="dark"] .tag {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .pagination-prev,
[data-theme="dark"] .pagination-next,
[data-theme="dark"] .pagination-number {
    background: var(--surface);
}

/* ========== PERFORMANCE ========== */
.portfolio-image img {
    will-change: transform;
}

.portfolio-card {
    will-change: transform;
}

/* Optimisation pour le touch */
@media (hover: none) {
    .portfolio-card:hover {
        transform: none;
    }
    
    .portfolio-overlay {
        opacity: 1;
        background: rgba(9, 10, 10, 0.3);
    }
    
    .overlay-link {
        transform: scale(1);
    }
}

/* ========== ACCESSIBILITÉ ========== */
.filter-tab:focus,
.search-input:focus,
.sort-select:focus,
.pagination-prev:focus,
.pagination-next:focus,
.pagination-number:focus {
    outline: 3px solid rgba(234, 93, 111, 0.5);
    outline-offset: 2px;
}

.portfolio-details-link:focus {
    outline: 3px solid rgba(234, 93, 111, 0.5);
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .portfolio-card {
        border: 2px solid var(--text);
    }
    
    .filter-tab {
        border-width: 3px;
    }
    
    .tag {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .portfolio-item {
        animation: none !important;
    }
    
    .portfolio-card,
    .portfolio-image img,
    .overlay-link {
        transition: none !important;
    }
}

/* Footer */
.footer {
    background: var(--surface);
    padding: 6rem 0 3rem;
    margin-top: 8rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .logo {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.footer-brand p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 50%;
    color: var(--text);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-red);
    color: white;
    transform: translateY(-3px);
}

.footer-nav h4 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 0.8rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--accent-red);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 3rem;
    text-align: center;
    color: var(--text-muted);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-content {
    padding: 8rem 2rem 3rem;
}

.mobile-menu-nav {
    list-style: none;
    margin-bottom: 3rem;
}

.mobile-menu-nav li {
    margin-bottom: 2rem;
}

.mobile-menu-nav a {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a[aria-current="page"] {
    color: var(--accent-red);
}