/* Featured project styles - Move to top of file and ensure specificity */
.project-card.featured {
    border: 2px solid rgba(255, 187, 0, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
    order: -1; /* Ensure featured projects appear first */
}

.project-card.featured:hover {
    border-color: rgba(255, 187, 0, 0.6);
    box-shadow: 0 8px 30px rgba(255, 187, 0, 0.1);
}

/* Featured badge - increase specificity and z-index */
.projects-grid .project-card.featured .featured-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(255, 187, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 3; /* Ensure badge appears above all other elements */
}

/* Glimmer effect - update z-index */
.project-card.featured::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 187, 0, 0.5),
        transparent
    );
    opacity: 0;
    z-index: 2;
    animation: glimmer 3s infinite;
    pointer-events: none;
    will-change: transform;
}

@keyframes glimmer {
    0% {
        opacity: 0;
        transform: translateX(-100%) translateZ(0);
    }
    20% {
        opacity: 0.5;
    }
    80% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translateX(100%) translateZ(0);
    }
}

.projects-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

/* Remove or comment out existing .filter-btn styles */
/* .filter-btn {
    // Previous styles that are no longer needed.
} */

/* Projects grid */
.projects-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Project cards */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    cursor: default !important; /* Force remove pointer cursor since cards are not clickable */
}

/* Project links */
.project-links a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    transition: all var(--transition-normal);
    cursor: pointer !important; /* Force pointer cursor on links */
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(var(--primary-rgb), 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.1);
}

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

/* Project image */
.project-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Project content */
.project-content {
    padding: 2rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-right: 5.5rem; /* abv 3.5rem to fix title clipping */
}

/* Tech tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: auto;
    padding: 0 1.5rem;
    width: 100%;
}

.tech-tags span {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    min-height: 36px;
    display: flex;
    align-items: center;
}

.project-card:hover .tech-tags span {
    background: rgba(var(--primary-rgb), 0.15);
}

/* Project links (positioned) */
.project-links {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.project-links a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    transition: all var(--transition-normal);
}

.project-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.project-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Project status */
.project-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 100%;
}

.project-status i {
    font-size: 0.5rem;
    margin-top: 1px;
}

.project-status.completed {
    color: var(--complete, #0890ea);
    border-color: rgba(8, 144, 234, 0.35);
    background: rgba(8, 144, 234, 0.1);
}

.project-status.active {
    color: var(--success, #22c55e);
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
}

.project-status.wip {
    color: var(--warning, #ffc100);
    border-color: rgba(255, 193, 0, 0.35);
    background: rgba(255, 193, 0, 0.1);
}

/* New Abandoned status style */
.project-status.abandoned {
    color: var(--abandoned, #dc2626);
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Category filters */
.project-card[data-category] {
    display: none;
}

.project-card[data-category].active {
    display: block;
}

/* Page search styles */
.page-search {
    position: relative;
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-search input {
    width: 100%;
    padding: 1rem 3rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all var(--transition-normal);
    min-height: 44px;
}

.page-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
    outline: none;
}

.page-search i {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}

/* Responsive design */
@media (max-width: 1024px) {
    .projects-header h1 {
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .projects-header {
        padding: 6rem 1rem 3rem;
    }

    .projects-header h1 {
        font-size: 2rem;
    }

    .projects-nav {
        gap: 0.5rem;
        margin: 1.5rem 0 2rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 36px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    .project-image {
        height: 180px;
    }

    .project-content {
        padding: 1.5rem;
    }

    .project-header {
        padding-right: 3rem;
    }

    .project-header h3 {
        font-size: 1.125rem;
    }

    .project-links {
        top: 1rem;
        right: 1rem;
    }

    .project-links a {
        width: 36px;
        height: 36px;
    }

    .tech-tags {
        gap: 0.5rem;
    }

    .tech-tags span {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .featured-badge {
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .project-card::before {
        display: none;
    }

    .filter-btn:hover {
        transform: none;
    }

    .filter-btn.active {
        transform: none;
    }

    .project-links a:hover {
        transform: none;
    }

    .project-card,
    .filter-btn,
    .project-links a {
        transition: transform 0.2s ease;
    }

    .project-card:active,
    .filter-btn:active,
    .project-links a:active {
        transform: scale(0.98);
    }
}

/* Prevent text selection on interactive elements */
.filter-btn,
.tech-tags span,
.project-links a {
    user-select: none;
    -webkit-user-select: none;
}

/* Improve touch scrolling */
@supports (-webkit-overflow-scrolling: touch) {
    .projects-grid {
        -webkit-overflow-scrolling: touch;
    }
}
