/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15px auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-button {
    position: sticky;
    top: 0;
    float: right;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: #fefefe;
    padding: 0 5px;
    z-index: 1;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Loading overlay styles */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Preview content styles */
#previewContent {
    background-color: white;
    padding: 20px;
    margin-top: 20px;
    overflow-x: auto;
}

#previewContent canvas,
#previewContent .container {
    width: 100%;
    max-width: 100%;
}

#previewContent .container {
    padding: 20px;
}

#previewContent input[type="radio"]:disabled:checked + span {
    background-color: #4CAF50;
    color: white;
}

#previewContent input[readonly],
#previewContent textarea[readonly] {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    .loading-content {
        padding: 20px;
    }
}