/* ===== Projects Page ===== */
.projects {
    background: #f8fafc;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -70%;
    right: -70%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(219, 234, 254, 0.55) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.project-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.project-header h3 {
    font-size: 1.3rem;
    color: #0f172a;
    flex: 1;
    font-weight: 700;
}

.project-type {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.project-description {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    position: relative;
    z-index: 2;
}

.project-tags span {
    background: #f8fafc;
    color: #334155;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

.project-status {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #1e40af;
    font-weight: 600;
}

/* ===== Project Modal ===== */
.modal-open {
    overflow: hidden;
}

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.project-modal.hidden {
    display: none;
}

.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.project-modal-content {
    position: relative;
    width: min(760px, 100%);
    max-height: 90vh;
    overflow: auto;
    z-index: 1;
    animation: slideUp 0.25s ease;
}

.project-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.project-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-right: 2rem;
    margin-bottom: 1rem;
}

.project-modal-description {
    color: #475569;
    margin-bottom: 1.2rem;
}

.project-modal-image-wrap {
    margin-bottom: 1rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #dbeafe;
}

.project-modal-image {
    display: block;
    width: 100%;
    height: auto;
}

.project-modal-detail-description {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.project-modal-actions {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.project-modal-actions .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-header {
        flex-direction: column;
    }

    .project-type {
        align-self: flex-start;
    }

    .project-modal-header {
        flex-direction: column;
    }
}
