/* ========================================
   ENHANCED MODAL SYSTEM
   Reusable component for project details
   ======================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 13, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: rgba(26, 26, 31, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 20px;
    padding: 40px;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 217, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    background: linear-gradient(135deg, #00FFF5, #9D4EDD);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* Close Button */
.modal-close {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.modal-close:hover {
    background: rgba(0, 217, 255, 0.1);
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

.modal-close:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

/* Modal Body */
.modal-body {
    color: #ffffff;
    line-height: 1.8;
}

.modal-body h2,
.modal-body h3 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-top: 30px;
    margin-bottom: 15px;
}

.modal-body p {
    font-family: var(--font-body);
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.modal-body ul {
    list-style: none;
    padding-left: 0;
}

.modal-body li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
}

.modal-body li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-size: 1.2em;
}

/* Modal Image */
.modal-image {
    width: 100%;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Modal Tags */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.modal-tag {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.modal-tag:hover {
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 217, 255, 0.2);
}

.modal-btn {
    padding: 12px 30px;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    border-radius: 25px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.modal-btn:hover {
    background: var(--color-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    transform: translateY(-2px);
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border: none;
    color: #000;
}

.modal-btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.6);
}

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

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

.modal-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        text-align: center;
    }
}

/* Animation for content reveal */
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay.active .modal-body > * {
    animation: fadeInContent 0.5s ease forwards;
    opacity: 0;
}

.modal-overlay.active .modal-body > *:nth-child(1) { animation-delay: 0.1s; }
.modal-overlay.active .modal-body > *:nth-child(2) { animation-delay: 0.15s; }
.modal-overlay.active .modal-body > *:nth-child(3) { animation-delay: 0.2s; }
.modal-overlay.active .modal-body > *:nth-child(4) { animation-delay: 0.25s; }
.modal-overlay.active .modal-body > *:nth-child(5) { animation-delay: 0.3s; }

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