:root {
    --primary: #2D3436;
    --accent: #0984E3;
    --gradient: linear-gradient(45deg, #0984E3, #00CEC9);
    --text: #2D3436;
    --bg: #FFFFFF;
    --dark-primary: #1e40af;
    --dark-secondary: #0f172a;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --text-light: #64748b;
    --surface: #f8fafc;
    --card-radius: 20px;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* Hero Section */
.hero {
    padding: 8rem 0 5rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

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

.hero-content {
    position: relative;
    z-index: 2;
}

.subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.subtitle-line {
    width: 50px;
    height: 2px;
    background: var(--accent);
    animation: expandWidth 1s ease forwards;
}

h1 {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.description {
    font-size: 1.2rem;
    color: #636E72;
    max-width: 500px;
    margin-bottom: 2rem;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.tech-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.tech-item img {
    width: 30px;
    height: 30px;
}

/* Floating Badges */
.floating-badges {
    position: absolute;
    right: 10%;
    top: 20%;
}

.floating-badge {
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: float 4s ease-in-out infinite;
}

/* Projects Grid */
.projects {
    padding: 5rem 0;
    background: #F8F9FA;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cta-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    background: white;
    color: var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cta-button.active,
.cta-button:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-2px);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.article-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.article-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.article-content p {
    color: #666;
    margin-bottom: 1rem;
    flex: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tech-badge {
    background: #f8f9fa;
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

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

.project-link {
    color: var(--accent);
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.project-link:hover {
    transform: translateY(-3px);
}

.read-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 1rem;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expandWidth {
    from {
        width: 0;
    }

    to {
        width: 50px;
    }
}

/* Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header Styles */
.projects-header {
    min-height: 500px;
    background: linear-gradient(135deg, var(--dark-primary) 0%, var(--dark-secondary) 100%);
    position: relative;
    display: flex;
    align-items: center;
    padding: 120px 0 60px;
    overflow: hidden;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.text-gradient {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 3rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--card-radius);
    min-width: 200px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

/* Projects Grid */
.projects-section {
    padding: 5rem 0;
    background: var(--surface);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.project-card {
    background: white;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    height: 100%;
}

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

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-category {
    background: white;
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    align-self: flex-start;
}

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

.project-link {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-secondary);
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-badge {
    padding: 0.5rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.modal-header {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.5rem;
}

.btn-close {
    filter: brightness(0) invert(1);
}

.project-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.project-images {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.carousel-item img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    background-color: #f8f9fa;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: var(--accent);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
    margin: 0 1rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background: var(--primary);
}

.carousel-indicators {
    bottom: -2.5rem;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent);
    opacity: 0.5;
    margin: 0 5px;
}

.carousel-indicators button.active {
    opacity: 1;
}

.project-info {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.info-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

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

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.skill-item i {
    color: var(--accent);
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 1rem 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

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

.btn-outline-primary:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .text-gradient {
        font-size: 2.5rem;
    }

    .stats-container {
        flex-direction: column;
        gap: 2rem;
    }

    .stat-item {
        min-width: auto;
    }

    .filter-container {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-details {
        grid-template-columns: 1fr;
    }

    .carousel-item img {
        height: 300px;
    }
}

/* Améliorations des Modals */
.modal-dialog.modal-xl {
    max-width: 90%;
    margin: 1.75rem auto;
}

/* Responsive Design pour les Modals */
@media (min-width: 992px) {
    .project-details {
        grid-template-columns: 1.5fr 1fr;
    }

    .carousel-item img {
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .modal-dialog.modal-xl {
        max-width: 95%;
        margin: 1rem auto;
    }

    .carousel-item img {
        max-height: 50vh;
    }

    .project-info {
        padding: 1.5rem;
    }
}