/* Modal Backdrop */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop.active {
    display: block;
}

/* Modal Container */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    max-width: 95%;
    height: 100vh;
    width: 800px;
}

.modal.active {
    display: block;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.modal-close {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
    font-size: 24px;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Modal Body */
.modal-body {
    padding: 25px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #e02d2d;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #c22727;
}

/* Content Styles */
.modal-content-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.modal-content-text {
    line-height: 1.8;
    color: #374151;
    font-size: 16px;
}

.modal-content-html {
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-body {
        padding: 20px;
        max-height: calc(85vh - 120px);
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .modal {
        width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body {
        padding: 15px;
        max-height: calc(95vh - 100px);
    }

    .demo-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .modal-backdrop {
        display: none;
    }

    .modal {
        position: relative;
        transform: none;
        max-width: 100%;
        max-height: none;
        box-shadow: none;
    }

    .modal-close {
        display: none;
    }
}