/* Projects Page Specific Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #8A2BE2;
    --secondary: #4B0082;
    --dark: #1A001A;
    --light: #F8F0FF;
    --accent: #FF6BCB;
}

body {
    background: linear-gradient(135deg, var(--dark), var(--secondary), var(--primary));
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Projects Page Specific Styles */

.projects-hero {
    text-align: center;
    padding: 80px 0 40px 0;
}

.projects-title {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.projects-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.projects-section {
    padding: 40px 0 80px 0;
}

/* 3x3 Grid Layout - CENTERED with SMALLER CARDS */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 320px)); /* Smaller fixed width */
    gap: 25px;
    margin-top: 40px;
    justify-content: center; /* Center the grid */
    align-items: start;
}

.project-card {
    background: rgba(26, 0, 26, 0.7);
    border-radius: 16px; /* Slightly smaller radius */
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 43, 226, 0.3);
    transition: all 0.3s ease;
    position: relative;
    height: 420px; /* Fixed smaller height */
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(255, 107, 203, 0.2);
}

.project-img {
    height: 160px; /* Smaller image height */
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.project-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(138, 43, 226, 0.3), rgba(255, 107, 203, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-img::before {
    opacity: 1;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.08);
}

.project-info {
    padding: 20px; /* Smaller padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Fill remaining space */
    overflow: hidden; /* Prevent content overflow */
}

.project-info h3 {
    font-size: 1.2rem; /* Slightly smaller font */
    margin-bottom: 10px;
    color: var(--accent);
    font-weight: 700;
    line-height: 1.3;
}

.project-info p {
    margin-bottom: 15px;
    opacity: 0.9;
    font-size: 0.9rem; /* Slightly smaller font */
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden; /* Prevent text overflow */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Smaller gap */
    margin-bottom: 15px;
    justify-content: flex-start;
}

.project-tech span {
    background: rgba(138, 43, 226, 0.2);
    color: var(--accent);
    padding: 4px 10px; /* Smaller padding */
    border-radius: 14px;
    font-size: 0.7rem; /* Smaller font */
    font-weight: 600;
    border: 1px solid rgba(255, 107, 203, 0.3);
    transition: all 0.3s ease;
}

.project-tech span:hover {
    background: rgba(255, 107, 203, 0.3);
    transform: translateY(-2px);
}

.btn {
    display: inline-block;
    padding: 8px 20px; /* Smaller padding */
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: var(--light);
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem; /* Smaller font */
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: center;
    width: 100%;
    margin-top: auto; /* Push to bottom */
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 107, 203, 0.4);
}

/* Responsive Design for 3x3 Grid */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(280px, 320px)); /* Keep smaller cards */
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: minmax(280px, 350px); /* Single column but still smaller */
        gap: 20px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .projects-title {
        font-size: 2.2rem;
    }
    
    .projects-subtitle {
        font-size: 1.1rem;
    }
    
    .project-card {
        height: 400px; /* Slightly smaller on mobile */
    }
    
    .project-img {
        height: 150px;
    }
    
    .project-info {
        padding: 18px;
    }
}

@media (max-width: 576px) {
    .projects-hero {
        padding: 60px 0 30px 0;
    }
    
    .projects-title {
        font-size: 2rem;
    }
    
    .projects-subtitle {
        font-size: 1rem;
    }
    
    .project-card {
        height: 380px; /* Even smaller on very small screens */
    }
    
    .project-img {
        height: 140px;
    }
    
    .project-info {
        padding: 16px;
    }
    
    .project-info h3 {
        font-size: 1.1rem;
    }
    
    .project-tech {
        gap: 5px;
    }
    
    .project-tech span {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    .btn {
        padding: 7px 16px;
        font-size: 0.8rem;
    }
}

/* Ensure exactly 9 projects for perfect 3x3 grid */
.projects-grid:has(.project-card:nth-child(9)) .project-card:nth-child(n+10) {
    display: none;
}