/* Mohamed Content Form v3.1 - Compact Layout */

:root {
    --brand-color: #f3e00a;
    --brand-color-dark: #d4c409;
    --text-dark: #2c3e50;
    --border-color: #e1e8ed;
    --bg-light: #f8f9fa;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
}

* {
    box-sizing: border-box;
}

.mcf-wrap {
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    direction: rtl;
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px;
}

.mcf-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 20px;
}

/* التحذيرات - مدمجة */
.mcf-warnings {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border-right: 4px solid var(--brand-color);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.mcf-warnings h3 {
    color: #d4a017;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

.mcf-warnings ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mcf-warnings ul li {
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* النموذج */
.mcf-form {
    margin-top: 15px;
}

.mcf-field {
    margin-bottom: 10px;
}

.mcf-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-size: 13px;
}

.mcf-field label .required {
    color: var(--danger);
    font-weight: bold;
}

.mcf-input,
.mcf-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
    background: #fff;
}

.mcf-input:focus,
.mcf-textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(243, 224, 10, 0.1);
}

.mcf-textarea {
    resize: vertical;
    line-height: 1.5;
}

/* الصفوف المدمجة - جنباً إلى جنب */
.mcf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.mcf-row-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.mcf-row-variant {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.mcf-field-half {
    flex: 1;
}

/* أزرار المعلومات - مدمجة */
.mcf-info-btn {
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
    color: var(--text-dark);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
    display: inline-block;
}

.mcf-info-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(243, 224, 10, 0.3);
}

/* بلوكات المنتجات - مدمجة */
.product-block {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-color);
}

.product-header h3 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.remove-product-btn {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.remove-product-btn:hover {
    background: #c82333;
}

/* المتغيرات - مدمجة */
.variants-container {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    border: 2px solid var(--border-color);
}

.variants-container h4 {
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-color);
}

.variant-block {
    background: var(--bg-light);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    position: relative;
}

.remove-variant-btn {
    background: var(--warning);
    color: var(--text-dark);
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    font-family: 'Cairo', sans-serif;
    display: none;
}

.remove-variant-btn:hover {
    background: #e0a800;
}

.add-variant-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    font-size: 13px;
}

/* أزرار التحكم */
.mcf-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 3px solid var(--brand-color);
}

.mcf-btn-primary,
.mcf-btn-secondary {
    padding: 12px 35px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.mcf-btn-primary {
    background: linear-gradient(135deg, var(--success) 0%, #218838 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.mcf-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.mcf-btn-secondary {
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(243, 224, 10, 0.3);
}

.mcf-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 224, 10, 0.4);
}

/* النوافذ المنبثقة */
.mcf-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.mcf-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-height: 80vh;
    overflow-y: auto;
}

.mcf-modal-content h3 {
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--brand-color);
}

.mcf-modal-content ul {
    padding-right: 20px;
    line-height: 1.7;
}

.mcf-modal-content ul li {
    margin-bottom: 10px;
    font-size: 14px;
}

.mcf-modal-close {
    color: #aaa;
    float: left;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mcf-modal-close:hover {
    color: var(--danger);
}

/* أنيميشن التحميل */
.mcf-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 1200px) {
    .mcf-row-variant {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mcf-container {
        padding: 15px;
    }
    
    .mcf-row,
    .mcf-row-cols {
        grid-template-columns: 1fr;
    }
    
    .mcf-row-variant {
        grid-template-columns: 1fr;
    }
    
    .mcf-actions {
        flex-direction: column;
    }
    
    .mcf-btn-primary,
    .mcf-btn-secondary {
        width: 100%;
    }
}