/* ============================================
   PROJECT MODAL STYLES (REDESIGNED)
   ============================================ */

#project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#project-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: 20px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(50px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

#project-modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--bg-hover);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    color: var(--text-secondary);
}

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

.modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.modal-title {
    font-size: 2rem;
    margin: 0;
    /* Improved readability: solid color instead of gradient text */
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: initial;
    font-weight: 800;
}

/* Stats Row */
.modal-stats-row {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.modal-body {
    padding: 2rem;
}

.modal-desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    /* Better contrast */
    margin-bottom: 2rem;
}

/* Commits Section */
.commits-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.commits-section h5 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.commit-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.commit-item:last-child {
    border-bottom: none;
}

.commit-msg {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
    display: block;
    text-decoration: none;
    transition: color 0.2s;
}

.commit-msg:hover {
    color: var(--accent);
}

.commit-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Tech Tags - "Tag Look" */
.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

.tech-tag {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 50px;
    /* Pill shape */
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.tech-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tech-tag::before {
    content: '#';
    margin-right: 4px;
    opacity: 0.5;
    color: var(--accent);
}

.modal-features-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.modal-features {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.modal-features li {
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.modal-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    align-items: center;
}

.share-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.share-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    #project-modal {
        align-items: flex-end;
    }

    .modal-content {
        max-height: 90vh;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        margin: 0;
        transform: translateY(100%);
    }

    #project-modal.active .modal-content {
        transform: translateY(0);
    }

    .modal-actions {
        flex-direction: column;
    }

    .share-btn {
        margin-left: 0;
        width: 100%;
        border-radius: 8px;
        gap: 10px;
    }

    .share-btn::after {
        content: ' Share Project';
        font-size: 1rem;
    }

    .anchor-button {
        width: 100%;
        text-align: center;
    }
}