/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

/* Project Modal Specific */
.project-modal-content {
    width: 1000px;
    max-width: 95%;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 3rem;
}

.project-detail-image {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    background: #f5f5f5;
}

.project-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-detail-info h2 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin: 0;
    font-weight: 800;
}

.project-meta {
    display: flex;
    gap: 1rem;
}

.project-date,
.project-category {
    padding: 6px 15px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.project-description {
    color: #444;
    line-height: 1.8;
    font-size: 1.05rem;
}

.project-tech h3 {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 0.8rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.project-links {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.project-links .btn-primary,
.project-links .btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 0.95rem;
    text-decoration: none;
}

.project-links .btn-primary {
    background: #1a1a1a;
    color: white;
    border: 2px solid #1a1a1a;
    border-radius: 10px;
}

.project-links .btn-primary:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-2px);
}

.project-links .btn-secondary {
    background: transparent;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    border-radius: 10px;
}

.project-links .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Certificate Modal Specific */
.certificate-modal-content {
    width: auto;
    max-width: 1200px;
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
}

.certificate-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.certificate-viewer img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.certificate-info {
    text-align: center;
    color: white;
}

.certificate-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.certificate-info p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0.3rem 0;
}

/* Modal Navigation Arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
    }
    
    .project-detail-image {
        height: 300px;
    }
    
    .project-detail-info h2 {
        font-size: 2rem;
    }
    
    .project-links {
        flex-direction: column;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
}

/* Scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}
