/* Projects Section - Modern Masonry-Style Layout */
.projects {
    background: var(--bg-secondary);
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 5rem;
}

/* Projects Category - Stacked Layout */
.projects-category {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
}

.projects-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--accent-primary);
}

/* Projects Scroll Container - Grid Layout */
.projects-scroll-container {
    width: 100%;
}

/* Featured Projects Grid - Responsive Layout */
.featured-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Featured Project Card - Enhanced Design */
.featured-project {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow-sm);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Animated gradient border on hover */
.featured-project::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 28px;
    padding: 2px;
    background: var(--gradient-accent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.featured-project:hover::before {
    opacity: 1;
}

.featured-project:hover {
    box-shadow: 0 20px 60px var(--shadow-xl);
    transform: translateY(-8px) scale(1.01);
    border-color: var(--accent-primary);
}

.featured-project-header {
    margin-bottom: 1.5rem;
}

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

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    line-height: 1.2;
}

/* Role Badges - Very Subtle */
.badge.architect {
    background: rgba(39, 174, 96, 0.08);
    color: #2ecc71;
    border: none;
}

.badge.maintainer {
    background: rgba(52, 152, 219, 0.08);
    color: #3498db;
    border: none;
}

.badge.contributor {
    background: rgba(155, 89, 182, 0.08);
    color: #9b59b6;
    border: none;
}

/* Status Badges - Clean Solid */
.badge.production {
    background: #2ecc71;
    color: white;
    border: none;
}

.badge.ready {
    background: #e67e22;
    color: white;
    border: none;
}

.badge.internal {
    background: #7f8c8d;
    color: white;
    border: none;
}

.badge.mobile {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15) 0%, rgba(155, 89, 182, 0.1) 100%);
    color: var(--accent-secondary);
    border: 1.5px solid rgba(155, 89, 182, 0.3);
}

.featured-project-header h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

/* Project category (now the main title) */
.featured-project-header h3.project-category {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

/* Project name (hidden by default, shown on hover) */
.project-name {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: 2px solid transparent;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent-primary);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    border-right: none;
    border-bottom: none;
    padding-left: 0.5rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    position: relative;
}

.project-name::before {
    content: '↗';
    margin-right: 0.5rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.featured-project:hover .project-name {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top-color: var(--border-light);
    border-left-color: var(--accent-primary);
    opacity: 1;
    max-height: 100px;
}

.project-name:hover {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.project-name:hover::before {
    opacity: 1;
    transform: translateX(2px);
}

/* Project Private Message Modal */
.project-private-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.project-message-content {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 64px var(--shadow-xl);
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.project-message-content h4 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.project-message-content p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.project-message-contact {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
}

.project-message-contact strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.project-message-contact-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-message-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.project-impact {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-variant-numeric: tabular-nums;
}

/* Highlight key impacts in project descriptions */
.project-impact mark,
.project-impact strong {
    color: var(--text-primary);
    font-weight: 600;
    background: rgba(52, 152, 219, 0.12);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    display: inline-block;
    margin: 0 0.1rem;
    border-left: 2px solid rgba(52, 152, 219, 0.3);
}

.project-impact mark {
    background: rgba(39, 174, 96, 0.12);
    border-left-color: rgba(39, 174, 96, 0.3);
    color: var(--accent-success);
}

.project-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
}

.highlight-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.highlight-item strong {
    color: var(--text-secondary);
    font-weight: 700;
    min-width: 100px;
}

/* Backend Projects Hidden State */
.backend-project-hidden {
    display: none;
}

.backend-project-hidden.show {
    display: flex;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Projects Hidden State */
.mobile-project-hidden {
    display: none;
}

.mobile-project-hidden.show {
    display: flex;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Projects Action Button */
.projects-action {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.show-more-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.4);
}

.show-more-btn.expanded {
    background: var(--accent-primary);
    color: white;
}

.show-more-btn .btn-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.show-more-btn:hover .btn-icon {
    transform: translateY(2px);
}

.show-more-btn.expanded .btn-icon {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 992px) {
    .featured-projects {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .projects-category {
        margin-bottom: 3rem;
    }
    
    .featured-project {
        padding: 1.75rem;
    }
}

@media (max-width: 768px) {
    .projects {
        padding: 4rem 0;
    }
    
    .category-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .featured-project-header h3 {
        font-size: 1.5rem;
    }
    
    .featured-projects {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .featured-project {
        padding: 1.5rem;
    }
    
    .highlight-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .highlight-item strong {
        min-width: auto;
    }
}
