/* ===================================
   🎨 WPCM GUTENBERG BLOCKS EDITOR STYLES
   =================================== */

/* 📋 CHANGELOG BLOCK PREVIEW */
.wpcm-block-preview {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wpcm-block-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 115, 170, 0.15) !important;
}

.wpcm-block-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0073aa, #005177);
}

/* 🗺️ ROADMAP BLOCK PREVIEW */
.wpcm-roadmap-block-preview {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wpcm-roadmap-block-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(103, 58, 183, 0.15) !important;
}

.wpcm-roadmap-block-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #673ab7, #512da8);
}

/* Assicura che i wrapper dei blocchi siano sempre visibili */
.wp-block-wpcm-roadmap,
.wp-block-wpcm-changelog {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 20px;
}

.wpcm-roadmap-block,
.wpcm-changelog-block {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 20px;
}

/* Stili per messaggi di stato vuoto */
.chanma-empty-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.chanma-empty-message a {
    color: inherit;
    text-decoration: underline;
}

/* Stili per icone personalizzate dei blocchi */
.block-editor-block-types-list__item[data-type="wpcm/changelog"] .block-editor-block-types-list__item-icon,
.block-editor-block-types-list__item[data-type="wpcm/roadmap"] .block-editor-block-types-list__item-icon {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Highlight della categoria personalizzata */
.block-editor-inserter__block-list .components-panel__body-title[aria-expanded="true"]:has([data-slug="wp-changelog-manager"]) {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border-radius: 4px;
    margin: 2px 0;
}

/* Stili per i blocchi nella lista inserter */
.block-editor-block-types-list__item[data-type*="wpcm/"] {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.block-editor-block-types-list__item[data-type*="wpcm/"]:hover {
    border-color: #4F46E5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

/* ⚙️ INSPECTOR CONTROLS STYLING */
.components-panel__body .components-base-control__field {
    margin-bottom: 16px;
}

.components-panel__body .components-base-control__label {
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.components-panel__body .components-base-control__help {
    color: #757575;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

/* 🎯 RANGE CONTROL CUSTOM STYLING */
.components-range-control__wrapper {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e4e7;
}

.components-range-control__slider {
    background: linear-gradient(90deg, #0073aa, #005177);
    height: 6px;
    border-radius: 3px;
}

/* 🔘 SELECT CONTROL CUSTOM STYLING */
.components-select-control__input {
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    background-color: #fff;
}

.components-select-control__input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

/* ✅ TOGGLE CONTROL CUSTOM STYLING */
.components-form-toggle {
    transition: all 0.3s ease;
}

.components-form-toggle.is-checked .components-form-toggle__track {
    background-color: #0073aa;
}

.components-form-toggle:hover:not(.is-checked) .components-form-toggle__track {
    background-color: #ccd0d4;
}

/* 📱 RESPONSIVE BADGES */
@media (max-width: 768px) {
    .wpcm-block-preview,
    .wpcm-roadmap-block-preview {
        padding: 20px !important;
    }
    
    .wpcm-block-preview div[style*="display: flex"],
    .wpcm-roadmap-block-preview div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
}

/* 🌟 PREMIUM EFFECT FOR BLOCKS */
.wpcm-block-preview::after {
    content: '🚀';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    opacity: 0.6;
    animation: pulse 2s infinite;
}

.wpcm-roadmap-block-preview::after {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 📋 PANEL BODY HEADERS */
.components-panel__body-title {
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* 🎨 THEME PREVIEW HINTS */
.wpcm-theme-preview {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.wpcm-theme-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.wpcm-theme-default .wpcm-theme-preview-dot:nth-child(1) { background: #0073aa; }
.wpcm-theme-default .wpcm-theme-preview-dot:nth-child(2) { background: #005177; }
.wpcm-theme-default .wpcm-theme-preview-dot:nth-child(3) { background: #003c56; }

.wpcm-theme-minimal .wpcm-theme-preview-dot:nth-child(1) { background: #666; }
.wpcm-theme-minimal .wpcm-theme-preview-dot:nth-child(2) { background: #999; }
.wpcm-theme-minimal .wpcm-theme-preview-dot:nth-child(3) { background: #ccc; }

.wpcm-theme-modern .wpcm-theme-preview-dot:nth-child(1) { background: #667eea; }
.wpcm-theme-modern .wpcm-theme-preview-dot:nth-child(2) { background: #764ba2; }
.wpcm-theme-modern .wpcm-theme-preview-dot:nth-child(3) { background: #f093fb; }

/* 📊 ACCESSIBILITY IMPROVEMENTS */
.components-base-control__field:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 🎯 HIGH CONTRAST MODE SUPPORT */
@media (prefers-contrast: high) {
    .wpcm-block-preview,
    .wpcm-roadmap-block-preview {
        border-color: #000 !important;
        background: #fff !important;
    }
    
    .components-select-control__input,
    .components-range-control__wrapper {
        border-color: #000 !important;
    }
}
