.main-content {
    padding: calc(80px + 2rem) 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    justify-items: center; /* Center the items horizontally */
    padding: 0 1rem;
}



.portfolio-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    transform-origin: center;
    width: 100%;
    /* Use min-height instead of aspect-ratio and max-height */
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.portfolio-item img {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item-info {
    padding: 1.5rem;
    background: linear-gradient(
        to bottom,
        rgba(26, 26, 26, 0.8),
        rgba(26, 26, 26, 1)
    );
    flex-grow: 1; /* Allow it to expand to fill remaining space */
    display: flex;
    flex-direction: column;
}

.portfolio-item-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.portfolio-item-info p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    max-height: none;
    overflow: visible;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.modal-header {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.project-title-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
}

.project-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

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

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
}

.lead-text {
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
    border-left: 4px solid #5865F2;
    padding-left: 1rem;
}

.demo-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.demo-image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.demo-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.modal.active {
    pointer-events: auto;
}

.modal-content {
    background-color: #1a1a1a;
    color: #fff;
    position: fixed;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Updated expanded state styles */
.modal-content.expanded {
    width: 70vw;; 
    height: 80vh; 
    max-width: none; /* Removed max-width constraint */
    min-width: min(320px, 90vw); /* Ensures minimum size on small screens */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    overflow-y: auto;
}

/* Updated content layout for expanded state */
.modal-content.expanded img {
    width: 100%;
    object-fit: cover;
    height: 100%;
}

.modal-content-info {
    padding: min(4vw, 3rem); /* Responsive padding */
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 100%;
    margin: 0 auto;
}

.modal-content.expanded .modal-content-info {
    opacity: 1;
}

.modal-content-info h2 {
    font-size: min(4vw, 2.5rem); /* Responsive font size with maximum */
    margin-bottom: 1em;
}

.modal-content-info h3 {
    font-size: min(3vw, 1.8rem);
    margin: 1.5em 0 0.8em;
}

.modal-content-info p {
    font-size: min(2vw, 1.4rem); /* Responsive font size with maximum */
    line-height: 1.6;
    margin-bottom: 1em;
    color: rgba(255, 255, 255, 0.9);
}

.modal-content img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.5s ease;
    pointer-events: none;
}

.modal-backdrop.active {
    background-color: rgba(0, 0, 0, 0.8);
    pointer-events: auto;
}

/* Custom styling for Twitthé modal only */
#Twitthé-modal .feature-icon {
    color: #1F5A42; /* Change from #5865F2 to dark green */
  }
  
  #Twitthé-modal .github-btn {
    background: #1F5A42; /* Change button background */
    transition: background 0.3s ease;
  }
  
  #Twitthé-modal .github-btn:hover {
    background: #143b2d; /* Darker shade for hover state */
  }
  
  #Twitthé-modal h3 i {
    color: #1F5A42; /* Change section header icons */
  }
  
  #Twitthé-modal .feature:hover {
    background: rgba(31, 90, 66, 0.15); /* Change feature hover background */
  }
  
  #Twitthé-modal .tech-icon {
    background: rgba(31, 90, 66, 0.2); /* Change tech icon background */
  }
  
  #Twitthé-modal .lead-text {
    border-left: 4px solid #1F5A42; /* Change left border of lead text */
  }
  
  #Twitthé-modal .tech-category h4 {
    color: #1F5A42; /* Change tech category headers */
  }
  
  #Twitthé-modal .requirement-icon {
    color: #1F5A42; /* Change requirement icons */
  }
  
  #Twitthé-modal .installation-steps li::before {
    background: #1F5A42; /* Change numbered list circles */
  }
  
  #Twitthé-modal .copy-btn:hover {
    color: #1F5A42; /* Change copy button hover */
  }
  
  /* Additional styles for any other theme-specific elements */
  #Twitthé-modal .badge {
    background: rgba(31, 90, 66, 0.2); /* Change badge color */
  }

  #Twitthé-modal .directory-name {
    font-weight: bold;
    color: #1F5A42;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

#Twitthé-modal .directory-name i {
    margin-right: 0.5rem;
    color: #1F5A42;
}

