/**
 * Editor styles for AI Image Generator block
 */

/* Block container - ensure proper containment in editor */
.wp-block-aifi-ai-image-generator {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

/* Block placeholder container */
.wp-block-aifi-ai-image-generator .aifi-block-placeholder {
    padding: 24px;
}

/* Pro badge for free users */
.aifi-block-locked .aifi-pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f0ad4e, #ec971f);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.aifi-block-locked .aifi-pro-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.aifi-block-locked p {
    margin-bottom: 16px;
    color: #757575;
}

/* Form layout */
.aifi-block-placeholder .aifi-block-row {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-bottom: 16px;
}

.aifi-block-placeholder .aifi-block-row > * {
    flex: 1;
    margin-bottom: 0;
}

/* Prompt textarea */
.aifi-block-placeholder .aifi-block-prompt {
    width: 100%;
    margin-bottom: 16px;
}

.aifi-block-placeholder .aifi-block-prompt textarea {
    width: 100%;
    min-height: 80px;
}

/* Generate button */
.aifi-block-placeholder .aifi-block-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.aifi-block-placeholder .aifi-block-generate-btn .components-spinner {
    margin: 0;
}

/* Error notice */
.aifi-block-placeholder .aifi-block-notice {
    margin-bottom: 16px;
    width: 100%;
}

/* Image with regenerate toolbar */
.wp-block-aifi-ai-image-generator.aifi-block-has-image {
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
}

.wp-block-aifi-ai-image-generator.aifi-block-has-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Regenerate toolbar */
.aifi-block-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.wp-block-aifi-ai-image-generator:hover .aifi-block-toolbar,
.wp-block-aifi-ai-image-generator:focus-within .aifi-block-toolbar {
    opacity: 1;
}

.aifi-block-toolbar .components-button {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.aifi-block-toolbar .components-button:hover {
    background: #fff;
}

/* Loading state adjustments */
.aifi-block-placeholder .components-spinner {
    margin-right: 8px;
}

/* Select control adjustments */
.aifi-block-placeholder .components-select-control__input {
    min-width: 150px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .aifi-block-placeholder .aifi-block-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* Alignment support in editor */
.wp-block-aifi-ai-image-generator.alignwide,
.wp-block-aifi-ai-image-generator.alignfull {
    max-width: 100%;
}

.wp-block-aifi-ai-image-generator.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.wp-block-aifi-ai-image-generator.alignleft,
.wp-block-aifi-ai-image-generator.alignright {
    max-width: 50%;
}

.wp-block-aifi-ai-image-generator.alignleft {
    float: left;
    margin-right: 1.5em;
}

.wp-block-aifi-ai-image-generator.alignright {
    float: right;
    margin-left: 1.5em;
}

/* Ensure figure element respects container */
figure.wp-block-aifi-ai-image-generator {
    margin: 0;
    max-width: 100%;
}

/* Settings section in block placeholder */
.aifi-block-settings-section {
    width: 100%;
    margin-bottom: 16px;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 6px;
}

.aifi-block-settings-section .aifi-block-toggle {
    margin-bottom: 0;
}

.aifi-block-settings-section .aifi-block-row {
    margin-top: 12px;
    margin-bottom: 0;
}

/* Global info display when not customizing */
.aifi-block-global-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: #50575e;
}

.aifi-block-global-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #667eea;
}

.aifi-block-global-info strong {
    color: #1e1e1e;
}

/* =====================================================
   Disabled Post Type State
   ===================================================== */

.aifi-block-disabled-posttype {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.aifi-block-disabled-posttype-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 50%;
}

.aifi-block-disabled-posttype-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #6c757d;
}

.aifi-block-disabled-posttype h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
}

.aifi-block-disabled-posttype p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    max-width: 280px;
}

.aifi-block-settings-btn.components-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 8px 16px;
    font-size: 13px;
}

.aifi-block-settings-btn.components-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
