/* ============================================
   PROJECTS PAGE — Engineer's Portfolio
   ============================================ */

/* Page header overrides */
header {
    text-align: left;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    text-align: left;
}

.page-description {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 8px;
    max-width: 560px;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb a:hover {
    color: var(--text-color);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

/* Stats Section */
.stats-section {
    padding: 40px 0 56px;
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 20px 16px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-hover-shadow);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.025em;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Projects Header with Search and Filters */
.projects-header {
    margin-bottom: 32px;
}

.search-wrapper {
    position: relative;
    max-width: 480px;
    margin: 0 0 24px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.project-search {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.project-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.project-search::placeholder {
    color: var(--text-muted);
}

/* Filter Section */
.filter-section {
    margin-bottom: 20px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Results Info */
.results-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 10px 14px;
    background: var(--detail-bg);
    border-radius: 6px;
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.results-info span {
    font-weight: 600;
    color: var(--text-color);
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Project Cards on Projects page */
.projects-grid .project-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: fadeIn 0.3s ease;
}

.projects-grid .project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-hover-shadow);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.project-card-header svg {
    flex-shrink: 0;
    color: var(--text-muted);
    margin-top: 2px;
}

.project-card-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.projects-grid .project-card > p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    flex: 1;
}

/* Project Impact */
.project-impact {
    margin: 8px 0 12px;
    padding: 10px 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-left: 2px solid var(--border-color);
    background: var(--detail-bg);
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

/* Read more / View details */
.read-more {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    display: inline-block;
    margin: 8px 0;
    transition: color 0.15s ease;
}

.read-more:hover {
    color: var(--text-color);
}

.read-more::after {
    content: ' \2192';
}

.read-more.expanded::after {
    content: ' \2191';
}

/* Project details */
.project-details[hidden] {
    display: none;
}

.project-details {
    background: var(--detail-bg);
    padding: 16px;
    border-radius: 6px;
    margin: 8px 0 12px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border: 1px solid var(--border-color);
    animation: slideDown 0.2s ease;
}

.project-details strong {
    color: var(--text-color);
    font-weight: 600;
}

.key-features {
    margin-top: 12px;
}

.key-features strong {
    display: block;
    margin-bottom: 8px;
}

.key-features ul {
    padding-left: 18px;
}

.key-features li {
    margin-bottom: 4px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.8125rem;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-secondary);
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.no-results p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Call to Action Section */
.cta-section {
    text-align: center;
    padding: 48px 24px;
    background: var(--card-bg);
    border-radius: 8px;
    margin: 48px 0;
    border: 1px solid var(--card-border);
}

.cta-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.cta-section p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 10px 24px;
    background: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.cta-button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card.filtered-out {
    animation: fadeOut 0.15s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-number {
        font-size: 1.375rem;
    }

    .stat-card {
        padding: 16px 8px;
    }

    .search-wrapper {
        margin-bottom: 20px;
    }

    .project-search {
        padding: 10px 16px 10px 38px;
        font-size: 0.875rem;
    }

    .filter-section {
        margin-bottom: 16px;
    }

    .filter-label {
        font-size: 0.6875rem;
        margin-bottom: 8px;
    }

    .project-filters {
        gap: 6px;
    }

    .filter-btn {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .results-info {
        font-size: 0.8125rem;
        padding: 8px 12px;
    }

    .project-impact {
        font-size: 0.75rem;
        padding: 8px 10px;
    }

    .cta-section {
        padding: 32px 20px;
        margin: 32px 0;
    }

    .cta-section h2 {
        font-size: 1.125rem;
    }

    .cta-section p {
        font-size: 0.875rem;
    }

    .cta-button {
        padding: 10px 20px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .breadcrumb {
        font-size: 0.8125rem;
    }
}
