/* filepath: /var/www/html/my_portfolio/project-cards.css */
/* Enhanced Modern Project Cards */
.project-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(31, 38, 135, 0.07);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    isolation: isolate;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.animate-in {
    animation: cardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--accent-pink));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(31, 38, 135, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.project-card .project-image-container {
    position: relative;
    overflow: hidden;
    height: 240px;
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95);
    position: relative;
    z-index: 1;
    opacity: 0;
}

.project-card img.loaded {
    opacity: 1;
    animation: imageFadeIn 0.5s ease forwards;
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modern Project Overlay */
.project-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.project-card:hover .project-overlay {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(5px);
}

.project-overlay h3 {
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.project-overlay p {
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
    font-size: 0.95rem;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

.project-overlay a {
    transform: translateY(20px);
    transition: transform 0.4s ease 0.3s, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 20;
}

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

/* Enhanced Project Card Content */
.project-card .project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    position: relative;
}

/* Enhanced Technology Tags */
.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-tech-tag {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-tech-tag::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.project-card:hover .project-tech-tag::before {
    left: 100%;
}

.project-tech-tag:hover {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Shimmer animation for top border */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Enhanced responsive grid for projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (min-width: 1280px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Enhanced project card animations */
.project-card {
    animation: projectCardFloat 12s ease-in-out infinite;
    animation-play-state: paused;
}

.project-card:hover {
    animation-play-state: running;
}

@keyframes projectCardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Enhanced focus states for accessibility */
.project-card:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    .project-card .project-image-container {
        height: 200px;
    }
    
    .project-overlay {
        padding: 1.5rem;
    }
    
    .project-overlay h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .project-overlay p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .project-card .project-content {
        padding: 1.25rem;
    }
}

@media (max-width: 640px) {
    .projects-grid {
        gap: 1.5rem;
    }
    
    .project-card .project-image-container {
        height: 180px;
    }
    
    .project-tech-tags {
        gap: 0.375rem;
    }
    
    .project-tech-tag {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .project-overlay h3 {
        font-size: 1.25rem;
    }
    
    .project-overlay p {
        font-size: 0.8rem;
    }
}

/* New improvements for better visibility and responsiveness */
.project-overlay {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.project-overlay a {
    background-color: #ffffff !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 2px solid transparent !important;
    text-decoration: none !important;
    position: relative;
    z-index: 30;
    font-size: 0.95rem;
}

.project-overlay a:hover {
    transform: translateY(-3px) scale(1.05) !important;
    background-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.project-overlay a:active {
    transform: translateY(0) scale(0.98) !important;
}

/* Improve color combinations */
.project-card:nth-child(1) .project-overlay {
    background: linear-gradient(to bottom, rgba(37, 99, 235, 0.85), rgba(79, 70, 229, 0.9)) !important;
}

.project-card:nth-child(2) .project-overlay {
    background: linear-gradient(to bottom, rgba(5, 150, 105, 0.85), rgba(37, 99, 235, 0.9)) !important;
}

.project-card:nth-child(3) .project-overlay {
    background: linear-gradient(to bottom, rgba(220, 38, 38, 0.85), rgba(139, 92, 246, 0.9)) !important;
}

.project-card:nth-child(4) .project-overlay {
    background: linear-gradient(to bottom, rgba(124, 58, 237, 0.85), rgba(79, 70, 229, 0.9)) !important;
}

.project-card:nth-child(5) .project-overlay {
    background: linear-gradient(to bottom, rgba(236, 72, 153, 0.85), rgba(37, 99, 235, 0.9)) !important;
}

.project-card:nth-child(6) .project-overlay {
    background: linear-gradient(to bottom, rgba(234, 179, 8, 0.85), rgba(37, 99, 235, 0.9)) !important;
}

/* Enhanced button styling */
.project-overlay a::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, var(--primary), var(--accent-purple), var(--accent-pink), var(--primary));
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 9999px;
    animation: animatedgradient 3s ease alternate infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-overlay a:hover::before {
    opacity: 1;
}

@keyframes animatedgradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Improve responsive behavior on small screens */
@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 0.5rem;
    }
    
    .project-card .project-image-container {
        height: 200px;
    }
    
    .project-overlay {
        opacity: 0;
        visibility: hidden;
        background-color: rgba(0, 0, 0, 0.8) !important;
    }
    
    .project-card:active .project-overlay,
    .project-card:focus .project-overlay,
    .project-card:focus-within .project-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .project-overlay h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .project-overlay p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        line-clamp: 3;
        box-orient: vertical;
        overflow: hidden;
    }
    
    .project-overlay a {
        padding: 0.5rem 1.25rem !important;
        font-size: 0.875rem;
        font-weight: 700 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    }
    
    .project-card {
        transition: transform 0.3s ease;
    }
    
    .project-card:active {
        transform: scale(0.98);
    }
}
