/* Download Modal Styles */

/* Modal Overlay */
#download-modal > div:first-child {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Chặn hoàn toàn click vào overlay */
    pointer-events: auto;
}

/* Cho phép click vào modal dialog */
#download-modal [role="dialog"] {
    pointer-events: auto;
}

/* Modal Dialog */
#download-modal [role="dialog"] {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Content */
.modal-content {
    padding: 24px;
}

/* Download Options */
.download-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.download-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.download-option:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.platform-icon {
    font-size: 2rem;
    margin-right: 16px;
    width: 48px;
    text-align: center;
}

.platform-info {
    flex: 1;
}

.platform-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.platform-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

/* Spinner and Loading State */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    gap: 18px;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e5e7eb;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-text {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 500;
}
.no-data {
    text-align: center;
    color: #b91c1c;
    font-size: 1.1rem;
    padding: 32px 0;
}

/* Responsive */
@media (max-width: 768px) {
    #download-modal [role="dialog"] {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-content {
        padding: 20px;
    }

    .download-option {
        padding: 12px;
    }

    .platform-icon {
        font-size: 1.5rem;
        margin-right: 12px;
        width: 40px;
    }

    .download-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-width: 80px;
    }
}

/* Hide modal by default */
#download-modal {
    display: none;
}

#download-modal.is-open {
    display: block;
}

/* Chặn tương tác với content phía sau khi modal mở */
body.modal-open {
    overflow: hidden;
}

/* Chặn click vào tất cả element phía sau modal */
#download-modal.is-open ~ *,
#download-modal.is-open + * {
    pointer-events: none;
}

/* Đảm bảo modal luôn ở trên cùng */
#download-modal {
    z-index: 99999;
} 