/* Portfolio Container */
.portfolio-container {
    padding: 32px 16px;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible !important; 
    position: relative; 
}

/* Projects container */
.projects-container {
    position: relative;
    width: 100%;
    padding: 40px 0;
    overflow: visible !important; 
    padding-bottom: 400px;
    z-index: 1; 
}

.project-card {
    position: relative; 
    width: 100%;
    background-color: #121212;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 180px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    background-color: #121212; 
    border-radius: 20px 20px 0 0;
    z-index: 10;
}

.project-categories-container,
.project-name-year-container {
    border: 1px solid #00F6A7;
    border-radius: 40px;
    padding: 8px 12px;
    font-size: 14px;
    color: white;
}

.project-info-mobile {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.project-name-container,
.project-year-container {
    border: 1px solid #00F6A7;
    border-radius: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.rotating-icon {
    animation: rotate 0.8s linear;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rotating-icon img {
    width: 30px;
    height: 30px;
}

/* Project Content Styles */
.project-content {
    display: flex;
    flex-direction: column;
    gap: 80px; 
    position: relative; 
    padding-top: 30px; /* Reduced from 40px to 20px */
}

.project-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    will-change: transform, opacity; 
    transform-origin: center top;
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
}

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

/* Only apply hover effect when not in stacking mode */
.project-card:not(.stacking) .project-image-container:hover .project-image {
    transform: scale(1.05);
}

/* Animation for rotating icon */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(90deg);
    }
}

/* Responsive Adjustments */ 
@media screen and (max-width: 1200px) {
    .portfolio-container {
        padding: 24px 16px;
    }
    
    .project-card {
        margin-bottom: 120px;
    }
}

@media screen and (max-width: 992px) {
    .project-content {
        gap: 60px;
    }
    
    .project-card {
        padding: 16px;
        margin-bottom: 100px;
    }
}

@media screen and (max-width: 768px) {
    .project-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .rotating-icon {
        display: none;
    }
    
    .portfolio-container,
    .projects-container {
        overflow: visible !important;
    }
    
    .project-card {
        margin-bottom: 40px;
        padding: 12px;
    }
    
    .project-content {
        gap: 40px;
        padding-top: 20px;
    }
    
    .project-image-container {
        margin-bottom: 10px;
        aspect-ratio: 4 / 3; /* Slightly different aspect ratio for mobile */
    }
    
    .project-header {
        padding: 10px;
    }
    
    .project-name-container,
    .project-year-container {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .portfolio-container {
        padding: 16px 12px;
    }
    
    .projects-container {
        padding: 20px 0;
        padding-bottom: 200px;
    }
    
    .project-card {
        border-radius: 16px;
        padding: 10px;
    }
    
    .project-content {
        gap: 30px;
    }
    
    .project-image-container {
        border-radius: 8px;
    }
}