/**
 * PCM Image Builder Styles
 * استایل‌های تصاویر حرفه‌ای
 */

/* ========================================
   Modal Styles
======================================== */

.pcm-image-preview-container {
    text-align: center;
    margin-bottom: 25px;
}

.pcm-image-preview {
    position: relative;
    border: 3px dashed #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    min-height: 200px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pcm-image-preview:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.pcm-image-preview.empty .pcm-image-placeholder {
    text-align: center;
}

.pcm-image-placeholder .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.pcm-image-placeholder p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.pcm-image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pcm-change-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pcm-change-image-btn:hover {
    background: rgba(37, 99, 235, 1);
    transform: scale(1.1);
}

.pcm-change-image-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

#pcm-select-image-btn {
    font-size: 15px;
    padding: 12px 24px;
    height: auto;
}

#pcm-select-image-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

.pcm-image-info {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.pcm-image-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.pcm-image-meta span {
    font-size: 13px;
    color: #0c4a6e;
    font-weight: 500;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pcm-image-meta .pcm-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.pcm-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 0;
}

.pcm-checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pcm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    padding: 10px 15px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.pcm-checkbox-label:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.pcm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.pcm-checkbox-label input[type="checkbox"]:checked + span {
    color: #1e40af;
    font-weight: 600;
}

.pcm-field-help {
    font-size: 12px;
    color: #6b7280;
    margin: 6px 0 0 0;
    font-style: italic;
}

.required {
    color: #dc2626;
    font-weight: bold;
}

/* ========================================
   Frontend Styles - تصاویر حرفه‌ای
======================================== */

.pcm-professional-image {
    margin: 30px auto;
    padding: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.pcm-professional-image:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Alignments */
.pcm-image-center {
    display: block;
    text-align: center;
}

.pcm-image-left {
    float: left;
    margin-right: 25px;
    margin-bottom: 20px;
}

.pcm-image-right {
    float: right;
    margin-left: 25px;
    margin-bottom: 20px;
}

.pcm-image-full {
    width: 100%;
    max-width: 100%;
}

/* Image */
.pcm-professional-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px 12px 0 0;
}

.pcm-professional-image[data-zoom="true"] img {
    cursor: zoom-in;
}

/* Caption */
.pcm-image-caption {
    padding: 15px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 2px solid #e5e7eb;
    margin: 0;
}

.pcm-image-number {
    display: inline-block;
    font-weight: 700;
    color: #1e40af;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-left: 5px;
}

/* Image Types - آیکون نوع تصویر */
.pcm-professional-image::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.pcm-professional-image[data-image-type="photo"]::before {
    content: '📷';
}

.pcm-professional-image[data-image-type="infographic"]::before {
    content: '📊';
}

.pcm-professional-image[data-image-type="chart"]::before {
    content: '📈';
}

.pcm-professional-image[data-image-type="screenshot"]::before {
    content: '🖥️';
}

.pcm-professional-image[data-image-type="diagram"]::before {
    content: '🔷';
}

.pcm-professional-image[data-image-type="illustration"]::before {
    content: '🎨';
}

/* Lazy Loading */
.pcm-professional-image img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.4s ease-in;
}

.pcm-professional-image img[loading="lazy"].pcm-loaded {
    opacity: 1;
}

/* Zoom Overlay */
.pcm-image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.pcm-image-zoom-overlay.active {
    display: flex;
}

.pcm-image-zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: zoomIn 0.3s ease;
}

.pcm-zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.pcm-zoom-close:hover {
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pcm-professional-image {
        margin: 20px 0;
    }
    
    .pcm-image-left,
    .pcm-image-right {
        float: none;
        margin: 20px 0;
        width: 100%;
        max-width: 100%;
    }
    
    .pcm-image-caption {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .pcm-image-number {
        font-size: 12px;
        padding: 2px 8px;
    }
    
    .pcm-professional-image::before {
        width: 32px;
        height: 32px;
        font-size: 16px;
        top: 8px;
        right: 8px;
    }
}

/* TinyMCE Editor Styles */
.mce-content-body .pcm-professional-image {
    max-width: 100%;
}

.mce-content-body .pcm-professional-image img {
    max-width: 100%;
}
