/* Portfolio Modal Styles */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 95%;
    height: 95%;
    max-width: 1400px;
    max-height: 900px;
    background: var(--dark-bg);
    border-radius: 20px;
    margin: auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    background: var(--gradient-primary);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    height: calc(100% - 80px);
    position: relative;
    overflow: hidden;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.modal-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.modal-btn {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-btn:hover {
    background: var(--gradient-primary);
    color: var(--dark-bg);
    transform: translateY(-2px);
}

.modal-btn i {
    font-size: 1rem;
}

/* Portfolio Grid with Modal Triggers */
.portfolio-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.portfolio-item-modal {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 200px;
    cursor: pointer;
}

.portfolio-item-modal:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-3d-hover);
}

.portfolio-preview {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.portfolio-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.portfolio-preview i {
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.portfolio-preview span {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-item-modal:hover .portfolio-preview {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
}

.portfolio-info {
    padding: 1.5rem;
    text-align: center;
}

.portfolio-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.portfolio-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.portfolio-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.tech-tag {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.portfolio-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.portfolio-btn {
    background: var(--gradient-primary);
    color: var(--dark-bg);
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.portfolio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.portfolio-btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.portfolio-btn.secondary:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        height: 98%;
        margin: 1%;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-close {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
    
    .portfolio-grid-modal {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .portfolio-preview {
        height: 150px;
        font-size: 2rem;
    }
    
    .portfolio-preview span {
        font-size: 0.8rem;
    }
    
    .portfolio-info {
        padding: 1rem;
    }
    
    .portfolio-info h3 {
        font-size: 1.1rem;
    }
    
    .modal-controls {
        bottom: 0.5rem;
        right: 0.5rem;
        flex-direction: column;
    }
    
    .modal-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* Loading Animation */
.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-primary);
}

.modal-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
