/**
 * Block Editor Styles
 * Styles for ACF blocks in the WordPress block editor
 */

/* Import main theme variables */
@import url('main.css');

/* General Block Editor Styles */
.editor-styles-wrapper {
    font-family: var(--font-family-primary);
    color: var(--text-color);
    background-color: #f5f5f5;
}

/* Disable AOS animations in editor */
.editor-styles-wrapper [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Block Preview Container */
.block-preview {
    position: relative;
    padding: 20px;
    margin: 10px 0;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.block-preview::before {
    content: attr(data-block-title);
    position: absolute;
    top: -2px;
    left: -2px;
    background: var(--blue);
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 0 0 8px 0;
    z-index: 10;
}

/* Block type indicators */
.block-preview--acf-hero::before { content: 'Hero Section'; }
.block-preview--acf-problem-cards::before { content: 'Problem Cards'; }
.block-preview--acf-complete-support::before { content: 'Complete Support'; }
.block-preview--acf-solutions-grid::before { content: 'Solutions Grid'; }
.block-preview--acf-mission-cards::before { content: 'Mission Cards'; }
.block-preview--acf-gallery-slider::before { content: 'Gallery Slider'; }
.block-preview--acf-cta-section::before { content: 'CTA Section'; }
.block-preview--acf-contact-form::before { content: 'Contact Form'; }

/* Preview Content Styles */
.preview-section-header {
    text-align: center;
    margin-bottom: 30px;
}

.preview-section-header h2 {
    font-size: 28px;
    color: var(--blue-dark);
    margin-bottom: 10px;
}

.preview-section-header .section-subtitle {
    font-size: 16px;
    color: #666;
}

/* Hero Block Preview */
.block-preview--acf-hero .preview-hero {
    display: flex;
    gap: 30px;
    align-items: center;
    min-height: 200px;
}

.block-preview--acf-hero .preview-hero-content {
    flex: 1;
}

.block-preview--acf-hero .preview-hero-image {
    flex: 1;
    max-width: 300px;
}

.block-preview--acf-hero .preview-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.block-preview--acf-hero .preview-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--blue);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 15px;
    font-size: 14px;
}

/* Cards Grid Preview */
.preview-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.preview-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.preview-card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: var(--blue-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.preview-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--blue-dark);
}

.preview-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Mission Cards Preview */
.preview-mission-card {
    position: relative;
    padding-left: 60px;
}

.preview-mission-card .card-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: var(--khaki);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

/* Gallery Slider Preview */
.preview-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
    aspect-ratio: 4/3;
}

.preview-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 14px;
}

.preview-gallery-item .click-action-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--blue);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* CTA Section Preview */
.preview-cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.preview-cta-button {
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.preview-cta-button.primary {
    background: var(--blue);
    color: white;
}

.preview-cta-button.secondary {
    background: white;
    color: var(--blue);
    border: 2px solid var(--blue);
}

/* Support Block Preview */
.preview-support-content {
    display: flex;
    gap: 30px;
    align-items: center;
}

.preview-support-text {
    flex: 1;
}

.preview-support-visual {
    flex: 1;
    max-width: 400px;
}

.preview-support-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.preview-support-icon {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Solutions Grid Preview */
.preview-solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.preview-solution-item {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.preview-solution-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

/* Utility Classes */
.preview-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    padding: 40px;
    text-align: center;
    color: #999;
    border-radius: 8px;
}

.preview-item-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Responsive adjustments for editor */
@media (max-width: 768px) {
    .preview-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .block-preview--acf-hero .preview-hero {
        flex-direction: column;
    }
    
    .preview-support-content {
        flex-direction: column;
    }
}

/* RTL Support */
[dir="rtl"] .block-preview::before {
    left: auto;
    right: -2px;
    border-radius: 0 0 0 8px;
}

[dir="rtl"] .preview-mission-card {
    padding-left: 0;
    padding-right: 60px;
}

[dir="rtl"] .preview-mission-card .card-number {
    left: auto;
    right: 0;
}

[dir="rtl"] .preview-gallery-item .click-action-badge,
[dir="rtl"] .preview-item-count {
    right: auto;
    left: 10px;
}

/* Contact Form Preview */
.block-preview--acf-contact-form .preview-form-container {
    max-width: 500px;
    margin: 0 auto;
}

.block-preview--acf-contact-form .preview-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.block-preview--acf-contact-form .form-row {
    margin-bottom: 20px;
}

.block-preview--acf-contact-form input,
.block-preview--acf-contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.block-preview--acf-contact-form .preview-button {
    background: var(--blue);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.8;
}