/* ========================================
   PROJECT MODAL SYSTEM - THEME AWARE
   ======================================== */

/* Modal Overlay - Theme Aware */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 17, 27, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

/* Light Mode Overlay */
body.light-mode .modal-overlay {
    background: rgba(236, 231, 225, 0.95);
}

/* Show Modal */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Container */
.modal-content {
    background: linear-gradient(to bottom right, var(--tech-stack-box-first-color), var(--tech-stack-box-second-color));
    border: 2px solid var(--tech-stack-box-border-color);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--tech-stack-box-border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

/* Modal Header */
.modal-header {
    padding: 40px 40px 20px;
    border-bottom: 1px solid var(--tech-stack-box-border-color);
}

.modal-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.modal-badge.production {
    background: linear-gradient(135deg, #00ff88, #00cc6f);
    color: #000;
}

.modal-badge.research {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #000;
}

.modal-badge.internship {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.modal-badge.freelance {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}

.modal-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.3;
    margin-bottom: 10px;
}

.modal-subtitle {
    font-size: 1.7rem;
    color: var(--color-light-blue);
    font-style: italic;
}

/* Modal Body */
.modal-body {
    padding: 30px 40px;
}

.modal-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-placeholder-graphic {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
}

.modal-placeholder-graphic .graphic-icon {
    font-size: 8rem;
}

.modal-placeholder-graphic .graphic-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Graphic Colors */
.cv-graphic { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.lidar-graphic { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.av-graphic { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.pred-graphic { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.lms-graphic { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.transport-graphic { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.ecom-graphic { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.nlp-graphic { background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%); }
.chatbot-graphic { background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); }

.modal-description {
    font-size: 1.8rem;
    color: var(--color-white);
    line-height: 1.8;
    margin-bottom: 25px;
}

.modal-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-light-blue);
    margin-bottom: 15px;
    margin-top: 25px;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
}

.modal-list li {
    font-size: 1.7rem;
    color: var(--color-white);
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.modal-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-light-blue);
    font-weight: bold;
}

.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.modal-tech-tag {
    padding: 8px 16px;
    background: rgba(128, 0, 255, 0.2);
    border: 1px solid rgba(128, 0, 255, 0.4);
    border-radius: 6px;
    font-size: 1.4rem;
    color: var(--color-white);
    font-weight: 600;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 40px 40px;
    border-top: 1px solid var(--tech-stack-box-border-color);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #8000ff, #6000cc);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.6rem;
    font-weight: 600;
    transition: all 0.3s;
}

.modal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(128, 0, 255, 0.4);
}

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

.modal-link.disabled {
    background: rgba(128, 0, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-link.disabled:hover {
    transform: none;
    box-shadow: none;
}

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

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(128, 0, 255, 0.6);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 0, 255, 0.8);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 25px 20px;
    }

    .modal-title {
        font-size: 2.5rem;
    }

    .modal-placeholder-graphic .graphic-icon {
        font-size: 6rem;
    }

    .modal-placeholder-graphic .graphic-text {
        font-size: 2rem;
    }

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

    .modal-link {
        width: 100%;
        justify-content: center;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}