/* Modern Projects Section Redesign */

/* Projects Section Background */
#projects {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
}

#projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 199, 255, 0.3) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* Section Header */
#projects .inner > h2 {
    color: #ffffff;
    font-size: 4rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 10;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
}

#projects .inner > p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
    line-height: 1.6;
    font-weight: 300;
}

/* Project Cards Container */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

/* Individual Project Card */
.project-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 0;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 12px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(60px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.2),
        0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Project Header */
.project-header {
    display: flex;
    align-items: center;
    padding: 3rem 3rem 2rem 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.project-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 3rem;
    right: 3rem;
    height: 3px;
    background: var(--project-color, #3b82f6);
    border-radius: 3px;
}

/* Project Icon */
.project-icon {
    width: 80px;
    height: 80px;
    background: var(--project-color, #3b82f6);
    background: linear-gradient(135deg, var(--project-color, #3b82f6), var(--project-color-dark, #2563eb));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.project-card:hover .project-icon::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

.project-icon i {
    font-size: 2.5rem;
    color: #ffffff;
    z-index: 2;
    position: relative;
}

.project-card:hover .project-icon {
    transform: rotate(-5deg) scale(1.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Project Title and Meta */
.project-title-section h2 {
    color: #1a202c;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

.meta-item {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Project Content */
.project-content {
    padding: 2.5rem 3rem 3rem 3rem;
}

.project-section {
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

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

.project-card.animate-in .project-section:nth-child(1) { transition-delay: 0.1s; }
.project-card.animate-in .project-section:nth-child(2) { transition-delay: 0.2s; }
.project-card.animate-in .project-section:nth-child(3) { transition-delay: 0.3s; }
.project-card.animate-in .project-section:nth-child(4) { transition-delay: 0.4s; }

.section-title {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    position: relative;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--project-color, #3b82f6);
    border-radius: 2px;
    margin-right: 0.75rem;
}

.section-content {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Achievement List */
.achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.achievement-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 12px;
    border-left: 4px solid #10b981;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(16, 185, 129, 0.1);
    transition: width 0.3s ease;
}

.achievement-item:hover::before {
    width: 100%;
}

.achievement-item:hover {
    transform: translateX(8px);
    background: rgba(16, 185, 129, 0.1);
}

.achievement-icon {
    color: #10b981;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    margin-top: 0.1rem;
    position: relative;
    z-index: 2;
}

.achievement-text {
    flex: 1;
    color: #374151;
    line-height: 1.6;
    font-size: 0.95rem;
    position: relative;
    z-index: 2;
}

/* Tech Stack */
.tech-stack {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.tech-stack::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: techGlow 3s ease-in-out infinite;
}

@keyframes techGlow {
    0%, 100% { transform: scale(0.8) rotate(0deg); opacity: 0.5; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

/* Impact Section */
.impact-metric {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    padding: 1.5rem;
    border-radius: 16px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
    border: 2px solid rgba(251, 191, 36, 0.2);
}

/* Project Categories with Color Schemes */
.clinical-project {
    --project-color: #10b981;
    --project-color-dark: #059669;
}

.ai-project {
    --project-color: #8b5cf6;
    --project-color-dark: #7c3aed;
}

.infrastructure-project {
    --project-color: #3b82f6;
    --project-color-dark: #2563eb;
}

.healthcare-project {
    --project-color: #ef4444;
    --project-color-dark: #dc2626;
}

.research-project {
    --project-color: #f59e0b;
    --project-color-dark: #d97706;
}

.automation-project {
    --project-color: #6366f1;
    --project-color-dark: #4f46e5;
}

.analytics-project {
    --project-color: #06b6d4;
    --project-color-dark: #0891b2;
}

.integration-project {
    --project-color: #84cc16;
    --project-color-dark: #65a30d;
}

/* Responsive Design */
@media (max-width: 768px) {
    #projects {
        padding: 4rem 0;
    }
    
    #projects .inner > h2 {
        font-size: 2.8rem;
    }
    
    #projects .inner > p {
        font-size: 1.2rem;
        margin-bottom: 3rem;
    }
    
    .projects-grid {
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .project-header {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }
    
    .project-icon {
        margin-right: 0;
        margin-bottom: 1.5rem;
        width: 70px;
        height: 70px;
    }
    
    .project-icon i {
        font-size: 2rem;
    }
    
    .project-title-section h2 {
        font-size: 1.8rem;
    }
    
    .project-content {
        padding: 2rem;
    }
    
    .project-meta-info {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .meta-item {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .project-header {
        padding: 1.5rem;
    }
    
    .project-content {
        padding: 1.5rem;
    }
    
    .project-title-section h2 {
        font-size: 1.6rem;
    }
    
    .achievement-item {
        padding: 0.75rem;
    }
    
    .tech-stack,
    .impact-metric {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Scroll Animation Enhancements */
.projects-container {
    position: relative;
    z-index: 5;
}

.project-card {
    animation-fill-mode: forwards;
}

/* Loading State */
.project-loading {
    opacity: 0.7;
    pointer-events: none;
}

.project-loading .project-content {
    position: relative;
    overflow: hidden;
}

.project-loading .project-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Accessibility Enhancements */
.project-card:focus-within {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    
    .project-card {
        opacity: 1;
        transform: none;
    }
}