/* Projects Section - Modern Card Design with Modal */
.projects {
    position: relative;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(5px);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 20px 40px rgba(56, 189, 248, 0.2);
}

.project-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(129, 140, 248, 0.1));
}

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

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

/* Overlay on image */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-overlay span {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    margin-bottom: 12px;
    font-size: 1.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tech-stack span {
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-accent);
    font-weight: 500;
}

.project-info p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--secondary-text);
    margin-bottom: 8px;
}

.project-info p strong {
    color: var(--primary-text);
}

/* Modal Styles */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.project-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-accent);
    transform: rotate(90deg);
}

.modal-close i {
    color: white;
    font-size: 1.2rem;
}

.modal-header {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

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

.modal-body {
    padding: 40px;
}

.modal-body h2 {
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.modal-tech span {
    padding: 8px 18px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 25px;
    font-size: 0.9rem;
    color: var(--primary-accent);
    font-weight: 500;
}

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

.modal-section h3 {
    margin-bottom: 15px;
    color: var(--primary-text);
    font-size: 1.2rem;
}

.modal-section p,
.modal-section ul {
    color: var(--secondary-text);
    line-height: 1.8;
}

.modal-section ul {
    padding-left: 20px;
}

.modal-section ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 10px;
}

.modal-section ul li::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--primary-accent);
    border-radius: 50%;
}

.modal-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-links a {
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: #0f172a;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.modal-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px;
    }

    .modal-body {
        padding: 25px;
    }

    .modal-header {
        height: 200px;
    }
}