/* Modal Styles - Cool Enhanced Animations */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    perspective: 1000px;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

/* Closing Animation Class */
.modal.closing {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.modal.closing .modal-content {
    transform: scale(0.8) rotateX(15deg) translateY(50px);
    opacity: 0;
    filter: blur(10px);
}

.modal.closing .modal-overlay {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.modal.active .modal-overlay {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.98),
            rgba(30, 41, 59, 0.98));
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 30px;
    padding: 45px;
    backdrop-filter: blur(25px);
    box-shadow:
        0 50px 150px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.6) rotateX(-15deg) translateY(100px);
    opacity: 0;
    filter: blur(10px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1) rotateX(0) translateY(0);
    opacity: 1;
    filter: blur(0px);
}

/* Stagger animation for modal sections */
.modal.active .modal-header {
    animation: modalSlideUp 0.5s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.modal.active .modal-section:nth-child(1) {
    animation: modalSlideUp 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.modal.active .modal-section:nth-child(2) {
    animation: modalSlideUp 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.modal.active .modal-section:nth-child(3) {
    animation: modalSlideUp 0.5s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.modal.active .modal-highlights {
    animation: modalSlideUp 0.5s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow border animation */
.modal-content::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea, #764ba2);
    background-size: 300% 300%;
    border-radius: 32px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: borderGlow 4s ease infinite;
}

.modal.active .modal-content::before {
    opacity: 0.8;
}

@keyframes borderGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 30px;
}

.modal-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 25px;
}

.modal-title-section h2 {
    font-size: 32px;
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-description {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: white;
}

.modal-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-tag {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #667eea;
}

.modal-features {
    list-style: none;
    padding: 0;
}

.modal-features li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-features li:last-child {
    border-bottom: none;
}

.modal-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 18px;
}

.modal-highlights {
    margin-top: 30px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.highlight-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
}

.modal-highlights p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Modal Actions - Preview Button */
.modal-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.preview-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.preview-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.5);
}

.preview-btn:hover::before {
    opacity: 1;
}

.preview-btn svg,
.preview-btn span {
    position: relative;
    z-index: 1;
}

.preview-btn svg {
    transition: transform 0.3s ease;
}

.preview-btn:hover svg {
    transform: translate(3px, -3px);
}

/* Project Hover Overlay */
.project-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(102, 126, 234, 0.95),
            rgba(118, 75, 162, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-hover-overlay span {
    font-size: 16px;
    font-weight: 600;
    color: white;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.project-card:hover .project-hover-overlay {
    opacity: 1;
}

.project-card:hover .project-hover-overlay span {
    transform: translateY(0);
}

/* Cursor pointer for project cards */
.project-card {
    cursor: pointer;
}

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

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .modal-content {
        width: 95%;
        padding: 30px;
        max-height: 90vh;
    }

    .modal-image {
        height: 250px;
    }

    .modal-title-section h2 {
        font-size: 28px;
    }

    .modal-section h3 {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        border-radius: 20px;
    }

    .modal-image {
        height: 200px;
        border-radius: 12px;
    }

    .modal-title-section h2 {
        font-size: 24px;
    }

    .modal-description {
        font-size: 14px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .modal-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .modal-tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .modal-features li {
        padding: 10px 0;
        padding-left: 25px;
        font-size: 14px;
    }

    .modal-highlights {
        padding: 15px;
        margin-top: 20px;
    }

    .highlight-icon {
        width: 35px;
        height: 35px;
    }

    .modal-highlights p {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }

    .modal-image {
        height: 180px;
    }

    .modal-title-section h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .modal-description {
        font-size: 13px;
        line-height: 1.6;
    }

    .modal-section {
        margin-bottom: 20px;
    }

    .modal-section h3 {
        font-size: 15px;
    }

    .modal-tags {
        gap: 8px;
    }

    .modal-tag {
        padding: 5px 10px;
        font-size: 11px;
    }

    .modal-features li {
        padding: 8px 0;
        padding-left: 22px;
        font-size: 13px;
    }

    .modal-highlights {
        padding: 12px;
        gap: 12px;
    }

    .highlight-icon {
        width: 30px;
        height: 30px;
    }

    .highlight-icon svg {
        width: 18px;
        height: 18px;
    }

    .modal-highlights p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 18px;
        border-radius: 15px;
    }

    .modal-image {
        height: 160px;
    }

    .modal-title-section h2 {
        font-size: 20px;
    }

    .modal-description {
        font-size: 12px;
    }

    .modal-section h3 {
        font-size: 14px;
    }

    .modal-features li {
        font-size: 12px;
    }
}