/* Custom styling for Restaurant modal only */
#restaurant-modal .feature-icon {
    color: #FF6B35; /* Change from #5865F2 to dark green */
  }
  
  #restaurant-modal .github-btn {
    background: #FF6B35; /* Change button background */
    transition: background 0.3s ease;
  }
  
  #restaurant-modal .github-btn:hover {
    background: #143b2d; /* Darker shade for hover state */
  }
  
  #restaurant-modal h3 i {
    color: #FF6B35; /* Change section header icons */
  }
  
  #restaurant-modal .feature:hover {
    background: rgba(31, 90, 66, 0.15); /* Change feature hover background */
  }
  
  #restaurant-modal .tech-icon {
    background: rgba(31, 90, 66, 0.2); /* Change tech icon background */
  }
  
  #restaurant-modal .lead-text {
    border-left: 4px solid #FF6B35; /* Change left border of lead text */
  }
  
  #restaurant-modal .tech-category h4 {
    color: #FF6B35; /* Change tech category headers */
  }
  
  #restaurant-modal .requirement-icon {
    color: #FF6B35; /* Change requirement icons */
  }
  
  #restaurant-modal .installation-steps li::before {
    background: #FF6B35; /* Change numbered list circles */
  }
  
  #restaurant-modal .copy-btn:hover {
    color: #FF6B35; /* Change copy button hover */
  }
  
  /* Additional styles for any other theme-specific elements */
  #restaurant-modal .badge {
    background: rgba(31, 90, 66, 0.2); /* Change badge color */
  }

  #restaurant-modal .directory-name {
    font-weight: bold;
    color: #FF6B35;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

#restaurant-modal .directory-name i {
    margin-right: 0.5rem;
    color: #FF6B35;
}

.close {
    position: fixed;
    right: 32px;
    top: 32px;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    z-index: 1001;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.close.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content.expanded {
        width: 95vw;
        height: 90vh;
    }
    
    .modal-content-info {
        padding: 1.5rem;
    }
    
    .modal-content-info h2 {
        font-size: 1.8rem;
    }
    
    .modal-content-info h3 {
        font-size: 1.4rem;
    }
    
    .modal-content-info p {
        font-size: 1rem;
    }
}

.project-section {
    margin: 3rem 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    padding: 2rem;
    padding-top: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.project-section h3 {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #fff;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 1rem;
}

.project-section h3 i {
    margin-right: 0.8rem;
    color: #5865F2;
}

.project-section h4 {
    color: #fff;
    font-size: min(2.5vw, 1.4rem);
    margin: 1.5rem 0 1rem;
}

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

.feature {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    background: rgba(88,101,242,0.15);
}

.feature-icon {
    font-size: 2.5rem;
    color: #5865F2;
    margin-bottom: 1rem;
}

.feature h4 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: white;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tech-category {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1.5rem;
}

.tech-category h4 {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #5865F2;
}

.tech-category ul {
    list-style: none;
    margin-left: 0;
}

.tech-category li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.tech-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: rgba(88,101,242,0.2);
    border-radius: 50%;
    margin-right: 1rem;
}

.installation-steps ol {
    counter-reset: step-counter;
    margin-left: 0;
}

.installation-steps li {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 3rem;
    list-style: none;
}

.installation-steps li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: #5865F2;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
}

.project-section .code-snippet {
    background: #1E1E1E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    position: relative;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    overflow-x: auto;
}

