/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #1f2937;
    --accent: #f59e0b;
    --light-bg: #f9fafb;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 100px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    padding: 12px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #d97706;
}

/* Featured Section */
.featured {
    background-color: var(--light-bg);
    padding: 60px 20px;
}

.featured h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Topics Section */
.topics-section {
    padding: 60px 20px;
}

.topics-section h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.topic-card {
    background: var(--white);
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 300px;
}

.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.topic-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
    flex-shrink: 0;
}

.topic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.topic-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    overflow: hidden;
}

.topic-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.topic-description {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.5;
    flex-grow: 1;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.topic-project-count {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-top: 0.5rem;
    color: var(--text-light);
}

/* Projects Section */
.projects-section {
    padding: 60px 20px;
}

.projects-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Search & Filter Controls */
.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
}

.sort-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--white);
    transition: border-color 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    padding: 6px 12px;
    background-color: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.filter-tag:hover {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--white);
}

.filter-tag.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    font-weight: bold;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.project-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    display: inline-block;
    background-color: var(--light-bg);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.project-link:hover {
    color: var(--primary-dark);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* About Section */
.about {
    background-color: var(--light-bg);
    padding: 60px 20px;
}

.about h2,
.contact h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.about-content,
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-light);
    line-height: 1.8;
}

/* Contact Section */
.contact {
    padding: 60px 20px;
}

.contact-content a {
    color: var(--primary);
    text-decoration: none;
}

.contact-content a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

/* Project Detail Page */
.project-detail {
    padding: 2rem 0;
}

.detail-header {
    background-color: var(--light-bg);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.header-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin: 0;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.detail-meta span {
    display: flex;
    gap: 0.5rem;
}

.detail-body {
    max-width: 800px;
    margin: 0 auto;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.detail-section p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tech-item {
    background-color: var(--light-bg);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.links-section {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary);
    color: var(--white);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: #111827;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .controls {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .detail-header h1 {
        font-size: 1.75rem;
    }

    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
