/* Modal Styles */
.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(10px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5vh auto;
    padding: 3.5rem;
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 1000px;
    border-radius: 40px;
    position: relative;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    color: var(--text-dim);
    font-size: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary);
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.modal-header .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem; /* Increased gap */
}

.project-gallery {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    justify-content: center; /* Center if images don't overflow */
}

.project-gallery::-webkit-scrollbar {
    height: 6px;
}

.project-gallery::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.gallery-img {
    height: 450px; /* Increased from 300px */
    width: auto;
    flex-shrink: 0; /* Prevent squashing */
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.gallery-img:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

.modal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.modal-desc h3, .modal-features h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.modal-desc p {
    color: var(--text-dim);
    line-height: 1.8;
}

.modal-features ul {
    list-style: none;
}

.modal-features li {
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modal-features li i {
    color: var(--primary);
    width: 20px;
}

.modal-footer {
    display: flex;
    justify-content: center;
}

/* Modal Monitor Frame (for BADR) */
.desktop-gallery {
    gap: 3rem;
    padding: 2rem 0;
}

.modal-monitor {
    position: relative;
    width: 440px; 
    height: 250px;
    background: #000; /* Black background for contain letterboxing */
    border: 8px solid #2a2a2a;
    border-radius: 15px;
    flex-shrink: 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: var(--transition);
}

.modal-monitor:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.modal-monitor .monitor-screen {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 5px;
    background: #000;
}

.modal-monitor .monitor-screen img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevent cropping */
}

.modal-monitor .monitor-base {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: #2a2a2a;
    border-radius: 5px 5px 0 0;
}

.modal-monitor .monitor-base::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .modal-monitor {
        width: 300px;
        height: 190px;
    }
}

@media (max-width: 768px) {
...
    .modal-content {
        width: 95%;
        padding: 2rem;
        margin: 10% auto;
        height: 80vh;
        overflow-y: auto;
    }
    .modal-header h2 {
        font-size: 1.8rem;
    }
    .modal-info {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .gallery-img {
        height: 350px;
    }
}