/* Project Structure Styling */
.file-structure {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    font-family: 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.directory {
    color: #fff;
}

.directory-name {
    font-weight: bold;
    color: #5865F2;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.directory-name i {
    margin-right: 0.5rem;
    color: #5865F2;
}

.files {
    margin-left: 1.5rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
}

.file {
    margin: 0.5rem 0;
    display: flex;
    align-items: baseline;
    color: #E0E0E0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.file:hover {
    transform: translateX(5px);
    color: #fff;
}

.file i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

.file-comment {
    margin-left: 1rem;
    color: #7e7e7eb7;
    font-style: italic;
}

/* Icons for specific file types */
.file i.fab.fa-php {
    color: #777BB3;
}

.file i.fab.fa-js-square {
    color: #F7DF1E;
}

.file i.fab.fa-css3-alt {
    color: #264de4;
}

.code-snippet {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    position: relative; /* Add position relative */
}

.code-snippet code {
    font-family: 'JetBrains Mono', monospace;
    width: calc(100% - 35px); /* Give space for copy button */
    padding: 0;
    background: transparent;
    overflow-x: auto; /* Allow horizontal scrolling for long code */
    white-space: nowrap; /* Keep code on single line */
}

.copy-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: color 0.3s ease;
    position: absolute; /* Position absolutely */
    right: 25px;
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Perfect vertical centering */
    z-index: 5; /* Ensure button stays above code */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.copy-btn:hover {
    color: #5865F2;
    background-color: rgba(255,255,255,0.1);
}

.requirements-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.requirement {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.requirement-icon {
    font-size: 1.5rem;
    color: #5865F2;
    margin-right: 1rem;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #5865F2;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.github-btn:hover {
    background: #4752c4;
}

.author-info {
    text-align: right;
    color: rgba(255,255,255,0.7);
}

.author-info p {
    margin-bottom: 0.3rem;
}

.project-section ul,
.project-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.project-section li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.project-section p {
    margin-bottom: 1.5rem;
}

.project-section code {
    display: inline-block;
    margin: 0.5rem 0;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: monospace;
    width: 100%;
    font-size: 1.15rem;
}

.project-section pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
}

.project-section pre code {
    background: none;
    padding: 0;
    color: #fff;
}

.project-section a {
    color: #fff;
    text-decoration: none;
    transition: border-color 0.3s ease;
}

.project-section a:hover {
    border-color: rgba(255, 255, 255, 0.8);
}

/* Add animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content.expanded {
    animation: fadeIn 0.5s ease-out;
}

.fullscreen-image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    animation: fade-in 0.3s ease;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: zoom-in 0.3s ease;
}

/* Ajouter un curseur pointer aux images de démo pour indiquer qu'elles sont cliquables */
.demo-image {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.demo-image:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoom-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Improve mobile display */
@media (max-width: 768px) {
    .main-content {
        padding-top: calc(80px + 1rem);
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .portfolio-grid {
        gap: 1.5rem;
    }
    
    .project-title {
        font-size: 2rem;
    }
    
    .lead-text {
        font-size: 1.1rem;
    }
    
    .project-section {
        padding: 1.5rem;
        margin: 2rem 0; /* Smaller margins on mobile */
    }
    
    .project-footer {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start; /* Left align on mobile */
    }
    
    .author-info {
        text-align: left; /* Left align on mobile */
        margin-top: 1rem;
    }
    
    .features-grid,
    .tech-stack {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        height: 200px; /* Smaller header on mobile */
    }

    .project-title-container {
        padding: 1rem; /* Less padding on mobile */
    }

    .modal-content-info {
        padding: 1rem; /* Less padding on mobile */
    }

    .code-snippet {
        padding: 0.6rem; /* Smaller padding on mobile */
    }

    .code-snippet code {
        font-size: 0.9rem; /* Smaller font on mobile */
    }
    
    .installation-steps li {
        padding-left: 2.5rem; /* Less padding on mobile */
    }
    
    .requirement {
        width: 100%; /* Full width on mobile */
    }

    .copy-btn {
        right: 10px; /* Adjust position for mobile */
        width: 25px; /* Smaller button on mobile */
    }
    
    /* Fix modal display on mobile */
    .modal-content.expanded {
        width: 95vw;
        height: 85vh;
        border-radius: 8px; /* Smaller radius on mobile */
    }
    
    .badge {
        padding: 0.2rem 0.7rem; /* Smaller badges on mobile */
        font-size: 0.8rem;
    }

    .tech-badges {
        gap: 0.3rem; /* Less gap on mobile */
    }
    
    .portfolio-item {
        min-height: 320px; /* Height for mobile */
    }
    
    .portfolio-item img {
        height: 180px; /* Smaller images on mobile */
    }
}

/* Fix for very small screens */
@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    
    .portfolio-item {
        min-height: 300px;
        max-width: 100%; /* Ensure full width */
    }
    
    .portfolio-item img {
        height: 160px; /* Even smaller images on very small screens */
    }
    
    .project-title {
        font-size: 1.5rem; /* Even smaller title on very small screens */
    }
    
    .project-section h3 {
        font-size: 1.4rem; /* Smaller section headers */
    }
    
    .project-section h4 {
        font-size: 1.1rem; /* Smaller subsection headers */
    }
    
    .modal-header {
        height: 150px; /* Even smaller header */
    }
    
    .github-btn {
        width: 100%; /* Full width button on small screens */
        justify-content: center;
    }
    
    .close {
        right: 15px; /* Adjust close button position */
        top: 15px;
        font-size: 24px; /* Smaller close button */
    }
    
    .code-snippet code {
        font-size: 0.8rem; /* Even smaller code font */
    }
    
    .feature-icon {
        font-size: 2rem; /* Smaller feature icons */
    }
    
    .portfolio-item-info h2 {
        font-size: 1.1rem;
    }

    .portfolio-item-info p {
        font-size: 0.85rem;
    }
}


/* Footer styles */
footer {
    text-align: center;
    padding: 1rem;
    background-color: rgba(18, 18, 18, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive styles */
@media (max-width: 968px) {
    .contact-info {
        display: none;
    }
}

/* Hamburger menu improvements */
@media (max-width: 860px) {
    .nav-links {
        padding-top: 100px; /* More space at the top */
    }
    
    .nav-links a {
        margin-bottom: 0.8rem; /* Add space between links */
    }
    
    .hamburger {
        z-index: 1002; /* Ensure the hamburger is always on top */
    }
}