.image-craft-dashboard {
    margin: 20px;
}

.image-craft-table {
    width: 100%;
    border-collapse: collapse;
}

.image-craft-table th,
.image-craft-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.image-craft-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.image-craft-button {
    padding: 5px 10px;
    margin-right: 5px;
    cursor: pointer;
}

.image-craft-modal {
    display: none;
    position: fixed;
    z-index: 159999; /* Just below the main modal but above WordPress admin */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.image-craft-modal-content {
    max-width: 650px;
    margin: 15% auto;
    padding: 20px;
    background-color: #f1f1f1;
    border-radius: 5px;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
}

.form-row input[type="number"],
.form-row input[type="text"],
.form-row textarea {
    width: 100%;
    padding: 5px;
}

.form-row input[type="radio"] {
    margin-right: 5px;
}

#submit-generate {
    display: block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#submit-generate:hover {
    background-color: #005177;
}

/* Style for Insert only shortcode button */
#insert-shortcode-only {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

#insert-shortcode-only:hover {
    background-color: #e7e7e7;
}

/* Adjust the button container for better alignment */
.form-row.button-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.image-craft-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.image-craft-close:hover,
.image-craft-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.image-item {
    flex: 0 0 calc(33.333% - 20px);
    text-align: center;
}

.image-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.approve-image-btn {
    margin-top: 10px;
}

.content {
    margin-top: 20px;
}

#image-preview-modal {
    z-index: 160001; /* Higher than the main modal */
}

#image-preview-modal .image-craft-modal-content {
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

#image-preview-full {
    max-width: 100%;
    height: auto;
}

.generated-image-preview,
.review-image-preview {
    cursor: pointer;
}

/* Shortcode list */
.shortcode-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcode-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.shortcode-item:hover {
    background-color: #e0e0e0;
}

/* Image approval modal */
.image-option {
    flex: 0 0 calc(33.333% - 20px);
    position: relative;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.image-option img {
    display: block;
    width: 100%;
    height: auto;
}

.image-option-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    text-align: center;
}

.image-option.selected {
    border-color: #0073aa;
}

/* Loading overlay */
#image-craft-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 160050;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    text-align: center;
}

.loading-content .spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 115, 170, 0.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ensure modals can't be closed by clicking outside */
.image-craft-modal {
    display: none;
    position: fixed;
    z-index: 159999; /* Just below the main modal but above WordPress admin */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}