/* Project Modal Styles */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--dark-gray);
    border-radius: 12px;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: var(--off-white);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    will-change: transform;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: var(--off-white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--white);
}

.modal-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--light-gray);
}

.modal-category {
    color: var(--primary-red);
    font-weight: 500;
}

.modal-gallery {
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(0,0,0,0.2);
}

.modal-main-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) rgba(255,255,255,0.1);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    will-change: transform;
}

.modal-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.modal-thumb:hover {
    opacity: 0.8;
}

.modal-thumb.active {
    opacity: 1;
    border: 2px solid var(--primary-red);
}

.modal-body {
    padding: 2rem;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--off-white);
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

.modal-description p {
    margin: 0 0 0.75rem;
}

.modal-description ul,
.modal-description ol {
    margin: 0.5rem 0 1rem 1.25rem;
    padding-left: 0.5rem;
}

.modal-description li {
    margin: 0.35rem 0;
}

.modal-description p:empty {
    margin: 0;
    height: 0;
}

.modal-skills-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.modal-skills-section h3 {
    font-size: 1.2rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.modal-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.project-skill {
    background: rgba(255,255,255,0.1);
    color: var(--off-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.project-skill:hover {
    background: rgba(255,255,255,0.15);
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-red);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-link:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
}

.modal-link svg {
    transition: transform 0.2s ease;
}

.modal-link:hover svg {
    transform: translate(2px, -2px);
}

/* Light theme overrides */
.theme-light .modal-content {
    background: #ffffff;
    color: #333333;
}

.theme-light .modal-header {
    border-bottom-color: rgba(0,0,0,0.1);
}

.theme-light .modal-description {
    color: #333333;
}

.theme-light .modal-skills-section {
    border-top-color: rgba(0,0,0,0.1);
}

.theme-light .project-skill {
    background: rgba(0,0,0,0.05);
    color: #333333;
}

.theme-light .project-skill:hover {
    background: rgba(0,0,0,0.08);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-gallery {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem 1rem;
    }
    
    .modal-main-image {
        max-height: 300px;
    }
    
    .close-modal {
        right: 1rem;
        top: 1rem;
    }
}

/* Scrollbar styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--primary-red);
    border-radius: 4px;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background-color: var(--primary-red);
    border-radius: 2px;
}