/* ========================================
   MODAL OVERLAY
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

/* Backdrop Blur */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
}

/* Modal Content Container */
.modal-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10;
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
    color: #0a0a0a;
}

.modal-close:hover {
    background: #ffffff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Modal Body */
.modal-body {
    height: 90vh;
    overflow-y: auto;
    padding: 3rem;
}

/* Custom Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ADFF2F 0%, #9D00FF 100%);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9D00FF 0%, #ADFF2F 100%);
}

/* ========================================
   MODAL CONTENT STRUCTURE
   ======================================== */

.modal-header {
    margin-bottom: 2rem;
}

.modal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #808080;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.modal-back:hover {
    color: #0a0a0a;
}

.modal-project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.modal-project-subtitle {
    font-size: 1.25rem;
    color: #808080;
    margin-bottom: 2rem;
}

/* Project Meta Info */
.modal-meta {
    display: flex;
    gap: 3rem;
    padding: 2rem;
    background: #0a0a0a;
    border-radius: 10px;
    margin: 2rem 0;
}

.meta-item {
    text-align: center;
    flex: 1;
}

.meta-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ADFF2F;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.meta-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

/* Video Container */
.modal-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 3rem;
}

.modal-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.youtube-channel-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem 3rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ADFF2F;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.channel-btn:hover {
    background: #ADFF2F;
    transform: scale(1.05);
}

.channel-icon {
    font-size: 2rem;
    color: #ADFF2F;
    transition: color 0.3s ease;
}

.channel-btn:hover .channel-icon {
    color: #0a0a0a;
}

.channel-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ADFF2F;
    transition: color 0.3s ease;
}

.channel-btn:hover .channel-text {
    color: #0a0a0a;
}

/* Video Placeholder */
.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ADFF2F 0%, #9D00FF 100%);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
}

/* PROCESS GRID 2x2 */
.process-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.process-card {
    padding: 2rem;
    background: #1a1a1a;
    border: 2px solid rgba(157, 0, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.process-card:hover {
    border-color: #ADFF2F;
    box-shadow: 0 5px 20px rgba(173, 255, 47, 0.2);
    transform: translateY(-3px);
}

.process-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #9D00FF;
    margin-bottom: 0.5rem;
}

.process-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ADFF2F;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.process-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
    .process-grid {
        grid-template-columns: 1fr;
    }
}

/* Tags at bottom */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-tag {
    padding: 0.5rem 1rem;
    background: #adff2f;
    border: 1px solid #000000;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #000000;
    font-weight: 500;
}


/* Image Gallery in Modal */
.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.modal-gallery-item {
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.modal-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modal-gallery-item:hover img {
    transform: scale(1.05);
}

/* Navigation */
.modal-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 3rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: #0a0a0a;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.modal-nav-link:hover {
    color: #ADFF2F;
    transform: translateX(5px);
}

.modal-nav-link.prev:hover {
    transform: translateX(-5px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: 20px;
    }

    .modal-body {
        padding: 2rem 1.5rem;
        height: 95vh;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-meta {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }

    .modal-gallery {
        grid-template-columns: 1fr;
    }

    .modal-nav {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #ADFF2F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}