/*
====================================
PageYaRona - Projects Page Styles
====================================
Purpose: Dedicated stylesheet for projects.html
Performance: Modular CSS for better loading and maintainability
Last Updated: October 2025
*/

/* 
=====================================
1. PROJECT PAGE HERO SECTION
=====================================
*/
.projects-hero {
    padding: 100px 0 80px 0;
    background: linear-gradient(135deg, var(--page-bg) 0%, var(--subtle-bg) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.projects-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern-dots.svg') repeat;
    opacity: 0.05;
    z-index: 1;
}

.projects-hero .container {
    position: relative;
    z-index: 2;
}

.projects-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--c-accent), var(--heading-color));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.projects-hero .lead {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-color);
    opacity: 0.9;
}

.projects-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--c-accent);
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

/* 
=====================================
2. PROJECT GALLERY SECTION
=====================================
*/
.projects-gallery {
    padding: 80px 0;
    background-color: var(--page-bg);
}

.gallery-filter {
    text-align: center;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    margin: 0.25rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--c-accent);
    border-color: var(--c-accent);
    color: var(--c-text-dark);
    transform: translateY(-2px);
}

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

/* 
=====================================
3. PROJECT CARDS
=====================================
*/
.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--c-accent);
}

.project-image-container {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--subtle-bg);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(30, 67, 74, 0.9),
        rgba(105, 203, 192, 0.8)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.project-card:hover .overlay-content {
    transform: translateY(0);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
    line-height: 1.3;
}

.project-description {
    color: var(--text-color);
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tag {
    background: var(--subtle-bg);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.project-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-project {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-case-study {
    background: var(--c-accent);
    color: var(--c-text-dark);
    border: 2px solid var(--c-accent);
}

.btn-case-study:hover {
    background: var(--c-accent-hover);
    border-color: var(--c-accent-hover);
    color: var(--c-text-dark);
    transform: translateY(-2px);
}

.btn-view-site {
    background: transparent;
    color: var(--c-accent);
    border: 2px solid var(--c-accent);
}

.btn-view-site:hover {
    background: var(--c-accent);
    color: var(--c-text-dark);
    transform: translateY(-2px);
}

/* 
=====================================
4. PROJECT SWIPER SLIDER
=====================================
*/
.project-slider-section {
    padding: 80px 0;
    background: var(--subtle-bg);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--heading-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.project-swiper {
    width: 100%;
    padding: 50px 0;
    overflow: visible;
}

.project-swiper .swiper-slide {
    width: 380px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.7;
    transform: scale(0.9);
}

.project-swiper .swiper-slide-active {
    opacity: 1;
    transform: scale(1);
}

.project-swiper .swiper-slide-next,
.project-swiper .swiper-slide-prev {
    opacity: 0.8;
    transform: scale(0.95);
}

/* Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    color: var(--c-accent) !important;
    font-weight: 900;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    background: var(--card-bg);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 18px;
    font-weight: 900;
}

/* 
=====================================
5. CALL-TO-ACTION SECTION
=====================================
*/
.projects-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--c-headline), var(--c-accent));
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.projects-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern-circuit.svg') repeat;
    opacity: 0.1;
    z-index: 1;
}

.projects-cta .container {
    position: relative;
    z-index: 2;
}

.projects-cta h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.projects-cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-cta-primary {
    background: white;
    color: var(--c-headline);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.btn-cta-primary:hover {
    background: transparent;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.btn-cta-secondary {
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
    transform: translateY(-3px);
}

/* 
=====================================
6. RESPONSIVE DESIGN
=====================================
*/
@media (max-width: 768px) {
    .projects-hero {
        padding: 80px 0 60px 0;
    }
    
    .projects-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-swiper .swiper-slide {
        width: 320px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .projects-hero h1 {
        font-size: 2.2rem;
    }
    
    .projects-hero .lead {
        font-size: 1.1rem;
    }
    
    .project-actions {
        flex-direction: column;
    }
    
    .project-swiper .swiper-slide {
        width: 280px;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
}

/* 
=====================================
7. DARK MODE OPTIMIZATIONS
=====================================
*/
body.dark-mode .projects-hero {
    background: linear-gradient(135deg, var(--page-bg) 0%, var(--subtle-bg) 100%);
}

body.dark-mode .project-overlay {
    background: linear-gradient(
        45deg,
        rgba(18, 18, 18, 0.9),
        rgba(105, 203, 192, 0.8)
    );
}

body.dark-mode .projects-cta {
    background: linear-gradient(135deg, var(--c-text-dark), var(--c-accent));
}

/* 
=====================================
8. PERFORMANCE OPTIMIZATIONS
=====================================
*/
.project-image {
    content-visibility: auto;
    contain-intrinsic-size: 350px 220px;
}

.project-card {
    contain: layout style paint;
}

/* Preload critical images */
.project-image[data-src] {
    background: var(--subtle-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='%23f4f4f4'%3E%3Cpath d='M20 20v-8a8 8 0 0 1 8 8h-8z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* 
=====================================
9. ACCESSIBILITY IMPROVEMENTS
=====================================
*/
.project-card {
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 0.3s ease;
}

.project-card:focus-within {
    outline-color: var(--c-accent);
}

.btn-project:focus {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .project-card {
        border-width: 2px;
    }
    
    .project-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .project-card,
    .project-image,
    .btn-project {
        transition: none;
    }
    
    .project-card:hover {
        transform: none;
    }
    
    .project-card:hover .project-image {
        transform: none;
    }
}