@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #1F2937;
    color: #CBD5E0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

a {
    text-decoration: none;
    transition: color 0.2s;
}

/* --- Navigation Bar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: #CBD5E0;
}

.nav-link {
    color: #94A3B9;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    color: #55D5CB;
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 4rem 1rem 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    color: #CBD5E0;
    margin-bottom: 0.5rem;
}

.hero p {
    color: #94A3B9;
    font-size: 1.1rem;
}

/* --- Filter Bar --- */
.filter-container {
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    margin-right: 0.5rem;
    align-self: center;
    font-weight: 600;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B9;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #55D5CB;
    color: #55D5CB;
}

.filter-btn.active {
    background: #55D5CB;
    border-color: #55D5CB;
    color: #1F2937;
    font-weight: 600;
}

/* --- Projects Grid (UPDATED FOR 3 COLUMNS) --- */
.projects-container {
    max-width: 1280px; /* Slightly wider to accommodate 3 columns comfortably */
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile default: 1 column */
    gap: 2rem;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns (The requirement) */
@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Screens: Optional 4 columns if you have many projects */
@media (min-width: 1536px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* --- Project Card --- */
.project-card {
    background-color: #2D3748;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards in a row are same height */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(85, 213, 203, 0.3);
}

.project-card.hidden {
    display: none;
}

.card-image {
    width: 100%;
    height: 220px; /* Reduced from 400px for better balance */
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes the button to the bottom */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 10px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #CBD5E0;
    margin: 0;
    line-height: 1.3;
}

.card-year {
    font-size: 0.75rem;
    color: #64748B;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.card-desc {
    font-size: 0.9rem;
    color: #A0AEC0;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* --- Tech Badges --- */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.tech-badge {
    font-size: 0.7rem;
    color: #55D5CB;
    background: rgba(85, 213, 203, 0.1);
    padding: 4px 8px;
    border-radius: 99px;
    font-weight: 500;
}

/* --- Card Links --- */
.card-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #CBD5E0;
    font-weight: 500;
}

.link-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.link-btn:hover {
    color: #55D5CB;
}

.link-btn.disabled {
    color: #64748B;
    cursor: default;
    font-style: italic;
}
.link-btn.disabled:hover {
    color: #64748B;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748B;
    font-size: 0.9rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #94A3B9;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 2rem;
    display: none;
}
.empty-state.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}
.empty-state h3 {
    font-size: 1.5rem;
    color: #CBD5E0;
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .filter-container { align-items: flex-start; }
}