/* ========================================
   MODALS & OVERLAYS
   ======================================== */

/* Base Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Modal Overlay */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

/* Modal Content */
.modal-content {
    position: relative;
    z-index: 10001;
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: zoomIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 59, 48, 0.9);
    border: 1px solid rgba(255, 59, 48, 1);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10002;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4);
}

.modal-close:hover {
    background: rgba(255, 59, 48, 1);
    border-color: rgba(255, 59, 48, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.6);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
}

/* Certificate Modal Specific */
.cert-modal-content {
    max-width: 1200px;
    position: relative;
    z-index: 10001;
}

.cert-modal-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 217, 255, 0.3);
    margin-bottom: 1.5rem;
    display: block;
}

#certModalImage {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 217, 255, 0.3);
    margin-bottom: 1.5rem;
    display: block;
    max-height: 80vh;
    object-fit: contain;
}

.cert-modal-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cert-modal-actions-top {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10002;
}

.cert-modal-actions .btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Project Modal Specific */
.project-modal-content {
    max-width: 900px;
    width: 95%;
}

.project-details-container {
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-details-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.project-details-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-details-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.4rem 0 0.6rem 0;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-details-meta {
    display: flex;
    gap: 0.8rem;
}

.project-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-details-img {
    width: 100%;
    height: 380px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.project-details-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-details-content {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.details-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.accomplishments-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accomplishments-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.accomplishments-list li i {
    color: #10b981;
    font-size: 0.95rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.tech-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(0, 242, 254, 0.04);
    border: 1px solid rgba(0, 242, 254, 0.15);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
}

.snippet-pre {
    background: #030307;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.snippet-pre code {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #a5f3fc;
    line-height: 1.4;
}

.project-details-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .cert-modal-actions-top {
        top: 60px;
        left: 10px;
        right: 10px;
        flex-direction: column;
        width: calc(100% - 20px);
    }

    .cert-modal-actions .btn,
    .cert-modal-actions button {
        width: 100%;
        justify-content: center;
    }

    #certModalImage {
        max-height: 70vh;
        margin-top: 120px;
    }
}