/* ----- PROJECTS PAGE STYLES ----- */

/* Projects Header */
.projects-header {
    padding-top: 2em;
    padding-bottom: 3em;
}

.projects-header .top-header {
    margin-bottom: 0;
}

/* Projects Section */
.projects-section {
    padding-bottom: 5em;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Project Card */
.project-card {
    background: var(--color-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 1px 8px 10px 2px var(--first-shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 2px 15px 25px 5px rgba(0, 0, 0, 0.15);
}

/* Project Image */
.project-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

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

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

/* Project Overlay */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(110, 87, 224, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-links {
    display: flex;
    gap: 20px;
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--color-white);
    border-radius: 50%;
    color: var(--first-color);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-link:hover {
    background: var(--first-color);
    color: var(--color-white);
    transform: scale(1.1);
}

.project-link i {
    font-size: 20px;
}

/* Project Content */
.project-content {
    padding: 25px;
}

.project-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color-second);
    margin-bottom: 15px;
    line-height: 1.3;
}

.project-content p {
    font-size: 14px;
    color: #777;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Project Technologies */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tech span {
    font-size: 12px;
    background: var(--first-color);
    color: var(--color-white);
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 500;
}

/* Dark Mode Styles */
body.dark-mode .project-card {
    background: #1a1a1a;
    box-shadow: 1px 8px 10px 2px rgba(255, 255, 255, 0.05);
}

body.dark-mode .project-card:hover {
    box-shadow: 2px 15px 25px 5px rgba(255, 255, 255, 0.1);
}

body.dark-mode .project-content h3 {
    color: #f5f5f5;
}

body.dark-mode .project-content p {
    color: #ccc;
}

body.dark-mode .project-link {
    background: #2a2a2a;
    color: var(--first-color);
}

body.dark-mode .project-link:hover {
    background: var(--first-color);
    color: var(--color-white);
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 20px;
    }
    
    .project-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .project-image {
        height: 200px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .project-content h3 {
        font-size: 20px;
    }
    
    .project-links {
        gap: 15px;
    }
    
    .project-link {
        width: 45px;
        height: 45px;
    }
    
    .project-link i {
        font-size: 18px;
    }
}

@media only screen and (max-width: 480px) {
    .projects-grid {
        padding: 0 10px;
    }
    
    .project-content {
        padding: 15px;
    }
    
    .project-content h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .project-content p {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .project-tech span {
        font-size: 11px;
        padding: 3px 10px;
    }
}

/* Animation for project cards on scroll */
@media (prefers-reduced-motion: no-preference) {
    .project-card {
        opacity: 0;
        transform: translateY(30px);
        animation: fadeInUp 0.6s ease forwards;
    }
    
    .project-card:nth-child(1) { animation-delay: 0.1s; }
    .project-card:nth-child(2) { animation-delay: 0.2s; }
    .project-card:nth-child(3) { animation-delay: 0.3s; }
    .project-card:nth-child(4) { animation-delay: 0.4s; }
    .project-card:nth-child(5) { animation-delay: 0.5s; }
    .project-card:nth-child(6) { animation-delay: 0.6s; }
}

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

/* Placeholder for project images */
.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
    z-index: 1;
}

.project-image img {
    position: relative;
    z-index: 2;
}

/* If no image is available, show a gradient background */
.project-image:empty::before {
    opacity: 0.3;
}