/* ===================================
   PROJECTS PAGE SPECIFIC STYLES
   =================================== */

/* Page Header */
.page-header {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    margin-top: 80px;
}

.page-header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(34, 34, 36, 0.9) 0%,
        rgba(18, 17, 19, 0.9) 100%
    ),
    url('../images/projects-header-bg.jpg') center/cover no-repeat;
    z-index: -1;
}

.page-header-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.page-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.page-title-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.page-title-line:nth-child(2) {
    animation-delay: 0.2s;
}

.page-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto;
}

/* Filter Section */
.filter-section {
    padding: 3rem 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    color: #666;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-btn:hover,
.filter-btn:focus {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.filter-btn--active {
    background-color: #667eea;
    color: #fff;
    border-color: #667eea;
}

.filter-btn--active:hover {
    background-color: #764ba2;
    border-color: #764ba2;
}

.filter-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Projects Section */
.projects-section {
    padding: 6rem 0;
    background-color: #fff;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.project-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

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

.project-image {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
}

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

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-view-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-view-btn:hover,
.project-view-btn:focus {
    background: #fff;
    transform: scale(1.1);
}

.project-view-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.project-content {
    padding: 2rem;
}

.project-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.project-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.6em * 6); /* Fallback for browsers without webkit-line-clamp support */
}

.project-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.project-detail:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
}

.detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

/* Project Gallery */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.project-gallery img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Filter Animation */
.projects-grid.filtering {
    pointer-events: none;
}

.project-card.fade-out {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.project-card.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease 0.1s;
}

/* Responsive Design */
@media (max-width: 968px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
    }
    
    .filter-controls {
        gap: 0.75rem;
    }
    
    .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 640px) {
    .page-header {
        min-height: 50vh;
        margin-top: 70px;
    }
    
    .filter-section {
        padding: 2rem 0;
    }
    
    .projects-section {
        padding: 4rem 0;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-content {
        padding: 1.5rem;
    }
    
    .project-title {
        font-size: 1.25rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .project-gallery {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .project-gallery img {
        height: 80px;
    }
}

/* Animation stagger */
.project-card:nth-child(1).animate-in { transition-delay: 0.1s; }
.project-card:nth-child(2).animate-in { transition-delay: 0.2s; }
.project-card:nth-child(3).animate-in { transition-delay: 0.3s; }
.project-card:nth-child(4).animate-in { transition-delay: 0.4s; }
.project-card:nth-child(5).animate-in { transition-delay: 0.5s; }
.project-card:nth-child(6).animate-in { transition-delay: 0.6s; }

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .page-title-line {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .project-card,
    .project-image img,
    .project-overlay,
    .project-view-btn {
        transition: none;
    }
    
    .project-card:hover {
        transform: none;
    }
    
    .project-card:hover .project-image img {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .project-card {
        border: 2px solid #333;
    }
    
    .filter-btn {
        border-width: 3px;
    }
    
    .project-detail {
        border-bottom-width: 2px;
    }
}

/* Print styles */
@media print {
    .filter-section,
    .load-more-container {
        display: none;
    }
    
    .projects-section {
        padding: 2rem 0;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-overlay {
        display: none;
    }
}
