/* ============================================
   MINIMALIST PROJECT CARDS - 2026 STYLE
   Grid view optimized for 50+ projects
   ============================================ */

/* === SECTION LAYOUT === */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* === FILTERS === */
.projects-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--border-primary);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(139, 92, 246, 0.1);
}

.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* === SECTION SPACING === */
.featured-section {
    margin-bottom: 4rem;
}

.subsection-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-primary);
}

/* === GRID LAYOUT - ZOOM-PROOF CENTERED === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    justify-content: center;    /* Centers grid tracks */
    justify-items: center;      /* Centers items in cells */
    gap: 2rem;
    margin: 2rem auto;          /* Centers grid container */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure section containers don't interfere */
.featured-section,
.all-projects-section {
    padding: 6rem 0;
    width: 100%;
    overflow-x: hidden;       /* Prevent horizontal scroll */
}

/* Large screens: prefer 3 columns max */
@media (min-width: 1400px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 400px));
        max-width: 1400px;
        margin: 2rem auto;
    }
}

/* Tablet: 2 columns */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* === MINIMALIST PROJECT CARD === */
.project-card-minimal {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;              /* Fill grid cell */
    max-width: 100%;          /* Don't exceed cell */
    margin: 0;                /* No margins - grid handles spacing */
    justify-self: center;     /* Center within grid cell */
    align-self: start;        /* Align to top of cell */
}

.project-card-minimal:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
}

/* === CARD IMAGE === */
.project-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-minimal:hover .project-image {
    transform: scale(1.05);
}

/* Image overlay on hover */
.project-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem;
}

.project-card-minimal:hover .project-image-overlay {
    opacity: 1;
}

.overlay-text {
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overlay-text svg {
    width: 20px;
    height: 20px;
}

/* === STATUS BADGES === */
.project-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.project-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-featured {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.badge-completed {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.badge-in-progress {
    background: rgba(139, 92, 246, 0.9);
    color: white;
}

/* === CARD CONTENT === */
.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === TECH TAGS === */
.project-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag-minimal {
    font-size: 0.75rem;
    color: var(--color-primary-light);
    opacity: 0.9;
    white-space: nowrap;
}

.tech-tag-minimal::after {
    content: '·';
    margin-left: 0.5rem;
    opacity: 0.5;
}

.tech-tag-minimal:last-child::after {
    content: '';
}

/* === TAGLINE === */
.project-tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === FOOTER === */
.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-secondary);
    margin-top: auto;
}

.project-category {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
}

.project-date {
    opacity: 0.8;
}

/* === LOADING SKELETON - CENTERED === */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    justify-content: center;
    justify-items: center;
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
}

.skeleton-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    overflow: hidden;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    width: 100%;
    max-width: 100%;
    justify-self: center;
}

/* Responsive skeleton */
@media (max-width: 1200px) {
    .loading-skeleton {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .loading-skeleton {
        grid-template-columns: 1fr;
    }
}

.skeleton-card::before {
    content: '';
    display: block;
    padding-top: 140%; /* Approximate card aspect ratio */
    background: linear-gradient(
        90deg,
        transparent,
        rgba(139, 92, 246, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* === EMPTY STATE === */
.projects-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.projects-empty h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.projects-empty p {
    color: var(--text-muted);
}

/* ============================================
   IMAGE PLACEHOLDER STYLES
   For projects without images
   ============================================ */

/* Placeholder container with gradient */
.project-image-wrapper.no-image {
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.2) 0%, 
        rgba(245, 158, 11, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated gradient background */
.project-image-wrapper.no-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(245, 158, 11, 0.3) 0%, transparent 50%);
    animation: shimmerGradient 8s ease infinite;
}

@keyframes shimmerGradient {
    0%, 100% { 
        opacity: 0.5;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Placeholder content */
.project-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    z-index: 1;
    position: relative;
}

/* Icon circle */
.placeholder-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.project-card-minimal:hover .placeholder-icon {
    transform: scale(1.1) rotate(5deg);
}

.placeholder-icon svg {
    width: 40px;
    height: 40px;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2;
}

/* Project title in placeholder */
.placeholder-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    line-height: 1.3;
}

/* Hide broken images gracefully */
.project-image[style*="display: none"] {
    display: none !important;
}

/* Ensure placeholder shows when image fails */
img.project-image[style*="display: none"] ~ .project-image-placeholder {
    display: flex;
}