/* Yum ACF Editable Block - Front Styles */

.yum-acf-editable-block {
    position: relative;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
}

.yum-acf-editable-block:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

/* Label et bouton d'édition */
.yum-field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.yum-field-label strong {
    font-size: 16px;
    color: #1d2327;
}

.yum-edit-btn {
    padding: 6px 12px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.yum-edit-btn:hover {
    background: #135e96;
}

/* Contenu du champ */
.yum-field-content {
    min-height: 40px;
    line-height: 1.6;
    color: #2c3338;
}

.yum-field-content em {
    color: #8c8f94;
    font-style: italic;
}

.yum-field-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Éditeur */
.yum-field-editor {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #2271b1;
}

.yum-field-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: border-color 0.2s;
}

.yum-field-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.yum-field-input.yum-wysiwyg {
    font-family: monospace;
    min-height: 200px;
}

/* Actions de l'éditeur */
.yum-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.yum-save-btn,
.yum-cancel-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.yum-save-btn {
    background: #00a32a;
    color: #fff;
}

.yum-save-btn:hover {
    background: #008a20;
}

.yum-save-btn:disabled {
    background: #8c8f94;
    cursor: not-allowed;
}

.yum-cancel-btn {
    background: #dcdcde;
    color: #2c3338;
}

.yum-cancel-btn:hover {
    background: #c3c4c7;
}

/* Messages */
.yum-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.yum-message.success {
    display: block;
    background: #d5f5db;
    color: #00a32a;
    border-left: 4px solid #00a32a;
}

.yum-message.error {
    display: block;
    background: #fcf0f1;
    color: #d63638;
    border-left: 4px solid #d63638;
}

.yum-message.loading {
    display: block;
    background: #f0f6fc;
    color: #2271b1;
    border-left: 4px solid #2271b1;
}

/* Loading spinner */
.yum-acf-editable-block.loading {
    opacity: 0.6;
    pointer-events: none;
}

.yum-acf-editable-block.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: yum-spin 1s linear infinite;
}

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

/* Notices */
.yum-acf-block.notice,
.yum-acf-block.error {
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.yum-acf-block.notice {
    background: #f0f6fc;
    color: #2271b1;
    border-left: 4px solid #2271b1;
}

.yum-acf-block.error {
    background: #fcf0f1;
    color: #d63638;
    border-left: 4px solid #d63638;
}

/* Responsive */
@media (max-width: 768px) {
    .yum-acf-editable-block {
        padding: 15px;
    }
    
    .yum-field-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .yum-editor-actions {
        flex-direction: column;
    }
    
    .yum-save-btn,
    .yum-cancel-btn {
        width: 100%;
    }
}