.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.project-card {
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
}

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

.project-card:hover .project-img-wrapper img {
    transform: scale(1.1);
}

.card-hover-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: white;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.project-card:hover .card-hover-btn {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.project-content {
    padding: 24px;
}

.project-card-header {
    margin-bottom: 20px;
}

.project-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 8px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-tech {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Premium Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.premium-modal {
    width: 100%;
    max-width: 900px;
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
    /* Ensure rounded corners clip content */
}

.modal-scroll-container {
    max-height: 85vh;
    overflow-y: auto;
    width: 100%;
}

.premium-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    /* Ensure it's above the scrollable content */
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: black;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.premium-modal-close:hover {
    transform: rotate(90deg);
    background: var(--secondary);
    color: white;
}

.modal-inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    min-height: 450px;
}

.modal-hero {
    position: relative;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.modal-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.modal-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-hero-overlay {
    position: absolute;
    top: 32px;
    left: 32px;
    z-index: 10;
}

.modal-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #000000;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-transform: lowercase;
}

.modal-badge span {
    line-height: 1;
}

.modal-main {
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
}

.modal-head {
    margin-bottom: 40px;
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
}

.modal-quick-stats {
    display: flex;
    gap: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.q-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.q-stat label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.q-stat span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-body {
    flex-grow: 1;
}

.modal-section {
    margin-bottom: 32px;
}

.modal-sub {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 800;
}

.modal-text {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
}

.premium-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.chip-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    margin-top: 32px;
}

.modal-btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

@media (max-width: 900px) {
    .modal-inner {
        grid-template-columns: 1fr;
    }

    .modal-hero {
        height: 300px;
    }

    .modal-main {
        padding: 40px 24px;
    }
}

@media (max-width: 576px) {
    .project-card{
        width: 100%;
    }
    .modal-quick-stats {
        flex-direction: column;
        gap: 16px;
    }

    .modal-footer {
        grid-template-columns: 1fr;
    }

    .modal-title {
        font-size: 2rem;
    }
}

.view-more-container {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

.view-more-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-more-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.view-more-btn svg {
    transition: transform 0.3s ease;
}