.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(16, 22, 34, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 3% auto;
    padding: 3rem;
    border: 1px solid rgba(2, 62, 138, 0.3);
    width: 90%;
    max-width: 900px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

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

.close {
    color: rgba(255, 255, 255, 0.7);
    float: right;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.close:hover {
    color: #0077b6;
    background: rgba(46, 74, 255, 0.2);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
    background: linear-gradient(90deg, #0077b6, #02268a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-description {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.modal-description p {
    margin-bottom: 1rem;
}

.modal-description ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-description li {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.modal-architecture {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #023e8a;
}

.modal-architecture img {
    width: 100%;
    height: auto;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.modal-skills-section {
    margin: 2rem 0;
    padding-top: 2rem;
    border-top: 1px solid #023e8a;
}

.modal-skills-section h3 {
    color: #0077b6;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: rgba(2, 62, 138, 0.15);
    border: 1px solid rgba(2, 62, 138, 0.3);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: rgba(2, 62, 138, 0.25);
    border-color: rgba(2, 62, 138, 0.5);
    transform: translateY(-2px);
}

.modal-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(2, 62, 138);
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #000711, #001a61);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.github-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px #023e8a;
}

.github-link svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 1024px) {
    .modal-content {
        padding: 2.5rem;
        max-width: 820px;
    }

    .modal-title {
        font-size: 2.1rem;
        margin-bottom: 1.2rem;
    }

    .modal-description {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .modal-architecture {
        margin: 1.8rem 0;
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 2rem;
        margin: 6% auto;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 1.85rem;
        line-height: 1.2;
    }

    .modal-description {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    /* Let architecture image breathe */
    .modal-architecture {
        margin: 2rem -2rem;
        border-radius: 0;
    }

    .modal-architecture img {
        max-height: 360px;
        object-fit: contain;
    }

    .modal-skills-section h3 {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.6rem;
        margin: 10% auto;
        width: 94%;
    }

    .close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 26px;
    }

    .modal-title {
        font-size: 1.55rem;
        margin-bottom: 1rem;
    }

    .modal-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* Strong image preview on mobile */
    .modal-architecture {
        margin: 1.8rem -1.6rem;
    }

    .modal-architecture img {
        max-height: 300px;
        object-fit: contain;
    }

    .skill-tag {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .github-link {
        width: 100%;
        justify-content: center;
        padding: 10px 18px;
    }
}